Bug 1213921 - Only check application restrictions to determine whether the user is on a restricted profprofile. r=ally, a=lizzard
--- a/mobile/android/base/RestrictedProfiles.java
+++ b/mobile/android/base/RestrictedProfiles.java
@@ -69,29 +69,19 @@ public class RestrictedProfiles {
return configuration instanceof RestrictedProfileConfiguration;
}
if (Versions.preJBMR2) {
// Early versions don't support restrictions at all
return false;
}
+ // The user is on a restricted profile if, and only if, we injected application restrictions during account setup.
final UserManager mgr = (UserManager) context.getSystemService(Context.USER_SERVICE);
- final Bundle restrictions = new Bundle();
- restrictions.putAll(mgr.getApplicationRestrictions(context.getPackageName()));
- restrictions.putAll(mgr.getUserRestrictions());
-
- for (String key : restrictions.keySet()) {
- if (restrictions.getBoolean(key)) {
- // At least one restriction is enabled -> We are a restricted profile
- return true;
- }
- }
-
- return false;
+ return !mgr.getApplicationRestrictions(context.getPackageName()).isEmpty();
}
public static void update(Context context) {
getConfiguration(context).update();
}
private static Restriction geckoActionToRestriction(int action) {
for (Restriction rest : Restriction.values()) {