mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-28 15:23:51 +00:00
Bug 1213921 - Only check application restrictions to determine whether the user is on a restricted profprofile. r=ally
--HG-- extra : commitid : H9Pc5CaMXHf extra : rebase_source : e224982841f87052d751a7fa7cabeac4d6b9a93f
This commit is contained in:
parent
3db060bf68
commit
78e59ca46f
@ -74,19 +74,9 @@ public class RestrictedProfiles {
|
||||
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) {
|
||||
|
Loading…
Reference in New Issue
Block a user