summaryrefslogtreecommitdiffstats
path: root/docs
diff options
context:
space:
mode:
authorScott Main <smain@google.com>2013-02-20 16:53:10 -0800
committerAndroid Git Automerger <android-git-automerger@android.com>2013-02-20 16:53:10 -0800
commit09ee121c273d49bc8f77180e9cb49fe23e08bda4 (patch)
tree84aaf13cd87bf36a29de2e747f364720d426624b /docs
parentbedf5b35eb58a1a29799ac5fb79d1a32dec80eb5 (diff)
parent7c3e0dcc7d395430e72b6786b715a530d8b5db4d (diff)
downloadframeworks_base-09ee121c273d49bc8f77180e9cb49fe23e08bda4.zip
frameworks_base-09ee121c273d49bc8f77180e9cb49fe23e08bda4.tar.gz
frameworks_base-09ee121c273d49bc8f77180e9cb49fe23e08bda4.tar.bz2
am 7c3e0dcc: am b5261bfe: am 36c14ef8: am 488c81ae: docs: add note about javascript interface to 4.2 overview
* commit '7c3e0dcc7d395430e72b6786b715a530d8b5db4d': docs: add note about javascript interface to 4.2 overview
Diffstat (limited to 'docs')
-rw-r--r--docs/html/about/versions/android-4.2.jd14
-rw-r--r--docs/html/guide/webapps/webview.jd4
2 files changed, 16 insertions, 2 deletions
diff --git a/docs/html/about/versions/android-4.2.jd b/docs/html/about/versions/android-4.2.jd
index 13ee872..b02c1d1 100644
--- a/docs/html/about/versions/android-4.2.jd
+++ b/docs/html/about/versions/android-4.2.jd
@@ -111,6 +111,20 @@ android:targetSdkVersion}</a> and <a href="{@docRoot}guide/topics/manifest/uses-
android:minSdkVersion}</a> is lower than 17, your app is not able to modify the settings that have
moved to {@link android.provider.Settings.Global} when running on Android 4.2 and higher.</p>
</li>
+
+ <li>If your app uses {@link android.webkit.WebView}, Android 4.2 adds an additional layer of
+ security so you can more safely <b>bind JavaScript to your
+ Android code</b>. If you set your
+ <a href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#target">{@code targetSdkVersion}</a>
+ to 17 or higher, you must now add the {@code @JavascriptInterface} annotation to any method that you
+ want available to your JavaScript (the method must also be public). If you do not provide the
+ annotation, the method is not accessible by a web page in your {@link android.webkit.WebView}
+ when running on Android 4.2 or higher. If you set the
+ <a href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#target">{@code targetSdkVersion}</a>
+ to 16 or lower, the annotation is not required, but we recommend that you update your target version
+ and add the annotation for additional security.
+ <p>Read more about <a href="{@docRoot}guide/webapps/webview.html#BindingJavaScript">binding
+ JavaScript code to Android code</a>.</p></li>
</ul>
diff --git a/docs/html/guide/webapps/webview.jd b/docs/html/guide/webapps/webview.jd
index f8b2a1d..d2b2532 100644
--- a/docs/html/guide/webapps/webview.jd
+++ b/docs/html/guide/webapps/webview.jd
@@ -178,8 +178,8 @@ public class WebAppInterface {
href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#target">{@code targetSdkVersion}</a>
to 17 or higher, <strong>you
must add the {@code &#64;JavascriptInterface} annotation</strong> to any method that you want
-available your web page code (the method must also be public). If you do not provide the
-annotation, then the method will not accessible by your web page when running on Android 4.2 or
+available to your JavaScript (the method must also be public). If you do not provide the
+annotation, the method is not accessible by your web page when running on Android 4.2 or
higher.</p>
<p>In this example, the {@code WebAppInterface} class allows the web page to create a {@link