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

Commit b2cefd58 authored by Felipe Leme's avatar Felipe Leme
Browse files

Removed UserManager.isSplitSystemUserMode() and its usage.

This mode was never really supported.

Test: build and boot
Fixes: 137101239

Change-Id: If000b29c12a6658d9e9aa68acfef6aff2a2cac92
parent 3fac6887
Loading
Loading
Loading
Loading
+0 −3
Original line number Diff line number Diff line
@@ -906,8 +906,6 @@ package android.content.pm {
    method public boolean isProfile();
    method public boolean isQuietModeEnabled();
    method public boolean isRestricted();
    method public boolean isSystemOnly();
    method public static boolean isSystemOnly(int);
    method public boolean supportsSwitchTo();
    method public boolean supportsSwitchToByUser();
    method public void writeToParcel(android.os.Parcel, int);
@@ -2029,7 +2027,6 @@ package android.os {
    method @NonNull @RequiresPermission(anyOf={android.Manifest.permission.MANAGE_USERS, android.Manifest.permission.CREATE_USERS, android.Manifest.permission.QUERY_USERS}) public String getUserType();
    method @NonNull @RequiresPermission(anyOf={android.Manifest.permission.MANAGE_USERS, android.Manifest.permission.CREATE_USERS}) public java.util.List<android.content.pm.UserInfo> getUsers(boolean, boolean, boolean);
    method @RequiresPermission(anyOf={android.Manifest.permission.MANAGE_USERS, android.Manifest.permission.CREATE_USERS}) public boolean hasBaseUserRestriction(@NonNull String, @NonNull android.os.UserHandle);
    method public static boolean isSplitSystemUser();
    method @RequiresPermission(anyOf={android.Manifest.permission.MANAGE_USERS, android.Manifest.permission.CREATE_USERS}) public boolean isUserTypeEnabled(@NonNull String);
    method public boolean isVisibleBackgroundUsersSupported();
    method @NonNull @RequiresPermission(anyOf={android.Manifest.permission.MANAGE_USERS, android.Manifest.permission.CREATE_USERS}) public android.content.pm.UserInfo preCreateUser(@NonNull String) throws android.os.UserManager.UserOperationException;
+1 −19
Original line number Diff line number Diff line
@@ -388,24 +388,6 @@ public class UserInfo implements Parcelable {
        return (flags & FLAG_MAIN) == FLAG_MAIN;
    }

    /**
     * Returns true if the user is a split system user.
     * <p>If {@link UserManager#isSplitSystemUser split system user mode} is not enabled,
     * the method always returns false.
     */
    public boolean isSystemOnly() {
        return isSystemOnly(id);
    }

    /**
     * Returns true if the given user is a split system user.
     * <p>If {@link UserManager#isSplitSystemUser split system user mode} is not enabled,
     * the method always returns false.
     */
    public static boolean isSystemOnly(int userId) {
        return userId == UserHandle.USER_SYSTEM && UserManager.isSplitSystemUser();
    }

    /**
     * @return true if this user can be switched to.
     **/
@@ -437,7 +419,7 @@ public class UserInfo implements Parcelable {
        if (isProfile() || isGuest() || isRestricted()) {
            return false;
        }
        if (UserManager.isSplitSystemUser() || UserManager.isHeadlessSystemUserMode()) {
        if (UserManager.isHeadlessSystemUserMode()) {
            return id != UserHandle.USER_SYSTEM;
        } else {
            return id == UserHandle.USER_SYSTEM;
+0 −12
Original line number Diff line number Diff line
@@ -65,7 +65,6 @@ import android.util.Log;
import android.view.WindowManager.LayoutParams;

import com.android.internal.R;
import com.android.internal.os.RoSystemProperties;
import com.android.internal.util.FrameworkStatsLog;

import java.io.IOException;
@@ -2067,17 +2066,6 @@ public class UserManager {
                Resources.getSystem().getBoolean(R.bool.config_enableMultiUserUI));
    }

    /**
     * @hide
     * @return Whether the device is running with split system user. It means the system user and
     * primary user are two separate users. Previously system user and primary user are combined as
     * a single owner user.  see @link {android.os.UserHandle#USER_OWNER}
     */
    @TestApi
    public static boolean isSplitSystemUser() {
        return RoSystemProperties.FW_SYSTEM_USER_SPLIT;
    }

    /**
     * @return Whether guest user is always ephemeral
     * @hide
+0 −3
Original line number Diff line number Diff line
@@ -48,9 +48,6 @@ public class RoSystemProperties {
    public static final boolean CONFIG_SMALL_BATTERY =
            SystemProperties.getBoolean("ro.config.small_battery", false);

    // ------ ro.fw.* ------------ //
    public static final boolean FW_SYSTEM_USER_SPLIT =
            SystemProperties.getBoolean("ro.fw.system_user_split", false);
    /**
     * Indicates whether the device should run in headless system user mode,
     *   in which user 0 only runs the system, not a real user.
+1 −2
Original line number Diff line number Diff line
@@ -624,12 +624,11 @@ public class LockPatternUtils {
        }
        boolean disabledByDefault = mContext.getResources().getBoolean(
                com.android.internal.R.bool.config_disableLockscreenByDefault);
        boolean isSystemUser = UserManager.isSplitSystemUser() && userId == UserHandle.USER_SYSTEM;
        UserInfo userInfo = getUserManager().getUserInfo(userId);
        boolean isDemoUser = UserManager.isDeviceInDemoMode(mContext) && userInfo != null
                && userInfo.isDemo();
        return getBoolean(DISABLE_LOCKSCREEN_KEY, false, userId)
                || (disabledByDefault && !isSystemUser)
                || disabledByDefault
                || isDemoUser;
    }

Loading