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

Commit 301eaf2b authored by Sunny Goyal's avatar Sunny Goyal
Browse files

Initiate taskbar only after the user is unlocked

Bug: 188755902
Test: Presubmit
Change-Id: Ida4bc07f45396e82ab404a617aa6833afeea78bc
parent f8b1c3b3
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -57,6 +57,8 @@ public class TaskbarManager implements DisplayController.DisplayInfoChangeListen
    private static final int CHANGE_FLAGS =
            CHANGE_ACTIVE_SCREEN | CHANGE_DENSITY | CHANGE_SUPPORTED_BOUNDS;

    private boolean mUserUnlocked = false;

    public TaskbarManager(TouchInteractionService service) {
        mDisplayController = DisplayController.INSTANCE.get(service);
        mSysUINavigationMode = SysUINavigationMode.INSTANCE.get(service);
@@ -89,6 +91,14 @@ public class TaskbarManager implements DisplayController.DisplayInfoChangeListen
        }
    }

    /**
     * Called when the user is unlocked
     */
    public void onUserUnlocked() {
        mUserUnlocked = true;
        recreateTaskbar();
    }

    /**
     * Sets or clears a launcher to act as taskbar callback
     */
@@ -106,6 +116,9 @@ public class TaskbarManager implements DisplayController.DisplayInfoChangeListen
        if (!FeatureFlags.ENABLE_TASKBAR.get()) {
            return;
        }
        if (!mUserUnlocked) {
            return;
        }
        DeviceProfile dp = LauncherAppState.getIDP(mContext).getDeviceProfile(mContext);
        if (!dp.isTaskbarPresent) {
            return;
+1 −0
Original line number Diff line number Diff line
@@ -325,6 +325,7 @@ public class TouchInteractionService extends Service implements PluginListener<O
        mDeviceState.addNavigationModeChangedCallback(this::onNavigationModeChanged);
        mDeviceState.addOneHandedModeChangedCallback(this::onOneHandedModeOverlayChanged);
        mDeviceState.runOnUserUnlocked(this::onUserUnlocked);
        mDeviceState.runOnUserUnlocked(mTaskbarManager::onUserUnlocked);
        ProtoTracer.INSTANCE.get(this).add(this);
        sConnected = true;
    }