Loading packages/CarSystemUI/res/values/config.xml +4 −0 Original line number Diff line number Diff line Loading @@ -32,6 +32,10 @@ <!-- Disable normal notification rendering; we handle that ourselves --> <bool name="config_renderNotifications">false</bool> <!-- Whether navigationBar touch events should be consumed before reaching the CarFacetButton \ when the notification panel is open. --> <bool name="config_consumeNavigationBarTouchWhenNotificationPanelOpen">false</bool> <!-- Whether heads-up notifications should be shown when shade is open. --> <bool name="config_enableHeadsUpNotificationWhenNotificationShadeOpen">true</bool> <!-- Whether heads-up notifications should be shown on the bottom. If false, heads-up Loading packages/CarSystemUI/src/com/android/systemui/car/notification/NotificationPanelViewController.java +5 −0 Original line number Diff line number Diff line Loading @@ -599,6 +599,11 @@ public class NotificationPanelViewController extends OverlayViewController { } } /** Returns {@code true} if the notification panel is expanded. */ public boolean isPanelExpanded() { return mPanelExpanded; } /** Sets the unseen count listener. */ public void setOnUnseenCountUpdateListener(OnUnseenCountUpdateListener listener) { mUnseenCountUpdateListener = listener; Loading packages/CarSystemUI/src/com/android/systemui/car/notification/NotificationPanelViewMediator.java +11 −5 Original line number Diff line number Diff line Loading @@ -20,7 +20,6 @@ import android.car.hardware.power.CarPowerManager; import android.content.res.Configuration; import com.android.systemui.car.CarDeviceProvisionedController; import com.android.systemui.car.CarServiceProvider; import com.android.systemui.navigationbar.car.CarNavigationBarController; import com.android.systemui.statusbar.car.PowerManagerHelper; import com.android.systemui.statusbar.policy.ConfigurationController; Loading @@ -36,7 +35,6 @@ public class NotificationPanelViewMediator implements OverlayViewMediator, private final CarNavigationBarController mCarNavigationBarController; private final NotificationPanelViewController mNotificationPanelViewController; private final CarServiceProvider mCarServiceProvider; private final PowerManagerHelper mPowerManagerHelper; private final CarDeviceProvisionedController mCarDeviceProvisionedController; private final ConfigurationController mConfigurationController; Loading @@ -46,7 +44,6 @@ public class NotificationPanelViewMediator implements OverlayViewMediator, CarNavigationBarController carNavigationBarController, NotificationPanelViewController notificationPanelViewController, CarServiceProvider carServiceProvider, PowerManagerHelper powerManagerHelper, CarDeviceProvisionedController carDeviceProvisionedController, Loading @@ -54,7 +51,6 @@ public class NotificationPanelViewMediator implements OverlayViewMediator, ) { mCarNavigationBarController = carNavigationBarController; mNotificationPanelViewController = notificationPanelViewController; mCarServiceProvider = carServiceProvider; mPowerManagerHelper = powerManagerHelper; mCarDeviceProvisionedController = carDeviceProvisionedController; mConfigurationController = configurationController; Loading @@ -72,7 +68,17 @@ public class NotificationPanelViewMediator implements OverlayViewMediator, mNotificationPanelViewController.getNavBarNotificationTouchListener()); mCarNavigationBarController.registerNotificationController( () -> mNotificationPanelViewController.toggle()); new CarNavigationBarController.NotificationsShadeController() { @Override public void togglePanel() { mNotificationPanelViewController.toggle(); } @Override public boolean isNotificationPanelOpen() { return mNotificationPanelViewController.isPanelExpanded(); } }); } @Override Loading packages/CarSystemUI/src/com/android/systemui/navigationbar/car/CarNavigationBarController.java +3 −0 Original line number Diff line number Diff line Loading @@ -314,6 +314,9 @@ public class CarNavigationBarController { public interface NotificationsShadeController { /** Toggles the visibility of the notifications shade. */ void togglePanel(); /** Returns {@code true} if the panel is open. */ boolean isNotificationPanelOpen(); } private void checkAllBars(boolean isSetUp) { Loading packages/CarSystemUI/src/com/android/systemui/navigationbar/car/CarNavigationBarView.java +11 −2 Original line number Diff line number Diff line Loading @@ -35,10 +35,11 @@ import com.android.systemui.statusbar.phone.StatusBarIconController; * in a linear layout. */ public class CarNavigationBarView extends LinearLayout { private final boolean mConsumeTouchWhenPanelOpen; private View mNavButtons; private CarNavigationButton mNotificationsButton; private NotificationsShadeController mNotificationsShadeController; private Context mContext; private View mLockScreenButtons; // used to wire in open/close gestures for notifications private OnTouchListener mStatusBarWindowTouchListener; Loading @@ -46,7 +47,8 @@ public class CarNavigationBarView extends LinearLayout { public CarNavigationBarView(Context context, AttributeSet attrs) { super(context, attrs); mContext = context; mConsumeTouchWhenPanelOpen = getResources().getBoolean( R.bool.config_consumeNavigationBarTouchWhenNotificationPanelOpen); } @Override Loading Loading @@ -77,9 +79,16 @@ public class CarNavigationBarView extends LinearLayout { @Override public boolean onInterceptTouchEvent(MotionEvent ev) { if (mStatusBarWindowTouchListener != null) { boolean shouldConsumeEvent = mNotificationsShadeController == null ? false : mNotificationsShadeController.isNotificationPanelOpen(); // Forward touch events to the status bar window so it can drag // windows if required (Notification shade) mStatusBarWindowTouchListener.onTouch(this, ev); if (mConsumeTouchWhenPanelOpen && shouldConsumeEvent) { return true; } } return super.onInterceptTouchEvent(ev); } Loading Loading
packages/CarSystemUI/res/values/config.xml +4 −0 Original line number Diff line number Diff line Loading @@ -32,6 +32,10 @@ <!-- Disable normal notification rendering; we handle that ourselves --> <bool name="config_renderNotifications">false</bool> <!-- Whether navigationBar touch events should be consumed before reaching the CarFacetButton \ when the notification panel is open. --> <bool name="config_consumeNavigationBarTouchWhenNotificationPanelOpen">false</bool> <!-- Whether heads-up notifications should be shown when shade is open. --> <bool name="config_enableHeadsUpNotificationWhenNotificationShadeOpen">true</bool> <!-- Whether heads-up notifications should be shown on the bottom. If false, heads-up Loading
packages/CarSystemUI/src/com/android/systemui/car/notification/NotificationPanelViewController.java +5 −0 Original line number Diff line number Diff line Loading @@ -599,6 +599,11 @@ public class NotificationPanelViewController extends OverlayViewController { } } /** Returns {@code true} if the notification panel is expanded. */ public boolean isPanelExpanded() { return mPanelExpanded; } /** Sets the unseen count listener. */ public void setOnUnseenCountUpdateListener(OnUnseenCountUpdateListener listener) { mUnseenCountUpdateListener = listener; Loading
packages/CarSystemUI/src/com/android/systemui/car/notification/NotificationPanelViewMediator.java +11 −5 Original line number Diff line number Diff line Loading @@ -20,7 +20,6 @@ import android.car.hardware.power.CarPowerManager; import android.content.res.Configuration; import com.android.systemui.car.CarDeviceProvisionedController; import com.android.systemui.car.CarServiceProvider; import com.android.systemui.navigationbar.car.CarNavigationBarController; import com.android.systemui.statusbar.car.PowerManagerHelper; import com.android.systemui.statusbar.policy.ConfigurationController; Loading @@ -36,7 +35,6 @@ public class NotificationPanelViewMediator implements OverlayViewMediator, private final CarNavigationBarController mCarNavigationBarController; private final NotificationPanelViewController mNotificationPanelViewController; private final CarServiceProvider mCarServiceProvider; private final PowerManagerHelper mPowerManagerHelper; private final CarDeviceProvisionedController mCarDeviceProvisionedController; private final ConfigurationController mConfigurationController; Loading @@ -46,7 +44,6 @@ public class NotificationPanelViewMediator implements OverlayViewMediator, CarNavigationBarController carNavigationBarController, NotificationPanelViewController notificationPanelViewController, CarServiceProvider carServiceProvider, PowerManagerHelper powerManagerHelper, CarDeviceProvisionedController carDeviceProvisionedController, Loading @@ -54,7 +51,6 @@ public class NotificationPanelViewMediator implements OverlayViewMediator, ) { mCarNavigationBarController = carNavigationBarController; mNotificationPanelViewController = notificationPanelViewController; mCarServiceProvider = carServiceProvider; mPowerManagerHelper = powerManagerHelper; mCarDeviceProvisionedController = carDeviceProvisionedController; mConfigurationController = configurationController; Loading @@ -72,7 +68,17 @@ public class NotificationPanelViewMediator implements OverlayViewMediator, mNotificationPanelViewController.getNavBarNotificationTouchListener()); mCarNavigationBarController.registerNotificationController( () -> mNotificationPanelViewController.toggle()); new CarNavigationBarController.NotificationsShadeController() { @Override public void togglePanel() { mNotificationPanelViewController.toggle(); } @Override public boolean isNotificationPanelOpen() { return mNotificationPanelViewController.isPanelExpanded(); } }); } @Override Loading
packages/CarSystemUI/src/com/android/systemui/navigationbar/car/CarNavigationBarController.java +3 −0 Original line number Diff line number Diff line Loading @@ -314,6 +314,9 @@ public class CarNavigationBarController { public interface NotificationsShadeController { /** Toggles the visibility of the notifications shade. */ void togglePanel(); /** Returns {@code true} if the panel is open. */ boolean isNotificationPanelOpen(); } private void checkAllBars(boolean isSetUp) { Loading
packages/CarSystemUI/src/com/android/systemui/navigationbar/car/CarNavigationBarView.java +11 −2 Original line number Diff line number Diff line Loading @@ -35,10 +35,11 @@ import com.android.systemui.statusbar.phone.StatusBarIconController; * in a linear layout. */ public class CarNavigationBarView extends LinearLayout { private final boolean mConsumeTouchWhenPanelOpen; private View mNavButtons; private CarNavigationButton mNotificationsButton; private NotificationsShadeController mNotificationsShadeController; private Context mContext; private View mLockScreenButtons; // used to wire in open/close gestures for notifications private OnTouchListener mStatusBarWindowTouchListener; Loading @@ -46,7 +47,8 @@ public class CarNavigationBarView extends LinearLayout { public CarNavigationBarView(Context context, AttributeSet attrs) { super(context, attrs); mContext = context; mConsumeTouchWhenPanelOpen = getResources().getBoolean( R.bool.config_consumeNavigationBarTouchWhenNotificationPanelOpen); } @Override Loading Loading @@ -77,9 +79,16 @@ public class CarNavigationBarView extends LinearLayout { @Override public boolean onInterceptTouchEvent(MotionEvent ev) { if (mStatusBarWindowTouchListener != null) { boolean shouldConsumeEvent = mNotificationsShadeController == null ? false : mNotificationsShadeController.isNotificationPanelOpen(); // Forward touch events to the status bar window so it can drag // windows if required (Notification shade) mStatusBarWindowTouchListener.onTouch(this, ev); if (mConsumeTouchWhenPanelOpen && shouldConsumeEvent) { return true; } } return super.onInterceptTouchEvent(ev); } Loading