Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bd16014d authored by Zhen Zhang's avatar Zhen Zhang
Browse files

Allow low ram device to have multiple users and managed profies

Remove these runtime restrictions of low ram device.
This change wouldn't bring the features onto low ram device, because
manufacturers need to change some configs to enable the features, but
would allow the usage.

Bug: 153016458
Test: build successful; multiple users and managed profiles can be
enabled with config changes

Change-Id: Ibe59219dab7e138d7dae19df77d36477e9e76b8e
parent 0d07c9ac
Loading
Loading
Loading
Loading
+0 −7
Original line number Diff line number Diff line
@@ -4090,13 +4090,6 @@ public class UserManager {
    public static int getMaxSupportedUsers() {
        // Don't allow multiple users on certain builds
        if (android.os.Build.ID.startsWith("JVP")) return 1;
        if (ActivityManager.isLowRamDeviceStatic()) {
            // Low-ram devices are Svelte. Most of the time they don't get multi-user.
            if ((Resources.getSystem().getConfiguration().uiMode & Configuration.UI_MODE_TYPE_MASK)
                    != Configuration.UI_MODE_TYPE_TELEVISION) {
                return 1;
            }
        }
        return SystemProperties.getInt("fw.max_users",
                Resources.getSystem().getInteger(R.integer.config_multiuserMaximumUsers));
    }
+0 −3
Original line number Diff line number Diff line
@@ -2249,9 +2249,6 @@ public class UserManagerService extends IUserManager.Stub {
        // Managed profiles have their own specific rules.
        final boolean isManagedProfile = type.isManagedProfile();
        if (isManagedProfile) {
            if (ActivityManager.isLowRamDeviceStatic()) {
                return false;
            }
            if (!mContext.getPackageManager().hasSystemFeature(
                    PackageManager.FEATURE_MANAGED_USERS)) {
                return false;