Merge "Reenable optional permissions parsing and expose APIs" into jb-mr2-dev

This commit is contained in:
Nick Kralevich
2013-03-28 00:13:45 +00:00
committed by Android (Google) Code Review
5 changed files with 5 additions and 8 deletions

View File

@@ -6716,6 +6716,7 @@ package android.content.pm {
method public abstract java.util.List<android.content.pm.PermissionInfo> queryPermissionsByGroup(java.lang.String, int) throws android.content.pm.PackageManager.NameNotFoundException;
method public abstract deprecated void removePackageFromPreferred(java.lang.String);
method public abstract void removePermission(java.lang.String);
method public android.content.Intent buildPermissionRequestIntent(java.lang.String...);
method public abstract android.content.pm.ResolveInfo resolveActivity(android.content.Intent, int);
method public abstract android.content.pm.ProviderInfo resolveContentProvider(java.lang.String, int);
method public abstract android.content.pm.ResolveInfo resolveService(android.content.Intent, int);

View File

@@ -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. Currently all permissions are required.
* disable it.
*/
public static final int REQUESTED_PERMISSION_REQUIRED = 1<<0;

View File

@@ -1754,7 +1754,6 @@ public abstract class PackageManager {
/**
* Returns an {@link Intent} suitable for passing to {@code startActivityForResult}
* which prompts the user to grant {@code permissions} to this application.
* @hide
*
* @throws NullPointerException if {@code permissions} is {@code null}.
* @throws IllegalArgumentException if {@code permissions} contains {@code null}.

View File

@@ -1023,16 +1023,14 @@ 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(Boolean.TRUE);
pkg.requestedPermissionsRequired.add(required ? Boolean.TRUE : Boolean.FALSE);
}
XmlUtils.skipCurrentTag(parser);

View File

@@ -991,9 +991,8 @@
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
@@ -1036,7 +1035,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" format="boolean" />
<attr name="required" />
</declare-styleable>
<!-- The <code>uses-sdk</code> tag describes the SDK features that the