Specify the component for the ACTION_SHOW_ECM_EXIT_DIALOG Intent
Specify the component for the ACTION_SHOW_ECM_EXIT_DIALOG intent
so it can not be intercepted by a malicious application and modified.
Bug: 155094269
Test: atest FrameworksTelephonyTests
Change-Id: Id5df0b428bd7e24aa11fb9dd4c920d1019f1b389
diff --git a/src/com/android/phone/EmergencyCallbackModeService.java b/src/com/android/phone/EmergencyCallbackModeService.java
index 6b247bd..464db6f 100644
--- a/src/com/android/phone/EmergencyCallbackModeService.java
+++ b/src/com/android/phone/EmergencyCallbackModeService.java
@@ -190,8 +190,10 @@
// PendingIntent to launch Emergency Callback Mode Exit activity if the user selects
// this notification
- PendingIntent contentIntent = PendingIntent.getActivity(this, 0,
- new Intent(EmergencyCallbackModeExitDialog.ACTION_SHOW_ECM_EXIT_DIALOG), 0);
+ Intent intent = new Intent(this, EmergencyCallbackModeExitDialog.class);
+ intent.setAction(EmergencyCallbackModeExitDialog.ACTION_SHOW_ECM_EXIT_DIALOG);
+ PendingIntent contentIntent = PendingIntent.getActivity(this, 0, intent,
+ PendingIntent.FLAG_IMMUTABLE);
builder.setContentIntent(contentIntent);
// Format notification string