diff options
| author | 2012-04-06 13:39:09 -0700 | |
|---|---|---|
| committer | 2012-04-06 13:39:09 -0700 | |
| commit | e824120016248bcfe3962883fe9f3b0481dd1c3d (patch) | |
| tree | 463c783909b57b829e22385c954b08a9c2b8e08b | |
| parent | 29d6fa9d8b651b6940e6f3f9182f5b72c404c739 (diff) | |
Hide the optional permission stuff, not making it in to JB.
Also lock down the rest of the development tools permissions to
be development permissions that must be granted through an
explicit shell command.
Change-Id: I1ba216fffe1aab4bb9f83fcef108efc504f892f4
| -rw-r--r-- | core/java/android/content/pm/PackageInfo.java | 2 | ||||
| -rw-r--r-- | core/java/android/content/pm/PackageParser.java | 4 | ||||
| -rwxr-xr-x | core/java/android/widget/AppSecurityPermissions.java | 6 | ||||
| -rw-r--r-- | core/res/AndroidManifest.xml | 8 | ||||
| -rw-r--r-- | core/res/res/values/attrs_manifest.xml | 5 |
5 files changed, 11 insertions, 14 deletions
diff --git a/core/java/android/content/pm/PackageInfo.java b/core/java/android/content/pm/PackageInfo.java index 415d58aa7fba..85f7aa5113a2 100644 --- a/core/java/android/content/pm/PackageInfo.java +++ b/core/java/android/content/pm/PackageInfo.java @@ -154,7 +154,7 @@ public class PackageInfo implements Parcelable { /** * Flag for {@link #requestedPermissionsFlags}: the requested permission * is required for the application to run; the user can not optionally - * disable it. + * disable it. Currently all permissions are required. */ public static final int REQUESTED_PERMISSION_REQUIRED = 1<<0; diff --git a/core/java/android/content/pm/PackageParser.java b/core/java/android/content/pm/PackageParser.java index 7ff9bfa18d53..9bed8f0d7ef8 100644 --- a/core/java/android/content/pm/PackageParser.java +++ b/core/java/android/content/pm/PackageParser.java @@ -989,14 +989,16 @@ public class PackageParser { // that may change. String name = sa.getNonResourceString( com.android.internal.R.styleable.AndroidManifestUsesPermission_name); + /* Not supporting optional permissions yet. boolean required = sa.getBoolean( com.android.internal.R.styleable.AndroidManifestUsesPermission_required, true); + */ sa.recycle(); if (name != null && !pkg.requestedPermissions.contains(name)) { pkg.requestedPermissions.add(name.intern()); - pkg.requestedPermissionsRequired.add(required ? Boolean.TRUE : Boolean.FALSE); + pkg.requestedPermissionsRequired.add(Boolean.TRUE); } XmlUtils.skipCurrentTag(parser); diff --git a/core/java/android/widget/AppSecurityPermissions.java b/core/java/android/widget/AppSecurityPermissions.java index e6184d5e605c..b409e26bddd5 100755 --- a/core/java/android/widget/AppSecurityPermissions.java +++ b/core/java/android/widget/AppSecurityPermissions.java @@ -490,13 +490,7 @@ public class AppSecurityPermissions implements View.OnClickListener { // Development permissions are only shown to the user if they are already // granted to the app -- if we are installing an app and they are not // already granted, they will not be granted as part of the install. - // Note we also need the app to have specified this permission is not - // required -- this is not technically needed, but it helps various things - // if we ensure apps always mark development permissions as option, so that - // even not knowing what a permission is we can still know whether it will - // be granted to the app when it is installed. if ((existingReqFlags&PackageInfo.REQUESTED_PERMISSION_GRANTED) != 0 - && (newReqFlags&PackageInfo.REQUESTED_PERMISSION_REQUIRED) == 0 && (pInfo.protectionLevel & PermissionInfo.PROTECTION_FLAG_DEVELOPMENT) != 0) { return true; } diff --git a/core/res/AndroidManifest.xml b/core/res/AndroidManifest.xml index 00faa416eaca..3ee237709b0b 100644 --- a/core/res/AndroidManifest.xml +++ b/core/res/AndroidManifest.xml @@ -1082,7 +1082,7 @@ <!-- Configure an application for debugging. --> <permission android:name="android.permission.SET_DEBUG_APP" android:permissionGroup="android.permission-group.DEVELOPMENT_TOOLS" - android:protectionLevel="dangerous" + android:protectionLevel="signature|system|development" android:label="@string/permlab_setDebugApp" android:description="@string/permdesc_setDebugApp" /> @@ -1090,7 +1090,7 @@ application processes that can be running. --> <permission android:name="android.permission.SET_PROCESS_LIMIT" android:permissionGroup="android.permission-group.DEVELOPMENT_TOOLS" - android:protectionLevel="dangerous" + android:protectionLevel="signature|system|development" android:label="@string/permlab_setProcessLimit" android:description="@string/permdesc_setProcessLimit" /> @@ -1098,14 +1098,14 @@ finished when put in the background. --> <permission android:name="android.permission.SET_ALWAYS_FINISH" android:permissionGroup="android.permission-group.DEVELOPMENT_TOOLS" - android:protectionLevel="dangerous" + android:protectionLevel="signature|system|development" android:label="@string/permlab_setAlwaysFinish" android:description="@string/permdesc_setAlwaysFinish" /> <!-- Allow an application to request that a signal be sent to all persistent processes --> <permission android:name="android.permission.SIGNAL_PERSISTENT_PROCESSES" android:permissionGroup="android.permission-group.DEVELOPMENT_TOOLS" - android:protectionLevel="dangerous" + android:protectionLevel="signature|system|development" android:label="@string/permlab_signalPersistentProcesses" android:description="@string/permdesc_signalPersistentProcesses" /> diff --git a/core/res/res/values/attrs_manifest.xml b/core/res/res/values/attrs_manifest.xml index d414c7f18497..0ac2ad747c02 100644 --- a/core/res/res/values/attrs_manifest.xml +++ b/core/res/res/values/attrs_manifest.xml @@ -948,8 +948,9 @@ permission, and it must always be granted when it is installed. If you set this to false, then in some cases the application may be installed with it being granted the permission, and it will - need to request the permission later if it needs it. --> + need to request the permission later if it needs it. <attr name="required" format="boolean" /> + --> </declare-styleable> <!-- The <code>uses-configuration</code> tag specifies @@ -992,7 +993,7 @@ don't support it. If you set this to false, then this will not impose a restriction on where the application can be installed. --> - <attr name="required" /> + <attr name="required" format="boolean" /> </declare-styleable> <!-- The <code>uses-sdk</code> tag describes the SDK features that the |