Loading packages/SystemUI/src/com/android/systemui/ForegroundServiceControllerImpl.java +4 −3 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ import android.service.notification.StatusBarNotification; import android.util.ArrayMap; import android.util.ArraySet; import android.util.Log; import android.util.Slog; import android.util.SparseArray; import com.android.internal.messages.nano.SystemMessageProto; Loading Loading @@ -174,9 +175,9 @@ public class ForegroundServiceControllerImpl @Override public boolean isSystemAlertNotification(StatusBarNotification sbn) { // TODO: tag system alert notifications so they can be suppressed if app's notification // is tagged return false; return sbn.getPackageName().equals("android") && sbn.getTag() != null && sbn.getTag().contains("AlertWindowNotification"); } /** Loading packages/SystemUI/tests/src/com/android/systemui/ForegroundServiceControllerTest.java +12 −1 Original line number Diff line number Diff line Loading @@ -368,6 +368,17 @@ public class ForegroundServiceControllerTest extends SysuiTestCase { assertFalse(fsc.isDungeonNeededForUser(USERID_TWO)); } @Test public void testOverlayPredicate() { StatusBarNotification sbn_user1_app1 = makeMockSBN(USERID_ONE, "com.example.app1", 5000, "monkeys", Notification.FLAG_AUTO_CANCEL); StatusBarNotification sbn_user1_overlay = makeMockSBN(USERID_ONE, "android", 0, "AlertWindowNotification", Notification.FLAG_NO_CLEAR); assertTrue(fsc.isSystemAlertNotification(sbn_user1_overlay)); assertFalse(fsc.isSystemAlertNotification(sbn_user1_app1)); } @Test public void testStdLayoutBasic() { final String PKG1 = "com.example.app0"; Loading Loading @@ -439,7 +450,7 @@ public class ForegroundServiceControllerTest extends SysuiTestCase { when(sbn.getNotification()).thenReturn(n); when(sbn.getId()).thenReturn(id); when(sbn.getPackageName()).thenReturn(pkg); when(sbn.getTag()).thenReturn(null); when(sbn.getTag()).thenReturn(tag); when(sbn.getUserId()).thenReturn(userid); when(sbn.getUser()).thenReturn(new UserHandle(userid)); when(sbn.getKey()).thenReturn("MOCK:"+userid+"|"+pkg+"|"+id+"|"+tag); Loading Loading
packages/SystemUI/src/com/android/systemui/ForegroundServiceControllerImpl.java +4 −3 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ import android.service.notification.StatusBarNotification; import android.util.ArrayMap; import android.util.ArraySet; import android.util.Log; import android.util.Slog; import android.util.SparseArray; import com.android.internal.messages.nano.SystemMessageProto; Loading Loading @@ -174,9 +175,9 @@ public class ForegroundServiceControllerImpl @Override public boolean isSystemAlertNotification(StatusBarNotification sbn) { // TODO: tag system alert notifications so they can be suppressed if app's notification // is tagged return false; return sbn.getPackageName().equals("android") && sbn.getTag() != null && sbn.getTag().contains("AlertWindowNotification"); } /** Loading
packages/SystemUI/tests/src/com/android/systemui/ForegroundServiceControllerTest.java +12 −1 Original line number Diff line number Diff line Loading @@ -368,6 +368,17 @@ public class ForegroundServiceControllerTest extends SysuiTestCase { assertFalse(fsc.isDungeonNeededForUser(USERID_TWO)); } @Test public void testOverlayPredicate() { StatusBarNotification sbn_user1_app1 = makeMockSBN(USERID_ONE, "com.example.app1", 5000, "monkeys", Notification.FLAG_AUTO_CANCEL); StatusBarNotification sbn_user1_overlay = makeMockSBN(USERID_ONE, "android", 0, "AlertWindowNotification", Notification.FLAG_NO_CLEAR); assertTrue(fsc.isSystemAlertNotification(sbn_user1_overlay)); assertFalse(fsc.isSystemAlertNotification(sbn_user1_app1)); } @Test public void testStdLayoutBasic() { final String PKG1 = "com.example.app0"; Loading Loading @@ -439,7 +450,7 @@ public class ForegroundServiceControllerTest extends SysuiTestCase { when(sbn.getNotification()).thenReturn(n); when(sbn.getId()).thenReturn(id); when(sbn.getPackageName()).thenReturn(pkg); when(sbn.getTag()).thenReturn(null); when(sbn.getTag()).thenReturn(tag); when(sbn.getUserId()).thenReturn(userid); when(sbn.getUser()).thenReturn(new UserHandle(userid)); when(sbn.getKey()).thenReturn("MOCK:"+userid+"|"+pkg+"|"+id+"|"+tag); Loading