Don't removePluginListener() unless user is unlocked
This just crashes since we can't access SharedPreferences, and we don't
addPluginListener until onUserUnlocked() anyway.
Bug: 145019350
Change-Id: I705498f859857a52a2cb5735201a652973b26d0b
(cherry picked from commit 435b11b95fd83901e7c2dc36269442b3c1312c95)
diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/TouchInteractionService.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/TouchInteractionService.java
index 71f8ba4..07537ed 100644
--- a/quickstep/recents_ui_overrides/src/com/android/quickstep/TouchInteractionService.java
+++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/TouchInteractionService.java
@@ -391,12 +391,11 @@
@Override
public void onDestroy() {
- PluginManagerWrapper.INSTANCE.get(getBaseContext()).removePluginListener(this);
-
sIsInitialized = false;
if (mDeviceState.isUserUnlocked()) {
mInputConsumer.unregisterInputConsumer();
mOverviewComponentObserver.onDestroy();
+ PluginManagerWrapper.INSTANCE.get(getBaseContext()).removePluginListener(this);
}
disposeEventHandlers();
mDeviceState.destroy();