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

This commit is contained in:
TreeHugger Robot
2019-03-13 16:43:36 +00:00
committed by Android (Google) Code Review
3 changed files with 21 additions and 1 deletions

View File

@@ -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();

View File

@@ -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() { }
}

View File

@@ -538,7 +538,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;