diff options
-rw-r--r-- | core/res/AndroidManifest.xml | 12 | ||||
-rwxr-xr-x | core/res/res/values/strings.xml | 7 | ||||
-rw-r--r-- | packages/SystemUI/AndroidManifest.xml | 1 | ||||
-rw-r--r-- | services/java/com/android/server/am/ActivityManagerService.java | 6 |
4 files changed, 24 insertions, 2 deletions
diff --git a/core/res/AndroidManifest.xml b/core/res/AndroidManifest.xml index 4443bc8..25d3762 100644 --- a/core/res/AndroidManifest.xml +++ b/core/res/AndroidManifest.xml @@ -732,14 +732,22 @@ android:description="@string/permdesc_expandStatusBar" /> <!-- Allows an application to get information about the currently - or recently running tasks: a thumbnail representation of the tasks, - what activities are running in it, etc. --> + or recently running tasks. --> <permission android:name="android.permission.GET_TASKS" android:permissionGroup="android.permission-group.SYSTEM_TOOLS" android:protectionLevel="dangerous" android:label="@string/permlab_getTasks" android:description="@string/permdesc_getTasks" /> + <!-- Allows an application to get full detailed information about + recently running tasks, with full fidelity to the real state. + @hide --> + <permission android:name="android.permission.GET_DETAILED_TASKS" + android:permissionGroup="android.permission-group.SYSTEM_TOOLS" + android:protectionLevel="signature" + android:label="@string/permlab_getDetailedTasks" + android:description="@string/permdesc_getDetailedTasks" /> + <!-- Allows an application to change the Z-order of tasks --> <permission android:name="android.permission.REORDER_TASKS" android:permissionGroup="android.permission-group.SYSTEM_TOOLS" diff --git a/core/res/res/values/strings.xml b/core/res/res/values/strings.xml index a589015..213f692 100755 --- a/core/res/res/values/strings.xml +++ b/core/res/res/values/strings.xml @@ -542,6 +542,13 @@ information about currently and recently running tasks. Malicious apps may discover private information about other apps.</string> + <!-- Title of an application permission, listed so the user can choose whether they want to allow the application to do this. [CHAR LIMIT=50] --> + <string name="permlab_getDetailedTasks">retrieve details of running apps</string> + <!-- Description of an application permission, listed so the user can choose whether they want to allow the application to do this. [CHAR LIMIT=NONE] --> + <string name="permdesc_getDetailedTasks">Allows the app to retrieve + detailed information about currently and recently running tasks. Malicious apps may + discover private information about other apps.</string> + <!-- Title of an application permission, listed so the user can choose whether they want to allow the application to do this. --> <string name="permlab_reorderTasks">reorder running apps</string> <!-- Description of an application permission, listed so the user can choose whether they want to allow the application to do this. --> diff --git a/packages/SystemUI/AndroidManifest.xml b/packages/SystemUI/AndroidManifest.xml index f200f43..d35ed57 100644 --- a/packages/SystemUI/AndroidManifest.xml +++ b/packages/SystemUI/AndroidManifest.xml @@ -29,6 +29,7 @@ <!-- ActivityManager --> <uses-permission android:name="android.permission.GET_TASKS" /> + <uses-permission android:name="android.permission.GET_DETAILED_TASKS" /> <uses-permission android:name="android.permission.REORDER_TASKS" /> <uses-permission android:name="android.permission.REMOVE_TASKS" /> <uses-permission android:name="android.permission.STOP_APP_SWITCHES" /> 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 @@ public final class ActivityManagerService extends ActivityManagerNative 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 @@ public final class ActivityManagerService extends ActivityManagerNative 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; |