Bug 1184404 - Support additional navigator.getFeature keys for OpenMobile ACL. r=khuey a=gwagner CLOSED TREE
authorWilliam Chen <wchen@mozilla.com>
Fri, 17 Jul 2015 11:17:37 -0700
changeset 204938 367b6867e3ff122e08634b7fc76623967b1e8fd7
parent 204937 2650a12af04893c1fa7580977307395e7a866e81
child 204939 69dcc68fad52caea415d5651eb7ae0a1e5b28a7f
push id859
push userkwierso@gmail.com
push dateSat, 18 Jul 2015 00:16:13 +0000
treeherdermozilla-b2g32_v2_0@367b6867e3ff [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskhuey, gwagner
bugs1184404
milestone32.0
Bug 1184404 - Support additional navigator.getFeature keys for OpenMobile ACL. r=khuey a=gwagner CLOSED TREE
dom/base/Navigator.cpp
--- a/dom/base/Navigator.cpp
+++ b/dom/base/Navigator.cpp
@@ -1520,19 +1520,22 @@ Navigator::GetFeature(const nsAString& a
       nsRefPtr<Promise> ipcRef(p);
       cc->SendGetSystemMemory(reinterpret_cast<uint64_t>(ipcRef.forget().take()));
     }
     return p.forget();
   } // hardware.memory
 #endif
 
 #ifdef MOZ_WIDGET_GONK
-  if (aName.EqualsLiteral("acl.version")) {
+  if (StringBeginsWith(aName, NS_LITERAL_STRING("acl.")) &&
+      (aName.EqualsLiteral("acl.version") || CheckPermission("external-app"))) {
     char value[PROPERTY_VALUE_MAX];
-    uint32_t len = property_get("persist.acl.version", value, nullptr);
+    nsCString propertyKey("persist.");
+    propertyKey.Append(NS_ConvertUTF16toUTF8(aName));
+    uint32_t len = property_get(propertyKey.get(), value, nullptr);
     if (len > 0) {
       p->MaybeResolve(NS_ConvertUTF8toUTF16(value));
       return p.forget();
     }
   }
 #endif
 
   // Hardcoded manifest features. Some are still b2g specific.