diff options
author | Tao Bai <michaelbai@google.com> | 2014-07-23 19:39:51 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2014-07-23 19:39:51 +0000 |
commit | a365888c065bd31b2daaae9a2e241f9eabf352c5 (patch) | |
tree | 5ad07368f294ae93fd5085da63b13f2137a6214e | |
parent | 270a8abcbfb60b58736edf1353099e524b1703f6 (diff) | |
parent | 9971e3f4bad925e87fc7c4bd82a7e6b097ce3981 (diff) | |
download | packages_apps_Browser-a365888c065bd31b2daaae9a2e241f9eabf352c5.zip packages_apps_Browser-a365888c065bd31b2daaae9a2e241f9eabf352c5.tar.gz packages_apps_Browser-a365888c065bd31b2daaae9a2e241f9eabf352c5.tar.bz2 |
am 9971e3f4: Changes correspoding to Permission API change
* commit '9971e3f4bad925e87fc7c4bd82a7e6b097ce3981':
Changes correspoding to Permission API change
-rw-r--r-- | res/values/strings.xml | 2 | ||||
-rw-r--r-- | src/com/android/browser/PermissionsPrompt.java | 16 |
2 files changed, 10 insertions, 8 deletions
diff --git a/res/values/strings.xml b/res/values/strings.xml index 8a0fd49..bba4dbe 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -858,7 +858,7 @@ <string name="permissions_prompt_allow">Allow</string> <string name="permissions_prompt_deny">Deny</string> <string name="permissions_prompt_remember">Remember preference</string> - <string name="resource_geolocation">location</string> + <string name="resource_protected_media_id">protected media ID</string> <string name="resource_video_capture">camera</string> <string name="resource_audio_capture">microphone</string> <string name="geolocation_permissions_prompt_message"><xliff:g id="website origin" example="maps.google.com">%s</xliff:g> wants to know your location</string> diff --git a/src/com/android/browser/PermissionsPrompt.java b/src/com/android/browser/PermissionsPrompt.java index e84ab32..29412d9 100644 --- a/src/com/android/browser/PermissionsPrompt.java +++ b/src/com/android/browser/PermissionsPrompt.java @@ -81,14 +81,16 @@ public class PermissionsPrompt extends RelativeLayout { } public void setMessage() { - long resources = mRequest.getResources(); + String[] resources = mRequest.getResources(); Vector<String> strings = new Vector<String>(); - if ((resources & PermissionRequest.RESOURCE_GEOLOCATION) != 0) - strings.add(getResources().getString(R.string.resource_geolocation)); - if ((resources & PermissionRequest.RESOURCE_VIDEO_CAPTURE) != 0) - strings.add(getResources().getString(R.string.resource_video_capture)); - if ((resources & PermissionRequest.RESOURCE_AUDIO_CAPTURE) != 0) - strings.add(getResources().getString(R.string.resource_audio_capture)); + for (String resource : resources) { + if (resource.equals(PermissionRequest.RESOURCE_VIDEO_CAPTURE)) + strings.add(getResources().getString(R.string.resource_video_capture)); + else if (resource.equals(PermissionRequest.RESOURCE_AUDIO_CAPTURE)) + strings.add(getResources().getString(R.string.resource_audio_capture)); + else if (resource.equals(PermissionRequest.RESOURCE_PROTECTED_MEDIA_ID)) + strings.add(getResources().getString(R.string.resource_protected_media_id)); + } if (strings.isEmpty()) return; Enumeration<String> e = strings.elements(); |