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
This commit is contained in:
Tony Wickham
2021-09-03 15:00:08 -07:00
parent 5892321516
commit 5a36b919b5

View File

@@ -331,12 +331,14 @@ public class TouchInteractionService extends Service implements PluginListener<O
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;
}