Merge "Make mutable PendingIntent explicit"
This commit is contained in:
committed by
Android (Google) Code Review
commit
d26f96691a
@@ -1073,7 +1073,9 @@ public class RecoverableKeyStoreManagerTest {
|
||||
int uid = Binder.getCallingUid();
|
||||
PendingIntent intent = PendingIntent.getBroadcast(
|
||||
InstrumentationRegistry.getTargetContext(), /*requestCode=*/1,
|
||||
new Intent(), /*flags=*/ PendingIntent.FLAG_MUTABLE_UNAUDITED);
|
||||
new Intent()
|
||||
.setPackage(InstrumentationRegistry.getTargetContext().getPackageName()),
|
||||
/*flags=*/ PendingIntent.FLAG_MUTABLE);
|
||||
mRecoverableKeyStoreManager.setSnapshotCreatedPendingIntent(intent);
|
||||
verify(mMockListenersStorage).setSnapshotListener(eq(uid), any(PendingIntent.class));
|
||||
}
|
||||
|
||||
@@ -41,7 +41,9 @@ public class RecoverySnapshotListenersStorageTest {
|
||||
int recoveryAgentUid = 1000;
|
||||
PendingIntent intent = PendingIntent.getBroadcast(
|
||||
InstrumentationRegistry.getTargetContext(), /*requestCode=*/ 1,
|
||||
new Intent(), /*flags=*/ PendingIntent.FLAG_MUTABLE_UNAUDITED);
|
||||
new Intent()
|
||||
.setPackage(InstrumentationRegistry.getTargetContext().getPackageName()),
|
||||
/*flags=*/ PendingIntent.FLAG_MUTABLE);
|
||||
mStorage.setSnapshotListener(recoveryAgentUid, intent);
|
||||
|
||||
assertTrue(mStorage.hasListener(recoveryAgentUid));
|
||||
@@ -54,7 +56,9 @@ public class RecoverySnapshotListenersStorageTest {
|
||||
int recoveryAgentUid = 1000;
|
||||
mStorage.recoverySnapshotAvailable(recoveryAgentUid);
|
||||
PendingIntent intent = PendingIntent.getBroadcast(
|
||||
context, /*requestCode=*/ 0, new Intent(TEST_INTENT_ACTION), /*flags=*/PendingIntent.FLAG_MUTABLE_UNAUDITED);
|
||||
context, /*requestCode=*/ 0,
|
||||
new Intent(TEST_INTENT_ACTION).setPackage(context.getPackageName()),
|
||||
/*flags=*/PendingIntent.FLAG_MUTABLE);
|
||||
CountDownLatch latch = new CountDownLatch(1);
|
||||
context.registerReceiver(new BroadcastReceiver() {
|
||||
@Override
|
||||
@@ -75,7 +79,9 @@ public class RecoverySnapshotListenersStorageTest {
|
||||
int recoveryAgentUid = 1000;
|
||||
mStorage.recoverySnapshotAvailable(recoveryAgentUid);
|
||||
PendingIntent intent = PendingIntent.getBroadcast(
|
||||
context, /*requestCode=*/ 0, new Intent(TEST_INTENT_ACTION), /*flags=*/PendingIntent.FLAG_MUTABLE_UNAUDITED);
|
||||
context, /*requestCode=*/ 0,
|
||||
new Intent(TEST_INTENT_ACTION).setPackage(context.getPackageName()),
|
||||
/*flags=*/PendingIntent.FLAG_MUTABLE);
|
||||
CountDownLatch latch = new CountDownLatch(2);
|
||||
BroadcastReceiver broadcastReceiver = new BroadcastReceiver() {
|
||||
@Override
|
||||
|
||||
@@ -327,7 +327,9 @@ public class ShortcutManagerTest8 extends BaseShortcutManagerTest {
|
||||
}
|
||||
|
||||
private IntentSender makeResultIntent() {
|
||||
return PendingIntent.getActivity(getTestContext(), 0, new Intent(), PendingIntent.FLAG_MUTABLE_UNAUDITED).getIntentSender();
|
||||
return PendingIntent.getActivity(getTestContext(), 0,
|
||||
new Intent().setPackage(getTestContext().getPackageName()),
|
||||
PendingIntent.FLAG_MUTABLE).getIntentSender();
|
||||
}
|
||||
|
||||
public void testRequestPinShortcut_withCallback() {
|
||||
|
||||
@@ -150,7 +150,9 @@ public class ShortcutManagerTest9 extends BaseShortcutManagerTest {
|
||||
|
||||
public void testRequestPinAppWidget_withCallback() {
|
||||
final PendingIntent resultIntent =
|
||||
PendingIntent.getActivity(getTestContext(), 0, new Intent(), PendingIntent.FLAG_MUTABLE_UNAUDITED);
|
||||
PendingIntent.getActivity(getTestContext(), 0,
|
||||
new Intent().setPackage(getTestContext().getPackageName()),
|
||||
PendingIntent.FLAG_MUTABLE);
|
||||
|
||||
checkRequestPinAppWidget(resultIntent);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user