am 8c8fd247: am cee5267b: am dc2c1a0f: docs: add explanation of default permissions to Permission guide and fix code snippet error in WebView guide. external issue:41441
* commit '8c8fd247a6a7f49031251ba11036779a41d9a2bf': docs: add explanation of default permissions to Permission guide and fix code snippet error in WebView guide. external issue:41441
This commit is contained in:
@@ -61,6 +61,7 @@ NDK</a>). All types of applications — Java, native, and hybrid —
|
|||||||
are sandboxed in the same way and have the same degree of security from each
|
are sandboxed in the same way and have the same degree of security from each
|
||||||
other.</p>
|
other.</p>
|
||||||
|
|
||||||
|
|
||||||
<a name="signing"></a>
|
<a name="signing"></a>
|
||||||
<h2>Application Signing</h2>
|
<h2>Application Signing</h2>
|
||||||
|
|
||||||
@@ -112,7 +113,7 @@ been set appropriately so any other application can see it.</p>
|
|||||||
<a name="permissions"></a>
|
<a name="permissions"></a>
|
||||||
<h2>Using Permissions</h2>
|
<h2>Using Permissions</h2>
|
||||||
|
|
||||||
<p>A basic Android application has no permissions associated with it,
|
<p>A basic Android application has no permissions associated with it by default,
|
||||||
meaning it can not do anything that would adversely impact the user experience
|
meaning it can not do anything that would adversely impact the user experience
|
||||||
or any data on the device. To make use of protected features of the device,
|
or any data on the device. To make use of protected features of the device,
|
||||||
you must include in your <code>AndroidManifest.xml</code> one or more
|
you must include in your <code>AndroidManifest.xml</code> one or more
|
||||||
@@ -165,6 +166,33 @@ your broadcast or who can send a broadcast to you.</li>
|
|||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<div class="caution">
|
||||||
|
<p><strong>Caution:</strong> Over time,
|
||||||
|
new restrictions may be added to the platform such that, in order
|
||||||
|
to use certain APIs, your app must request a permission that it previously did not need.
|
||||||
|
Because existing apps assume access to those APIs is freely available,
|
||||||
|
Android may apply the new permission request to the app's manifest to avoid
|
||||||
|
breaking the app on the new platform version.
|
||||||
|
Android makes the decision as to whether an app might need the permission based on
|
||||||
|
the value provided for the <a
|
||||||
|
href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#target">{@code targetSdkVersion}</a>
|
||||||
|
attribute. If the value is lower than the version in which the permission was added, then
|
||||||
|
Android adds the permission.</p>
|
||||||
|
<p>For example, the {@link android.Manifest.permission#WRITE_EXTERNAL_STORAGE} permission was
|
||||||
|
added in API level 4 to restrict access to the shared storage space. If your <a
|
||||||
|
href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#target">{@code targetSdkVersion}</a>
|
||||||
|
is 3 or lower, this permission is added to your app on newer versions of Android.</p>
|
||||||
|
<p>Beware that if this happens to your app, your app listing on Google Play will show these
|
||||||
|
required permissions even though your app might not actually require them.</p>
|
||||||
|
<p>To avoid this and remove the default permissions you don't need, always update your <a
|
||||||
|
href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#target">{@code targetSdkVersion}</a>
|
||||||
|
to be as high as possible. You can see which permissions were added with each release in the
|
||||||
|
{@link android.os.Build.VERSION_CODES} documentation.</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a name="declaring"></a>
|
<a name="declaring"></a>
|
||||||
<h2>Declaring and Enforcing Permissions</h2>
|
<h2>Declaring and Enforcing Permissions</h2>
|
||||||
|
|
||||||
|
|||||||
@@ -162,7 +162,7 @@ public class WebAppInterface {
|
|||||||
Context mContext;
|
Context mContext;
|
||||||
|
|
||||||
/** Instantiate the interface and set the context */
|
/** Instantiate the interface and set the context */
|
||||||
JavaScriptInterface(Context c) {
|
WebAppInterface(Context c) {
|
||||||
mContext = c;
|
mContext = c;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user