Skip to content

Commit 79af606

Browse files
Dianne HackbornAndroid (Google) Code Review
authored andcommitted
Merge "Hide the optional permission stuff, not making it in to JB."
2 parents 450c75a + e824120 commit 79af606

File tree

5 files changed

+11
-14
lines changed

5 files changed

+11
-14
lines changed

core/java/android/content/pm/PackageInfo.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ public class PackageInfo implements Parcelable {
154154
/**
155155
* Flag for {@link #requestedPermissionsFlags}: the requested permission
156156
* is required for the application to run; the user can not optionally
157-
* disable it.
157+
* disable it. Currently all permissions are required.
158158
*/
159159
public static final int REQUESTED_PERMISSION_REQUIRED = 1<<0;
160160

core/java/android/content/pm/PackageParser.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -989,14 +989,16 @@ private Package parsePackage(
989989
// that may change.
990990
String name = sa.getNonResourceString(
991991
com.android.internal.R.styleable.AndroidManifestUsesPermission_name);
992+
/* Not supporting optional permissions yet.
992993
boolean required = sa.getBoolean(
993994
com.android.internal.R.styleable.AndroidManifestUsesPermission_required, true);
995+
*/
994996

995997
sa.recycle();
996998

997999
if (name != null && !pkg.requestedPermissions.contains(name)) {
9981000
pkg.requestedPermissions.add(name.intern());
999-
pkg.requestedPermissionsRequired.add(required ? Boolean.TRUE : Boolean.FALSE);
1001+
pkg.requestedPermissionsRequired.add(Boolean.TRUE);
10001002
}
10011003

10021004
XmlUtils.skipCurrentTag(parser);

core/java/android/widget/AppSecurityPermissions.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -490,13 +490,7 @@ private boolean isDisplayablePermission(PermissionInfo pInfo, int newReqFlags,
490490
// Development permissions are only shown to the user if they are already
491491
// granted to the app -- if we are installing an app and they are not
492492
// already granted, they will not be granted as part of the install.
493-
// Note we also need the app to have specified this permission is not
494-
// required -- this is not technically needed, but it helps various things
495-
// if we ensure apps always mark development permissions as option, so that
496-
// even not knowing what a permission is we can still know whether it will
497-
// be granted to the app when it is installed.
498493
if ((existingReqFlags&PackageInfo.REQUESTED_PERMISSION_GRANTED) != 0
499-
&& (newReqFlags&PackageInfo.REQUESTED_PERMISSION_REQUIRED) == 0
500494
&& (pInfo.protectionLevel & PermissionInfo.PROTECTION_FLAG_DEVELOPMENT) != 0) {
501495
return true;
502496
}

core/res/AndroidManifest.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1082,30 +1082,30 @@
10821082
<!-- Configure an application for debugging. -->
10831083
<permission android:name="android.permission.SET_DEBUG_APP"
10841084
android:permissionGroup="android.permission-group.DEVELOPMENT_TOOLS"
1085-
android:protectionLevel="dangerous"
1085+
android:protectionLevel="signature|system|development"
10861086
android:label="@string/permlab_setDebugApp"
10871087
android:description="@string/permdesc_setDebugApp" />
10881088

10891089
<!-- Allows an application to set the maximum number of (not needed)
10901090
application processes that can be running. -->
10911091
<permission android:name="android.permission.SET_PROCESS_LIMIT"
10921092
android:permissionGroup="android.permission-group.DEVELOPMENT_TOOLS"
1093-
android:protectionLevel="dangerous"
1093+
android:protectionLevel="signature|system|development"
10941094
android:label="@string/permlab_setProcessLimit"
10951095
android:description="@string/permdesc_setProcessLimit" />
10961096

10971097
<!-- Allows an application to control whether activities are immediately
10981098
finished when put in the background. -->
10991099
<permission android:name="android.permission.SET_ALWAYS_FINISH"
11001100
android:permissionGroup="android.permission-group.DEVELOPMENT_TOOLS"
1101-
android:protectionLevel="dangerous"
1101+
android:protectionLevel="signature|system|development"
11021102
android:label="@string/permlab_setAlwaysFinish"
11031103
android:description="@string/permdesc_setAlwaysFinish" />
11041104

11051105
<!-- Allow an application to request that a signal be sent to all persistent processes -->
11061106
<permission android:name="android.permission.SIGNAL_PERSISTENT_PROCESSES"
11071107
android:permissionGroup="android.permission-group.DEVELOPMENT_TOOLS"
1108-
android:protectionLevel="dangerous"
1108+
android:protectionLevel="signature|system|development"
11091109
android:label="@string/permlab_signalPersistentProcesses"
11101110
android:description="@string/permdesc_signalPersistentProcesses" />
11111111

core/res/res/values/attrs_manifest.xml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -948,8 +948,9 @@
948948
permission, and it must always be granted when it is installed.
949949
If you set this to false, then in some cases the application may
950950
be installed with it being granted the permission, and it will
951-
need to request the permission later if it needs it. -->
951+
need to request the permission later if it needs it.
952952
<attr name="required" format="boolean" />
953+
-->
953954
</declare-styleable>
954955

955956
<!-- The <code>uses-configuration</code> tag specifies
@@ -992,7 +993,7 @@
992993
don't support it. If you set this to false, then this will
993994
not impose a restriction on where the application can be
994995
installed. -->
995-
<attr name="required" />
996+
<attr name="required" format="boolean" />
996997
</declare-styleable>
997998

998999
<!-- The <code>uses-sdk</code> tag describes the SDK features that the

0 commit comments

Comments
 (0)