Add new signature-level permission to get details of tasks.
Third party apps now can't get access to the extras of the
intents associated with tasks, to keep private data in them
from leaking out.
Change-Id: I95af9e181ac42557bc8b981807e7ddd266a88d0e
diff --git a/services/java/com/android/server/am/ActivityManagerService.java b/services/java/com/android/server/am/ActivityManagerService.java
index 77bec41..8f69d2f 100644
--- a/services/java/com/android/server/am/ActivityManagerService.java
+++ b/services/java/com/android/server/am/ActivityManagerService.java
@@ -5489,6 +5489,9 @@
synchronized (this) {
enforceCallingPermission(android.Manifest.permission.GET_TASKS,
"getRecentTasks()");
+ final boolean detailed = checkCallingPermission(
+ android.Manifest.permission.GET_DETAILED_TASKS)
+ == PackageManager.PERMISSION_GRANTED;
IPackageManager pm = AppGlobals.getPackageManager();
@@ -5517,6 +5520,9 @@
rti.persistentId = tr.taskId;
rti.baseIntent = new Intent(
tr.intent != null ? tr.intent : tr.affinityIntent);
+ if (!detailed) {
+ rti.baseIntent.replaceExtras((Bundle)null);
+ }
rti.origActivity = tr.origActivity;
rti.description = tr.lastDescription;