diff options
| -rw-r--r-- | core/java/android/content/pm/PackageParser.java | 14 | ||||
| -rw-r--r-- | core/res/res/values/attrs_manifest.xml | 17 |
2 files changed, 16 insertions, 15 deletions
diff --git a/core/java/android/content/pm/PackageParser.java b/core/java/android/content/pm/PackageParser.java index c1e6a4d..bdbed75 100644 --- a/core/java/android/content/pm/PackageParser.java +++ b/core/java/android/content/pm/PackageParser.java @@ -1487,7 +1487,11 @@ public class PackageParser { return null; } } else if (tagName.equals("uses-permission")) { - if (!parseUsesPermission(pkg, res, parser, attrs, outError)) { + if (!parseUsesPermission(pkg, res, parser, attrs)) { + return null; + } + } else if (tagName.equals("uses-permission-sdk-m")) { + if (!parseUsesPermission(pkg, res, parser, attrs)) { return null; } } else if (tagName.equals("uses-configuration")) { @@ -1887,8 +1891,7 @@ public class PackageParser { } private boolean parseUsesPermission(Package pkg, Resources res, XmlResourceParser parser, - AttributeSet attrs, String[] outError) - throws XmlPullParserException, IOException { + AttributeSet attrs) throws XmlPullParserException, IOException { TypedArray sa = res.obtainAttributes(attrs, com.android.internal.R.styleable.AndroidManifestUsesPermission); @@ -1914,8 +1917,9 @@ public class PackageParser { if (index == -1) { pkg.requestedPermissions.add(name.intern()); } else { - Slog.w(TAG, "Ignoring duplicate uses-permission: " + name + " in package: " - + pkg.packageName + " at: " + parser.getPositionDescription()); + Slog.w(TAG, "Ignoring duplicate uses-permissions/uses-permissions-sdk-m: " + + name + " in package: " + pkg.packageName + " at: " + + parser.getPositionDescription()); } } } diff --git a/core/res/res/values/attrs_manifest.xml b/core/res/res/values/attrs_manifest.xml index b0b4e3a..5ffe57e 100644 --- a/core/res/res/values/attrs_manifest.xml +++ b/core/res/res/values/attrs_manifest.xml @@ -1269,8 +1269,13 @@ <!-- The <code>uses-permission</code> tag requests a {@link #AndroidManifestPermission <permission>} that the containing - package must be granted in order for it to operate correctly. - See the <a href="{@docRoot}guide/topics/security/security.html">Security and Permissions</a> + package must be granted in order for it to operate correctly. For runtime + permissions, i.e. ones with <code>dangerous</code> protection level, on a + platform that supports runtime permissions, the permission will not be + granted until the app explicitly requests it at runtime and the user approves + the grant. You cannot request at runtime permissions that are not declared + as used in the manifest. See the + <a href="{@docRoot}guide/topics/security/security.html">Security and Permissions</a> document for more information on permissions. Also available is a {@link android.Manifest.permission list of permissions} included with the base platform. @@ -1289,14 +1294,6 @@ of Android higher than the number given here, the permission will not be requested. --> <attr name="maxSdkVersion" format="integer" /> - <!-- Specify whether this permission is required for the application. - The default is true, meaning the application requires the - 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. - <attr name="required" format="boolean" /> - --> </declare-styleable> <!-- The <code>uses-configuration</code> tag specifies |
