Bug 1181660 - Restricted profiles: At least one restriction has to be enabled in order to be a restricted profile. r=ally
authorSebastian Kaspari <s.kaspari@gmail.com>
Wed, 15 Jul 2015 13:14:14 +0200
changeset 252917 ae59ec951b241feb27d83e2ac277f03f6c071dcf
parent 252916 eb346fb7c9627320015215fd40b024d3b1fac1fb
child 252918 c4acce49322e90bd8a9b5212688b78c1f23fd088
push id14027
push users.kaspari@gmail.com
push dateWed, 15 Jul 2015 11:17:34 +0000
treeherderfx-team@ae59ec951b24 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersally
bugs1181660
milestone42.0a1
Bug 1181660 - Restricted profiles: At least one restriction has to be enabled in order to be a restricted profile. r=ally
mobile/android/base/RestrictedProfiles.java
--- a/mobile/android/base/RestrictedProfiles.java
+++ b/mobile/android/base/RestrictedProfiles.java
@@ -190,17 +190,25 @@ public class RestrictedProfiles {
         if (getInGuest()) {
             return true;
         }
 
         if (Versions.preJBMR2) {
             return false;
         }
 
-        return !getRestrictions(context).isEmpty();
+        Bundle restrictions = getRestrictions(context);
+        for (String key : restrictions.keySet()) {
+            if (restrictions.getBoolean(key)) {
+                // At least one restriction is enabled -> We are a restricted profile
+                return true;
+            }
+        }
+
+        return false;
     }
 
     public static boolean isAllowed(final Context context, final Restriction action) {
         return isAllowed(context, action, null);
     }
 
     @WrapElementForJNI
     public static boolean isAllowed(int action, String url) {