Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5a36b919 authored by Tony Wickham's avatar Tony Wickham
Browse files

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
parent 58923215
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -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;
    }