mirror of
https://github.com/libretro/ppsspp.git
synced 2024-11-23 08:09:51 +00:00
Android: Fix crashes on Android versions < 11 due to mCameraHelper being null
This commit is contained in:
parent
9d65ff8873
commit
f3b84fd8a4
@ -740,7 +740,9 @@ public abstract class NativeActivity extends Activity implements SurfaceHolder.C
|
||||
Log.e(TAG, "mGLSurfaceView really shouldn't be null in onPause");
|
||||
}
|
||||
}
|
||||
mCameraHelper.pause();
|
||||
if (mCameraHelper != null) {
|
||||
mCameraHelper.pause();
|
||||
}
|
||||
Log.i(TAG, "onPause completed");
|
||||
}
|
||||
|
||||
@ -780,7 +782,9 @@ public abstract class NativeActivity extends Activity implements SurfaceHolder.C
|
||||
mSurfaceView.onResume();
|
||||
}
|
||||
}
|
||||
mCameraHelper.resume();
|
||||
if (mCameraHelper != null) {
|
||||
mCameraHelper.resume();
|
||||
}
|
||||
|
||||
gainAudioFocus(this.audioManager, this.audioFocusChangeListener);
|
||||
NativeApp.resume();
|
||||
@ -1339,7 +1343,9 @@ public abstract class NativeActivity extends Activity implements SurfaceHolder.C
|
||||
}
|
||||
} else if (command.equals("event")) {
|
||||
if (params.equals("exitgame")) {
|
||||
mCameraHelper.stopCamera();
|
||||
if (mCameraHelper != null) {
|
||||
mCameraHelper.stopCamera();
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
Loading…
Reference in New Issue
Block a user