Merge "Do not create profile if FEATURE_MANAGED_USERS is not available" into mnc-dev

This commit is contained in:
Fyodor Kupolov
2015-06-10 00:16:13 +00:00
committed by Android (Google) Code Review

View File

@@ -589,6 +589,10 @@ public class UserManagerService extends IUserManager.Stub {
if (ActivityManager.isLowRamDeviceStatic()) {
return false;
}
if (!mContext.getPackageManager().hasSystemFeature(
PackageManager.FEATURE_MANAGED_USERS)) {
return false;
}
synchronized(mPackagesLock) {
// Limit number of managed profiles that can be created
if (numberOfUsersOfTypeLocked(UserInfo.FLAG_MANAGED_PROFILE, true)