From ce7c51a9cc9d9dae560f7fefe7cf6ddf465d885d Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sun, 26 Jan 2020 00:37:48 -0800 Subject: [PATCH] Always release devices in onPause in case we're going to be force stopped, and for consistency with interacting with other activities that might use the controller --- .../main/java/org/libsdl/app/SDLActivity.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/android-project/app/src/main/java/org/libsdl/app/SDLActivity.java b/android-project/app/src/main/java/org/libsdl/app/SDLActivity.java index 615f84c45..b34415668 100644 --- a/android-project/app/src/main/java/org/libsdl/app/SDLActivity.java +++ b/android-project/app/src/main/java/org/libsdl/app/SDLActivity.java @@ -283,10 +283,6 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh return; } - if (mHIDDeviceManager != null) { - mHIDDeviceManager.setFrozen(true); - } - SDLActivity.handleNativeState(); } @@ -298,10 +294,6 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh return; } - if (mHIDDeviceManager != null) { - mHIDDeviceManager.setFrozen(false); - } - SDLActivity.handleNativeState(); } @@ -310,6 +302,10 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh protected void onPause() { Log.v(TAG, "onPause()"); super.onPause(); + + if (mHIDDeviceManager != null) { + mHIDDeviceManager.setFrozen(true); + } if (!mHasMultiWindow) { pauseNativeThread(); } @@ -319,6 +315,10 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh protected void onResume() { Log.v(TAG, "onResume()"); super.onResume(); + + if (mHIDDeviceManager != null) { + mHIDDeviceManager.setFrozen(false); + } if (!mHasMultiWindow) { resumeNativeThread(); }