Merge "When the notification shade is shown the functionality to show/hide HUN should be controlled via a config flag." into qt-dev

This commit is contained in:
TreeHugger Robot
2019-06-18 18:58:43 +00:00
committed by Android (Google) Code Review
2 changed files with 15 additions and 1 deletions

View File

@@ -29,6 +29,9 @@
<bool name="config_enableRightNavigationBar">false</bool> <bool name="config_enableRightNavigationBar">false</bool>
<bool name="config_enableBottomNavigationBar">true</bool> <bool name="config_enableBottomNavigationBar">true</bool>
<!-- Whether heads-up notifications should be shown when shade is open. -->
<bool name="config_enableHeadsUpNotificationWhenNotificationShadeOpen">true</bool>
<bool name="config_hideNavWhenKeyguardBouncerShown">true</bool> <bool name="config_hideNavWhenKeyguardBouncerShown">true</bool>
<bool name="config_enablePersistentDockedActivity">false</bool> <bool name="config_enablePersistentDockedActivity">false</bool>
<string name="config_persistentDockedActivityIntentUri" translatable="false"></string> <string name="config_persistentDockedActivityIntentUri" translatable="false"></string>

View File

@@ -165,6 +165,8 @@ public class CarStatusBar extends StatusBar implements
private boolean mIsNotificationCardSwiping; private boolean mIsNotificationCardSwiping;
// If notification shade is being swiped vertically to close. // If notification shade is being swiped vertically to close.
private boolean mIsSwipingVerticallyToClose; private boolean mIsSwipingVerticallyToClose;
// Whether heads-up notifications should be shown when shade is open.
private boolean mEnableHeadsUpNotificationWhenNotificationShadeOpen;
private final CarPowerStateListener mCarPowerStateListener = private final CarPowerStateListener mCarPowerStateListener =
(int state) -> { (int state) -> {
@@ -459,6 +461,8 @@ public class CarStatusBar extends StatusBar implements
} }
}); });
mEnableHeadsUpNotificationWhenNotificationShadeOpen = mContext.getResources().getBoolean(
R.bool.config_enableHeadsUpNotificationWhenNotificationShadeOpen);
CarHeadsUpNotificationManager carHeadsUpNotificationManager = CarHeadsUpNotificationManager carHeadsUpNotificationManager =
new CarSystemUIHeadsUpNotificationManager(mContext, new CarSystemUIHeadsUpNotificationManager(mContext,
mNotificationClickHandlerFactory, mNotificationDataManager); mNotificationClickHandlerFactory, mNotificationDataManager);
@@ -1272,12 +1276,19 @@ public class CarStatusBar extends StatusBar implements
mHeadsUpPanel.setVisibility(View.INVISIBLE); mHeadsUpPanel.setVisibility(View.INVISIBLE);
} }
@Override
protected void setInternalInsetsInfo(ViewTreeObserver.InternalInsetsInfo info,
HeadsUpEntry currentNotification, boolean panelExpanded) {
super.setInternalInsetsInfo(info, currentNotification, mPanelExpanded);
}
@Override @Override
protected void setHeadsUpVisible() { protected void setHeadsUpVisible() {
// if the Notifications panel is showing don't show the Heads up // if the Notifications panel is showing don't show the Heads up
if (mPanelExpanded) { if (!mEnableHeadsUpNotificationWhenNotificationShadeOpen && mPanelExpanded) {
return; return;
} }
super.setHeadsUpVisible(); super.setHeadsUpVisible();
if (mHeadsUpPanel.getVisibility() == View.VISIBLE) { if (mHeadsUpPanel.getVisibility() == View.VISIBLE) {
mStatusBarWindowController.setHeadsUpShowing(true); mStatusBarWindowController.setHeadsUpShowing(true);