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

Commit 75221649 authored by Brad Stenning's avatar Brad Stenning
Browse files

Restore the correct state of the statusbar, navbar, and keygaurd after an density change

Bug:117223261

Test: manual
Change-Id: Ie3b1a6471c640b20cdb73012d91b6113b66cd87b
(cherry picked from commit f3976bae672f587943c657c79c1d54aa0e89c450)
parent c02b1d72
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -161,6 +161,11 @@ public class CarStatusBar extends StatusBar implements
        }

        buildNavBarContent();
        // If the UI was rebuilt (day/night change) while the keyguard was up we need to
        // correctly respect that state.
        if (mIsKeyguard) {
            updateNavBarForKeyguardContent();
        }
    }

    private void addTemperatureViewToController(View v) {
@@ -211,6 +216,13 @@ public class CarStatusBar extends StatusBar implements
    @Override
    public void showKeyguard() {
        super.showKeyguard();
        updateNavBarForKeyguardContent();
    }

    /**
     * Switch to the keyguard applicable content contained in the nav bars
     */
    private void updateNavBarForKeyguardContent() {
        getComponent(NotificationsUI.class).closeCarNotifications(0);
        if (mNavigationBarView != null) {
            mNavigationBarView.showKeyguardButtons();
+8 −0
Original line number Diff line number Diff line
@@ -64,4 +64,12 @@ public class CarStatusBarKeyguardViewManager extends StatusBarKeyguardViewManage
        CarStatusBar statusBar = (CarStatusBar) mStatusBar;
        statusBar.showUserSwitcher();
    }

    /**
     * Do nothing on this change.
     * The base class hides the keyguard which for automotive we want to avoid b/c this would happen
     * on a configuration change due to day/night (headlight state).
     */
    @Override
    public void onDensityOrFontScaleChanged() {  }
}
+1 −1
Original line number Diff line number Diff line
@@ -537,7 +537,7 @@ public class StatusBar extends SystemUI implements DemoMode,
    private BatteryController mBatteryController;
    protected boolean mPanelExpanded;
    private UiModeManager mUiModeManager;
    private boolean mIsKeyguard;
    protected boolean mIsKeyguard;
    private LogMaker mStatusBarStateLog;
    protected NotificationIconAreaController mNotificationIconAreaController;
    @Nullable private View mAmbientIndicationContainer;