Fix issue #27317952: PendingIntent.getIntent() should be protected

Bug: 64752751
Change-Id: Ib05135cd94f5251942a6fc6df542ed39083f7827
(cherry picked from commit e5ad41bc02)
This commit is contained in:
Dianne Hackborn
2016-02-29 18:02:43 -08:00
committed by Chris Tate
parent b514ce9b38
commit ae77fa4725
3 changed files with 8 additions and 0 deletions

View File

@@ -1451,6 +1451,11 @@
<permission android:name="android.permission.GET_PACKAGE_IMPORTANCE"
android:protectionLevel="signature|privileged" />
<!-- Allows use of PendingIntent.getIntent().
@hide -->
<permission android:name="android.permission.GET_INTENT_SENDER_INTENT"
android:protectionLevel="signature" />
<!-- ================================== -->
<!-- Permissions affecting the display of other applications -->
<!-- ================================== -->

View File

@@ -81,6 +81,7 @@
<uses-permission android:name="android.permission.GET_TOP_ACTIVITY_INFO" />
<uses-permission android:name="android.permission.MANAGE_ACTIVITY_STACKS" />
<uses-permission android:name="android.permission.START_TASKS_FROM_RECENTS" />
<uses-permission android:name="android.permission.GET_INTENT_SENDER_INTENT" />
<!-- WindowManager -->
<uses-permission android:name="android.permission.INTERNAL_SYSTEM_WINDOW" />

View File

@@ -6819,6 +6819,8 @@ public final class ActivityManagerService extends ActivityManagerNative
@Override
public Intent getIntentForIntentSender(IIntentSender pendingResult) {
enforceCallingPermission(Manifest.permission.GET_INTENT_SENDER_INTENT,
"getIntentForIntentSender()");
if (!(pendingResult instanceof PendingIntentRecord)) {
return null;
}