mirror of
https://github.com/moonlight-stream/moonlight-android.git
synced 2025-07-19 19:13:03 +00:00
Fix NPE if the device doesn't support H.264 hardware decoding
This commit is contained in:
parent
01458770d2
commit
7f1fe5f520
@ -171,6 +171,20 @@ public class Game extends Activity implements SurfaceHolder.Callback,
|
||||
streamView.setOnGenericMotionListener(this);
|
||||
streamView.setOnTouchListener(this);
|
||||
|
||||
inputCaptureProvider = InputCaptureManager.getInputCaptureProvider(this, this);
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
// The view must be focusable for pointer capture to work.
|
||||
streamView.setFocusable(true);
|
||||
streamView.setDefaultFocusHighlightEnabled(false);
|
||||
streamView.setOnCapturedPointerListener(new View.OnCapturedPointerListener() {
|
||||
@Override
|
||||
public boolean onCapturedPointer(View view, MotionEvent motionEvent) {
|
||||
return handleMotionEvent(motionEvent);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Warn the user if they're on a metered connection
|
||||
checkDataConnection();
|
||||
|
||||
@ -257,20 +271,6 @@ public class Game extends Activity implements SurfaceHolder.Callback,
|
||||
getWindow().setSustainedPerformanceMode(true);
|
||||
}
|
||||
|
||||
inputCaptureProvider = InputCaptureManager.getInputCaptureProvider(this, this);
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
// The view must be focusable for pointer capture to work.
|
||||
streamView.setFocusable(true);
|
||||
streamView.setDefaultFocusHighlightEnabled(false);
|
||||
streamView.setOnCapturedPointerListener(new View.OnCapturedPointerListener() {
|
||||
@Override
|
||||
public boolean onCapturedPointer(View view, MotionEvent motionEvent) {
|
||||
return handleMotionEvent(motionEvent);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (prefConfig.onscreenController) {
|
||||
// create virtual onscreen controller
|
||||
virtualController = new VirtualController(conn,
|
||||
|
Loading…
x
Reference in New Issue
Block a user