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

Commit 21ee4805 authored by Zhen Zhang's avatar Zhen Zhang Committed by Automerger Merge Worker
Browse files

Merge "Allow low ram device to have multiple users and managed profies" into...

Merge "Allow low ram device to have multiple users and managed profies" into rvc-dev am: 2260f710 am: 934f9faf

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11667418

Change-Id: Ief2a6bb82ba321caff8bf6bb0b971bf68e5fb15d
parents d4ffc692 934f9faf
Loading
Loading
Loading
Loading
+0 −7
Original line number Original line Diff line number Diff line
@@ -4090,13 +4090,6 @@ public class UserManager {
    public static int getMaxSupportedUsers() {
    public static int getMaxSupportedUsers() {
        // Don't allow multiple users on certain builds
        // Don't allow multiple users on certain builds
        if (android.os.Build.ID.startsWith("JVP")) return 1;
        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",
        return SystemProperties.getInt("fw.max_users",
                Resources.getSystem().getInteger(R.integer.config_multiuserMaximumUsers));
                Resources.getSystem().getInteger(R.integer.config_multiuserMaximumUsers));
    }
    }
+0 −3
Original line number Original line Diff line number Diff line
@@ -2250,9 +2250,6 @@ public class UserManagerService extends IUserManager.Stub {
        // Managed profiles have their own specific rules.
        // Managed profiles have their own specific rules.
        final boolean isManagedProfile = type.isManagedProfile();
        final boolean isManagedProfile = type.isManagedProfile();
        if (isManagedProfile) {
        if (isManagedProfile) {
            if (ActivityManager.isLowRamDeviceStatic()) {
                return false;
            }
            if (!mContext.getPackageManager().hasSystemFeature(
            if (!mContext.getPackageManager().hasSystemFeature(
                    PackageManager.FEATURE_MANAGED_USERS)) {
                    PackageManager.FEATURE_MANAGED_USERS)) {
                return false;
                return false;