Merge "NotificationUiAdjustmentTest: Mark unaudited PendingIntents with FLAG_MUTABLE_UNAUDITED"

This commit is contained in:
Ashwini Oruganti
2020-12-07 19:41:50 +00:00
committed by Android (Google) Code Review

View File

@@ -39,8 +39,11 @@ 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(), 0);
PendingIntent.getActivity(mContext, 0, new Intent(),
PendingIntent.FLAG_MUTABLE_UNAUDITED);
Notification.Action action =
createActionBuilder("first", R.drawable.ic_corp_icon, pendingIntent).build();
assertThat(NotificationUiAdjustment.needReinflate(
@@ -51,8 +54,11 @@ 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(), 0);
PendingIntent.getActivity(mContext, 0, new Intent(),
PendingIntent.FLAG_MUTABLE_UNAUDITED);
Notification.Action firstAction =
createActionBuilder("first", R.drawable.ic_corp_icon, pendingIntent).build();
Notification.Action secondAction =
@@ -66,8 +72,11 @@ 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(), 0);
PendingIntent.getActivity(mContext, 0, new Intent(),
PendingIntent.FLAG_MUTABLE_UNAUDITED);
Notification.Action firstAction =
createActionBuilder("same", R.drawable.ic_corp_icon, pendingIntent).build();
Notification.Action secondAction =
@@ -82,10 +91,14 @@ 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), 0);
PendingIntent.getActivity(mContext, 0, new Intent(Intent.ACTION_VIEW),
PendingIntent.FLAG_MUTABLE_UNAUDITED);
PendingIntent secondPendingIntent =
PendingIntent.getActivity(mContext, 0, new Intent(Intent.ACTION_PROCESS_TEXT), 0);
PendingIntent.getActivity(mContext, 0, new Intent(Intent.ACTION_PROCESS_TEXT),
PendingIntent.FLAG_MUTABLE_UNAUDITED);
Notification.Action firstAction =
createActionBuilder("same", R.drawable.ic_corp_icon, firstPendingIntent)
.build();
@@ -101,8 +114,11 @@ 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(), 0);
PendingIntent.getActivity(mContext, 0, new Intent(),
PendingIntent.FLAG_MUTABLE_UNAUDITED);
RemoteInput firstRemoteInput =
createRemoteInput("same", "same", new CharSequence[] {"first"});
@@ -126,8 +142,11 @@ 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(), 0);
PendingIntent.getActivity(mContext, 0, new Intent(),
PendingIntent.FLAG_MUTABLE_UNAUDITED);
RemoteInput firstRemoteInput =
createRemoteInput("same", "first", new CharSequence[] {"same"});
@@ -151,8 +170,11 @@ 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(), 0);
PendingIntent.getActivity(mContext, 0, new Intent(),
PendingIntent.FLAG_MUTABLE_UNAUDITED);
RemoteInput firstRemoteInput =
createRemoteInput("same", "same", new CharSequence[] {"same"});
RemoteInput secondRemoteInput =