NotificationListenerServiceTest: Mark unaudited PendingIntents with FLAG_MUTABLE_UNAUDITED

These PIs need an explicit mutability flag. This temporay flag is being
used to mark these points in code and should be replaced ASAP.
See go/immutable-pendingintents for more context.

Bug: 160794467
Test: TH
Exempt-From-Owner-Approval: noop change
Change-Id: I69f27c2daf8ece7331c47ce255368e6222143bf1
This commit is contained in:
Ashwini Oruganti
2020-12-06 00:15:57 -08:00
parent 24e5b93cc2
commit 9bd59dc8e6

View File

@@ -357,11 +357,13 @@ public class NotificationListenerServiceTest extends UiServiceTestCase {
private ArrayList<Notification.Action> getSmartActions(String key, int index) {
ArrayList<Notification.Action> actions = new ArrayList<>();
for (int i = 0; i < index; i++) {
// TODO(b/174935955) Please replace FLAG_MUTABLE_UNAUDITED below
// with either FLAG_IMMUTABLE (recommended) or FLAG_MUTABLE.
PendingIntent intent = PendingIntent.getBroadcast(
getContext(),
index /*requestCode*/,
new Intent("ACTION_" + key),
0 /*flags*/);
PendingIntent.FLAG_MUTABLE_UNAUDITED /*flags*/);
actions.add(new Notification.Action.Builder(null /*icon*/, key, intent).build());
}
return actions;