Loading packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationUiAdjustmentTest.java +25 −30 Original line number Diff line number Diff line Loading @@ -39,11 +39,10 @@ public class NotificationUiAdjustmentTest extends SysuiTestCase { @Test public void needReinflate_differentLength() { // TODO(b/174258598) Please replace FLAG_MUTABLE_UNAUDITED below // with either FLAG_IMMUTABLE (recommended) or FLAG_MUTABLE. PendingIntent pendingIntent = PendingIntent.getActivity(mContext, 0, new Intent(), PendingIntent.FLAG_MUTABLE_UNAUDITED); PendingIntent.getActivity(mContext, 0, new Intent().setPackage(mContext.getPackageName()), PendingIntent.FLAG_MUTABLE); Notification.Action action = createActionBuilder("first", R.drawable.ic_corp_icon, pendingIntent).build(); assertThat(NotificationUiAdjustment.needReinflate( Loading @@ -54,11 +53,10 @@ public class NotificationUiAdjustmentTest extends SysuiTestCase { @Test public void needReinflate_differentLabels() { // TODO(b/174258598) Please replace FLAG_MUTABLE_UNAUDITED below // with either FLAG_IMMUTABLE (recommended) or FLAG_MUTABLE. PendingIntent pendingIntent = PendingIntent.getActivity(mContext, 0, new Intent(), PendingIntent.FLAG_MUTABLE_UNAUDITED); PendingIntent.getActivity(mContext, 0, new Intent().setPackage(mContext.getPackageName()), PendingIntent.FLAG_MUTABLE); Notification.Action firstAction = createActionBuilder("first", R.drawable.ic_corp_icon, pendingIntent).build(); Notification.Action secondAction = Loading @@ -72,11 +70,10 @@ public class NotificationUiAdjustmentTest extends SysuiTestCase { @Test public void needReinflate_differentIcons() { // TODO(b/174258598) Please replace FLAG_MUTABLE_UNAUDITED below // with either FLAG_IMMUTABLE (recommended) or FLAG_MUTABLE. PendingIntent pendingIntent = PendingIntent.getActivity(mContext, 0, new Intent(), PendingIntent.FLAG_MUTABLE_UNAUDITED); PendingIntent.getActivity(mContext, 0, new Intent().setPackage(mContext.getPackageName()), PendingIntent.FLAG_MUTABLE); Notification.Action firstAction = createActionBuilder("same", R.drawable.ic_corp_icon, pendingIntent).build(); Notification.Action secondAction = Loading @@ -91,14 +88,15 @@ public class NotificationUiAdjustmentTest extends SysuiTestCase { @Test public void needReinflate_differentPendingIntent() { // TODO(b/174258598) Please replace FLAG_MUTABLE_UNAUDITED below // with either FLAG_IMMUTABLE (recommended) or FLAG_MUTABLE. PendingIntent firstPendingIntent = PendingIntent.getActivity(mContext, 0, new Intent(Intent.ACTION_VIEW), PendingIntent.FLAG_MUTABLE_UNAUDITED); PendingIntent.getActivity(mContext, 0, new Intent(Intent.ACTION_VIEW).setPackage(mContext.getPackageName()), PendingIntent.FLAG_MUTABLE); PendingIntent secondPendingIntent = PendingIntent.getActivity(mContext, 0, new Intent(Intent.ACTION_PROCESS_TEXT), PendingIntent.FLAG_MUTABLE_UNAUDITED); PendingIntent.getActivity(mContext, 0, new Intent(Intent.ACTION_PROCESS_TEXT) .setPackage(mContext.getPackageName()), PendingIntent.FLAG_MUTABLE); Notification.Action firstAction = createActionBuilder("same", R.drawable.ic_corp_icon, firstPendingIntent) .build(); Loading @@ -114,11 +112,10 @@ public class NotificationUiAdjustmentTest extends SysuiTestCase { @Test public void needReinflate_differentChoices() { // TODO(b/174258598) Please replace FLAG_MUTABLE_UNAUDITED below // with either FLAG_IMMUTABLE (recommended) or FLAG_MUTABLE. PendingIntent pendingIntent = PendingIntent.getActivity(mContext, 0, new Intent(), PendingIntent.FLAG_MUTABLE_UNAUDITED); PendingIntent.getActivity(mContext, 0, new Intent().setPackage(mContext.getPackageName()), PendingIntent.FLAG_MUTABLE); RemoteInput firstRemoteInput = createRemoteInput("same", "same", new CharSequence[] {"first"}); Loading @@ -142,11 +139,10 @@ public class NotificationUiAdjustmentTest extends SysuiTestCase { @Test public void needReinflate_differentRemoteInputLabel() { // TODO(b/174258598) Please replace FLAG_MUTABLE_UNAUDITED below // with either FLAG_IMMUTABLE (recommended) or FLAG_MUTABLE. PendingIntent pendingIntent = PendingIntent.getActivity(mContext, 0, new Intent(), PendingIntent.FLAG_MUTABLE_UNAUDITED); PendingIntent.getActivity(mContext, 0, new Intent().setPackage(mContext.getPackageName()), PendingIntent.FLAG_MUTABLE); RemoteInput firstRemoteInput = createRemoteInput("same", "first", new CharSequence[] {"same"}); Loading @@ -170,11 +166,10 @@ public class NotificationUiAdjustmentTest extends SysuiTestCase { @Test public void needReinflate_negative() { // TODO(b/174258598) Please replace FLAG_MUTABLE_UNAUDITED below // with either FLAG_IMMUTABLE (recommended) or FLAG_MUTABLE. PendingIntent pendingIntent = PendingIntent.getActivity(mContext, 0, new Intent(), PendingIntent.FLAG_MUTABLE_UNAUDITED); PendingIntent.getActivity(mContext, 0, new Intent().setPackage(mContext.getPackageName()), PendingIntent.FLAG_MUTABLE); RemoteInput firstRemoteInput = createRemoteInput("same", "same", new CharSequence[] {"same"}); RemoteInput secondRemoteInput = Loading packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/interruption/NotificationInterruptStateProviderImplTest.java +2 −1 Original line number Diff line number Diff line Loading @@ -885,7 +885,8 @@ public class NotificationInterruptStateProviderImplTest extends SysuiTestCase { private NotificationEntry createBubble(String groupKey, Integer groupAlert) { Notification.BubbleMetadata data = new Notification.BubbleMetadata.Builder( PendingIntent.getActivity(mContext, 0, new Intent(), PendingIntent.getActivity(mContext, 0, new Intent().setPackage(mContext.getPackageName()), PendingIntent.FLAG_MUTABLE), Icon.createWithResource(mContext.getResources(), R.drawable.android)) .build(); Loading packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/HeadsUpManagerTest.java +1 −1 Original line number Diff line number Diff line Loading @@ -197,7 +197,7 @@ public class HeadsUpManagerTest extends AlertingNotificationManagerTest { public void testPinEntry_logsPeek() { // Needs full screen intent in order to be pinned final PendingIntent fullScreenIntent = PendingIntent.getActivity(mContext, 0, new Intent(), PendingIntent.FLAG_MUTABLE); new Intent().setPackage(mContext.getPackageName()), PendingIntent.FLAG_MUTABLE); HeadsUpManager.HeadsUpEntry entryToPin = mHeadsUpManager.new HeadsUpEntry(); entryToPin.setEntry(new NotificationEntryBuilder() Loading packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/InflatedSmartRepliesTest.java +4 −2 Original line number Diff line number Diff line Loading @@ -574,7 +574,8 @@ public class InflatedSmartRepliesTest extends SysuiTestCase { private void setupAppGeneratedReplies( CharSequence[] smartReplies, boolean allowSystemGeneratedReplies) { PendingIntent pendingIntent = PendingIntent.getBroadcast(mContext, 0, TEST_INTENT, PendingIntent.getBroadcast(mContext, 0, TEST_INTENT.setPackage(mContext.getPackageName()), PendingIntent.FLAG_MUTABLE); Notification.Action action = new Notification.Action.Builder(null, "Test Action", pendingIntent).build(); Loading Loading @@ -606,7 +607,8 @@ public class InflatedSmartRepliesTest extends SysuiTestCase { } private Notification.Action.Builder createActionBuilder(String actionTitle, Intent intent) { PendingIntent pendingIntent = PendingIntent.getBroadcast(mContext, 0, intent, PendingIntent pendingIntent = PendingIntent.getBroadcast(mContext, 0, intent.setPackage(mContext.getPackageName()), PendingIntent.FLAG_MUTABLE); return new Notification.Action.Builder(mActionIcon, actionTitle, pendingIntent); } Loading packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/RemoteInputViewTest.java +2 −1 Original line number Diff line number Diff line Loading @@ -140,7 +140,8 @@ public class RemoteInputViewTest extends SysuiTestCase { private void setTestPendingIntent(RemoteInputViewController controller) { PendingIntent pendingIntent = PendingIntent.getBroadcast(mContext, 0, new Intent(TEST_ACTION), PendingIntent.FLAG_MUTABLE); new Intent(TEST_ACTION).setPackage(mContext.getPackageName()), PendingIntent.FLAG_MUTABLE); RemoteInput input = new RemoteInput.Builder(TEST_RESULT_KEY).build(); RemoteInput[] inputs = {input}; Loading Loading
packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationUiAdjustmentTest.java +25 −30 Original line number Diff line number Diff line Loading @@ -39,11 +39,10 @@ public class NotificationUiAdjustmentTest extends SysuiTestCase { @Test public void needReinflate_differentLength() { // TODO(b/174258598) Please replace FLAG_MUTABLE_UNAUDITED below // with either FLAG_IMMUTABLE (recommended) or FLAG_MUTABLE. PendingIntent pendingIntent = PendingIntent.getActivity(mContext, 0, new Intent(), PendingIntent.FLAG_MUTABLE_UNAUDITED); PendingIntent.getActivity(mContext, 0, new Intent().setPackage(mContext.getPackageName()), PendingIntent.FLAG_MUTABLE); Notification.Action action = createActionBuilder("first", R.drawable.ic_corp_icon, pendingIntent).build(); assertThat(NotificationUiAdjustment.needReinflate( Loading @@ -54,11 +53,10 @@ public class NotificationUiAdjustmentTest extends SysuiTestCase { @Test public void needReinflate_differentLabels() { // TODO(b/174258598) Please replace FLAG_MUTABLE_UNAUDITED below // with either FLAG_IMMUTABLE (recommended) or FLAG_MUTABLE. PendingIntent pendingIntent = PendingIntent.getActivity(mContext, 0, new Intent(), PendingIntent.FLAG_MUTABLE_UNAUDITED); PendingIntent.getActivity(mContext, 0, new Intent().setPackage(mContext.getPackageName()), PendingIntent.FLAG_MUTABLE); Notification.Action firstAction = createActionBuilder("first", R.drawable.ic_corp_icon, pendingIntent).build(); Notification.Action secondAction = Loading @@ -72,11 +70,10 @@ public class NotificationUiAdjustmentTest extends SysuiTestCase { @Test public void needReinflate_differentIcons() { // TODO(b/174258598) Please replace FLAG_MUTABLE_UNAUDITED below // with either FLAG_IMMUTABLE (recommended) or FLAG_MUTABLE. PendingIntent pendingIntent = PendingIntent.getActivity(mContext, 0, new Intent(), PendingIntent.FLAG_MUTABLE_UNAUDITED); PendingIntent.getActivity(mContext, 0, new Intent().setPackage(mContext.getPackageName()), PendingIntent.FLAG_MUTABLE); Notification.Action firstAction = createActionBuilder("same", R.drawable.ic_corp_icon, pendingIntent).build(); Notification.Action secondAction = Loading @@ -91,14 +88,15 @@ public class NotificationUiAdjustmentTest extends SysuiTestCase { @Test public void needReinflate_differentPendingIntent() { // TODO(b/174258598) Please replace FLAG_MUTABLE_UNAUDITED below // with either FLAG_IMMUTABLE (recommended) or FLAG_MUTABLE. PendingIntent firstPendingIntent = PendingIntent.getActivity(mContext, 0, new Intent(Intent.ACTION_VIEW), PendingIntent.FLAG_MUTABLE_UNAUDITED); PendingIntent.getActivity(mContext, 0, new Intent(Intent.ACTION_VIEW).setPackage(mContext.getPackageName()), PendingIntent.FLAG_MUTABLE); PendingIntent secondPendingIntent = PendingIntent.getActivity(mContext, 0, new Intent(Intent.ACTION_PROCESS_TEXT), PendingIntent.FLAG_MUTABLE_UNAUDITED); PendingIntent.getActivity(mContext, 0, new Intent(Intent.ACTION_PROCESS_TEXT) .setPackage(mContext.getPackageName()), PendingIntent.FLAG_MUTABLE); Notification.Action firstAction = createActionBuilder("same", R.drawable.ic_corp_icon, firstPendingIntent) .build(); Loading @@ -114,11 +112,10 @@ public class NotificationUiAdjustmentTest extends SysuiTestCase { @Test public void needReinflate_differentChoices() { // TODO(b/174258598) Please replace FLAG_MUTABLE_UNAUDITED below // with either FLAG_IMMUTABLE (recommended) or FLAG_MUTABLE. PendingIntent pendingIntent = PendingIntent.getActivity(mContext, 0, new Intent(), PendingIntent.FLAG_MUTABLE_UNAUDITED); PendingIntent.getActivity(mContext, 0, new Intent().setPackage(mContext.getPackageName()), PendingIntent.FLAG_MUTABLE); RemoteInput firstRemoteInput = createRemoteInput("same", "same", new CharSequence[] {"first"}); Loading @@ -142,11 +139,10 @@ public class NotificationUiAdjustmentTest extends SysuiTestCase { @Test public void needReinflate_differentRemoteInputLabel() { // TODO(b/174258598) Please replace FLAG_MUTABLE_UNAUDITED below // with either FLAG_IMMUTABLE (recommended) or FLAG_MUTABLE. PendingIntent pendingIntent = PendingIntent.getActivity(mContext, 0, new Intent(), PendingIntent.FLAG_MUTABLE_UNAUDITED); PendingIntent.getActivity(mContext, 0, new Intent().setPackage(mContext.getPackageName()), PendingIntent.FLAG_MUTABLE); RemoteInput firstRemoteInput = createRemoteInput("same", "first", new CharSequence[] {"same"}); Loading @@ -170,11 +166,10 @@ public class NotificationUiAdjustmentTest extends SysuiTestCase { @Test public void needReinflate_negative() { // TODO(b/174258598) Please replace FLAG_MUTABLE_UNAUDITED below // with either FLAG_IMMUTABLE (recommended) or FLAG_MUTABLE. PendingIntent pendingIntent = PendingIntent.getActivity(mContext, 0, new Intent(), PendingIntent.FLAG_MUTABLE_UNAUDITED); PendingIntent.getActivity(mContext, 0, new Intent().setPackage(mContext.getPackageName()), PendingIntent.FLAG_MUTABLE); RemoteInput firstRemoteInput = createRemoteInput("same", "same", new CharSequence[] {"same"}); RemoteInput secondRemoteInput = Loading
packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/interruption/NotificationInterruptStateProviderImplTest.java +2 −1 Original line number Diff line number Diff line Loading @@ -885,7 +885,8 @@ public class NotificationInterruptStateProviderImplTest extends SysuiTestCase { private NotificationEntry createBubble(String groupKey, Integer groupAlert) { Notification.BubbleMetadata data = new Notification.BubbleMetadata.Builder( PendingIntent.getActivity(mContext, 0, new Intent(), PendingIntent.getActivity(mContext, 0, new Intent().setPackage(mContext.getPackageName()), PendingIntent.FLAG_MUTABLE), Icon.createWithResource(mContext.getResources(), R.drawable.android)) .build(); Loading
packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/HeadsUpManagerTest.java +1 −1 Original line number Diff line number Diff line Loading @@ -197,7 +197,7 @@ public class HeadsUpManagerTest extends AlertingNotificationManagerTest { public void testPinEntry_logsPeek() { // Needs full screen intent in order to be pinned final PendingIntent fullScreenIntent = PendingIntent.getActivity(mContext, 0, new Intent(), PendingIntent.FLAG_MUTABLE); new Intent().setPackage(mContext.getPackageName()), PendingIntent.FLAG_MUTABLE); HeadsUpManager.HeadsUpEntry entryToPin = mHeadsUpManager.new HeadsUpEntry(); entryToPin.setEntry(new NotificationEntryBuilder() Loading
packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/InflatedSmartRepliesTest.java +4 −2 Original line number Diff line number Diff line Loading @@ -574,7 +574,8 @@ public class InflatedSmartRepliesTest extends SysuiTestCase { private void setupAppGeneratedReplies( CharSequence[] smartReplies, boolean allowSystemGeneratedReplies) { PendingIntent pendingIntent = PendingIntent.getBroadcast(mContext, 0, TEST_INTENT, PendingIntent.getBroadcast(mContext, 0, TEST_INTENT.setPackage(mContext.getPackageName()), PendingIntent.FLAG_MUTABLE); Notification.Action action = new Notification.Action.Builder(null, "Test Action", pendingIntent).build(); Loading Loading @@ -606,7 +607,8 @@ public class InflatedSmartRepliesTest extends SysuiTestCase { } private Notification.Action.Builder createActionBuilder(String actionTitle, Intent intent) { PendingIntent pendingIntent = PendingIntent.getBroadcast(mContext, 0, intent, PendingIntent pendingIntent = PendingIntent.getBroadcast(mContext, 0, intent.setPackage(mContext.getPackageName()), PendingIntent.FLAG_MUTABLE); return new Notification.Action.Builder(mActionIcon, actionTitle, pendingIntent); } Loading
packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/RemoteInputViewTest.java +2 −1 Original line number Diff line number Diff line Loading @@ -140,7 +140,8 @@ public class RemoteInputViewTest extends SysuiTestCase { private void setTestPendingIntent(RemoteInputViewController controller) { PendingIntent pendingIntent = PendingIntent.getBroadcast(mContext, 0, new Intent(TEST_ACTION), PendingIntent.FLAG_MUTABLE); new Intent(TEST_ACTION).setPackage(mContext.getPackageName()), PendingIntent.FLAG_MUTABLE); RemoteInput input = new RemoteInput.Builder(TEST_RESULT_KEY).build(); RemoteInput[] inputs = {input}; Loading