summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--res/values/strings.xml2
-rw-r--r--src/com/android/browser/PermissionsPrompt.java16
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();