Call onUserUnlocked() before adding callbacks
This gives us a chance to initialize things in onUserUnlocked() if we're already unlocked, before doing any other logic that might use those variables.
Test: None (unable to reproduce)
Fixes: 184773649
Change-Id: I72ed91ae6202ec816f9bdceb4d9fd03b9a002816
diff --git a/quickstep/src/com/android/quickstep/TouchInteractionService.java b/quickstep/src/com/android/quickstep/TouchInteractionService.java
index db5c93c..0f5671c 100644
--- a/quickstep/src/com/android/quickstep/TouchInteractionService.java
+++ b/quickstep/src/com/android/quickstep/TouchInteractionService.java
@@ -331,12 +331,14 @@
mDeviceState = new RecentsAnimationDeviceState(this, true);
mDisplayManager = getSystemService(DisplayManager.class);
mTaskbarManager = new TaskbarManager(this);
-
mRotationTouchHelper = mDeviceState.getRotationTouchHelper();
- mDeviceState.addNavigationModeChangedCallback(this::onNavigationModeChanged);
- mDeviceState.addOneHandedModeChangedCallback(this::onOneHandedModeOverlayChanged);
+
+ // Call runOnUserUnlocked() before any other callbacks to ensure everything is initialized.
mDeviceState.runOnUserUnlocked(this::onUserUnlocked);
mDeviceState.runOnUserUnlocked(mTaskbarManager::onUserUnlocked);
+ mDeviceState.addNavigationModeChangedCallback(this::onNavigationModeChanged);
+ mDeviceState.addOneHandedModeChangedCallback(this::onOneHandedModeOverlayChanged);
+
ProtoTracer.INSTANCE.get(this).add(this);
sConnected = true;
}