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 222172 29d54b125d3a
parent 222171 fe4c34c770e5
child 222173 3856aebece7b
push id556
push userkwierso@gmail.com
push dateSat, 18 Jul 2015 00:15:25 +0000
treeherdermozilla-b2g34_v2_1@29d54b125d3a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskhuey, gwagner
bugs1184404
milestone34.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
@@ -1524,19 +1524,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
 
   p->MaybeResolve(JS::UndefinedHandleValue);