Skip to content

Commit

Permalink
Always release devices in onPause in case we're going to be force sto…
Browse files Browse the repository at this point in the history
…pped, and for consistency with interacting with other activities that might use the controller
  • Loading branch information
slouken committed Jan 26, 2020
1 parent c9f672f commit ce7c51a
Showing 1 changed file with 8 additions and 8 deletions.
Expand Up @@ -283,10 +283,6 @@ protected void pauseNativeThread() {
return;
}

if (mHIDDeviceManager != null) {
mHIDDeviceManager.setFrozen(true);
}

SDLActivity.handleNativeState();
}

Expand All @@ -298,10 +294,6 @@ protected void resumeNativeThread() {
return;
}

if (mHIDDeviceManager != null) {
mHIDDeviceManager.setFrozen(false);
}

SDLActivity.handleNativeState();
}

Expand All @@ -310,6 +302,10 @@ protected void resumeNativeThread() {
protected void onPause() {
Log.v(TAG, "onPause()");
super.onPause();

if (mHIDDeviceManager != null) {
mHIDDeviceManager.setFrozen(true);
}
if (!mHasMultiWindow) {
pauseNativeThread();
}
Expand All @@ -319,6 +315,10 @@ protected void onPause() {
protected void onResume() {
Log.v(TAG, "onResume()");
super.onResume();

if (mHIDDeviceManager != null) {
mHIDDeviceManager.setFrozen(false);
}
if (!mHasMultiWindow) {
resumeNativeThread();
}
Expand Down

0 comments on commit ce7c51a

Please sign in to comment.