Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java +7 −0 Original line number Diff line number Diff line Loading @@ -1896,6 +1896,13 @@ public class StatusBar extends SystemUI implements DemoMode, } } if (!panelsEnabled()) { if (DEBUG) { Log.d(TAG, "No peeking: disabled panel : " + sbn.getKey()); } return false; } if (sbn.getNotification().fullScreenIntent != null) { if (mAccessibilityManager.isTouchExplorationEnabled()) { if (DEBUG) Log.d(TAG, "No peeking: accessible fullscreen: " + sbn.getKey()); Loading packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarTest.java +24 −0 Original line number Diff line number Diff line Loading @@ -442,6 +442,30 @@ public class StatusBarTest extends SysuiTestCase { assertTrue(mEntryManager.shouldPeek(entry, sbn)); } @Test public void testPeek_disabledStatusBar() { Notification n = new Notification.Builder(getContext(), "a").build(); StatusBarNotification sbn = new StatusBarNotification("a", "a", 0, "a", 0, 0, n, UserHandle.of(0), null, 0); NotificationData.Entry entry = new NotificationData.Entry(sbn); mStatusBar.disable(StatusBarManager.DISABLE_EXPAND, 0, false /* animate */); assertFalse("The panel shouldn't allow peek while disabled", mStatusBar.shouldPeek(entry, sbn)); } @Test public void testPeek_disabledNotificationShade() { Notification n = new Notification.Builder(getContext(), "a").build(); StatusBarNotification sbn = new StatusBarNotification("a", "a", 0, "a", 0, 0, n, UserHandle.of(0), null, 0); NotificationData.Entry entry = new NotificationData.Entry(sbn); mStatusBar.disable(0, StatusBarManager.DISABLE2_NOTIFICATION_SHADE, false /* animate */); assertFalse("The panel shouldn't allow peek while notitifcation shade disabled", mStatusBar.shouldPeek(entry, sbn)); } @Test public void testLogHidden() { try { Loading Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java +7 −0 Original line number Diff line number Diff line Loading @@ -1896,6 +1896,13 @@ public class StatusBar extends SystemUI implements DemoMode, } } if (!panelsEnabled()) { if (DEBUG) { Log.d(TAG, "No peeking: disabled panel : " + sbn.getKey()); } return false; } if (sbn.getNotification().fullScreenIntent != null) { if (mAccessibilityManager.isTouchExplorationEnabled()) { if (DEBUG) Log.d(TAG, "No peeking: accessible fullscreen: " + sbn.getKey()); Loading
packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarTest.java +24 −0 Original line number Diff line number Diff line Loading @@ -442,6 +442,30 @@ public class StatusBarTest extends SysuiTestCase { assertTrue(mEntryManager.shouldPeek(entry, sbn)); } @Test public void testPeek_disabledStatusBar() { Notification n = new Notification.Builder(getContext(), "a").build(); StatusBarNotification sbn = new StatusBarNotification("a", "a", 0, "a", 0, 0, n, UserHandle.of(0), null, 0); NotificationData.Entry entry = new NotificationData.Entry(sbn); mStatusBar.disable(StatusBarManager.DISABLE_EXPAND, 0, false /* animate */); assertFalse("The panel shouldn't allow peek while disabled", mStatusBar.shouldPeek(entry, sbn)); } @Test public void testPeek_disabledNotificationShade() { Notification n = new Notification.Builder(getContext(), "a").build(); StatusBarNotification sbn = new StatusBarNotification("a", "a", 0, "a", 0, 0, n, UserHandle.of(0), null, 0); NotificationData.Entry entry = new NotificationData.Entry(sbn); mStatusBar.disable(0, StatusBarManager.DISABLE2_NOTIFICATION_SHADE, false /* animate */); assertFalse("The panel shouldn't allow peek while notitifcation shade disabled", mStatusBar.shouldPeek(entry, sbn)); } @Test public void testLogHidden() { try { Loading