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

Commit 8bd920f8 authored by Priyank Singh's avatar Priyank Singh
Browse files

When the notification shade is shown the functionality to show/hide HUN should...

When the notification shade is shown the functionality to show/hide HUN should be controlled via a config flag.

Bug:134767666
Test: Manual
Change-Id: Id8097a99e0a2424e66f171e7ed47fe3befae7f8a
parent 3d87a992
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -29,6 +29,9 @@
    <bool name="config_enableRightNavigationBar">false</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_enablePersistentDockedActivity">false</bool>
    <string name="config_persistentDockedActivityIntentUri" translatable="false"></string>
+12 −1
Original line number Diff line number Diff line
@@ -163,6 +163,8 @@ public class CarStatusBar extends StatusBar implements
    private boolean mIsNotificationCardSwiping;
    // If notification shade is being swiped vertically to close.
    private boolean mIsSwipingVerticallyToClose;
    // Whether heads-up notifications should be shown when shade is open.
    private boolean mEnableHeadsUpNotificationWhenNotificationShadeOpen;

    private final CarPowerStateListener mCarPowerStateListener =
            (int state) -> {
@@ -455,6 +457,8 @@ public class CarStatusBar extends StatusBar implements
                    }
                });

        mEnableHeadsUpNotificationWhenNotificationShadeOpen = mContext.getResources().getBoolean(
                R.bool.config_enableHeadsUpNotificationWhenNotificationShadeOpen);
        CarHeadsUpNotificationManager carHeadsUpNotificationManager =
                new CarSystemUIHeadsUpNotificationManager(mContext,
                        mNotificationClickHandlerFactory, mNotificationDataManager);
@@ -1257,12 +1261,19 @@ public class CarStatusBar extends StatusBar implements
            mHeadsUpPanel.setVisibility(View.INVISIBLE);
        }

        @Override
        protected void setInternalInsetsInfo(ViewTreeObserver.InternalInsetsInfo info,
                HeadsUpEntry currentNotification, boolean panelExpanded) {
            super.setInternalInsetsInfo(info, currentNotification, mPanelExpanded);
        }

        @Override
        protected void setHeadsUpVisible() {
            // if the Notifications panel is showing don't show the Heads up
            if (mPanelExpanded) {
            if (!mEnableHeadsUpNotificationWhenNotificationShadeOpen && mPanelExpanded) {
                return;
            }

            super.setHeadsUpVisible();
            if (mHeadsUpPanel.getVisibility() == View.VISIBLE) {
                mStatusBarWindowController.setHeadsUpShowing(true);