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

Commit 8fe24e08 authored by Winson Chung's avatar Winson Chung
Browse files

Reapply previous states when recreating the task bar

- When the taskbar is recreated (ie. from a display config change),
  the previous states sent from SysUI need to be reapplied to the
  new controllers

Fixes: 267664948
Test: Wipe device, in SUW accessibility settings change the display
      density and verify it properly tints the back button
Change-Id: I837a67ced2941d4545359b8231026044b5479767
parent f5f3a809
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -247,6 +247,12 @@ public class TaskbarActivityContext extends BaseTaskbarContext {
        // Initialize controllers after all are constructed.
        mControllers.init(sharedState);
        updateSysuiStateFlags(sharedState.sysuiStateFlags, true /* fromInit */);
        disableNavBarElements(sharedState.disableNavBarDisplayId, sharedState.disableNavBarState1,
                sharedState.disableNavBarState2, false /* animate */);
        onSystemBarAttributesChanged(sharedState.systemBarAttrsDisplayId,
                sharedState.systemBarAttrsBehavior);
        onNavButtonsDarkIntensityChanged(sharedState.navButtonsDarkIntensity);


        if (!mAddedWindow) {
            mWindowManager.addView(mDragLayer, mWindowLayoutParams);
+6 −0
Original line number Diff line number Diff line
@@ -362,18 +362,24 @@ public class TaskbarManager {
    }

    public void disableNavBarElements(int displayId, int state1, int state2, boolean animate) {
        mSharedState.disableNavBarDisplayId = displayId;
        mSharedState.disableNavBarState1 = state1;
        mSharedState.disableNavBarState2 = state2;
        if (mTaskbarActivityContext != null) {
            mTaskbarActivityContext.disableNavBarElements(displayId, state1, state2, animate);
        }
    }

    public void onSystemBarAttributesChanged(int displayId, int behavior) {
        mSharedState.systemBarAttrsDisplayId = displayId;
        mSharedState.systemBarAttrsBehavior = behavior;
        if (mTaskbarActivityContext != null) {
            mTaskbarActivityContext.onSystemBarAttributesChanged(displayId, behavior);
        }
    }

    public void onNavButtonsDarkIntensityChanged(float darkIntensity) {
        mSharedState.navButtonsDarkIntensity = darkIntensity;
        if (mTaskbarActivityContext != null) {
            mTaskbarActivityContext.onNavButtonsDarkIntensityChanged(darkIntensity);
        }
+13 −0
Original line number Diff line number Diff line
@@ -20,8 +20,21 @@ package com.android.launcher3.taskbar;
 */
public class TaskbarSharedState {

    // TaskbarManager#onSystemUiFlagsChanged
    public int sysuiStateFlags;

    // TaskbarManager#disableNavBarElements()
    public int disableNavBarDisplayId;
    public int disableNavBarState1;
    public int disableNavBarState2;

    // TaskbarManager#onSystemBarAttributesChanged()
    public int systemBarAttrsDisplayId;
    public int systemBarAttrsBehavior;

    // TaskbarManager#onNavButtonsDarkIntensityChanged()
    public float navButtonsDarkIntensity;

    public boolean setupUIVisible = false;

    public boolean allAppsVisible = false;