Loading core/java/android/app/admin/DevicePolicyManager.java +11 −0 Original line number Diff line number Diff line Loading @@ -2437,6 +2437,17 @@ public class DevicePolicyManager { return false; } /** * Determine whether or not creating a guest user has been disabled for the device * * @hide */ public boolean getGuestUserDisabled(@Nullable ComponentName admin) { // Currently guest users can always be created if multi-user is enabled // TODO introduce a policy for guest user creation return false; } /** * Called by a device/profile owner to set whether the screen capture is disabled. Disabling * screen capture also prevents the content from being shown on display devices that do not have Loading core/java/android/os/UserManager.java +8 −4 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ import android.annotation.Nullable; import android.annotation.SystemApi; import android.app.ActivityManager; import android.app.ActivityManagerNative; import android.app.admin.DevicePolicyManager; import android.content.Context; import android.content.pm.UserInfo; import android.content.res.Resources; Loading Loading @@ -1337,12 +1338,15 @@ public class UserManager { } /** * Returns true if the user switcher should be shown, this will be if there * are multiple users that aren't managed profiles. * Returns true if the user switcher should be shown, this will be if device supports multi-user * and there are at least 2 users available that are not managed profiles. * @hide * @return true if user switcher should be shown. */ public boolean isUserSwitcherEnabled() { if (!supportsMultipleUsers()) { return false; } List<UserInfo> users = getUsers(true); if (users == null) { return false; Loading @@ -1353,8 +1357,8 @@ public class UserManager { ++switchableUserCount; } } final boolean guestEnabled = Settings.Global.getInt(mContext.getContentResolver(), Settings.Global.GUEST_USER_ENABLED, 0) == 1; final boolean guestEnabled = !mContext.getSystemService(DevicePolicyManager.class) .getGuestUserDisabled(null); return switchableUserCount > 1 || guestEnabled; } Loading core/java/android/provider/Settings.java +0 −8 Original line number Diff line number Diff line Loading @@ -7688,14 +7688,6 @@ public final class Settings { */ public static final String DEVICE_NAME = "device_name"; /** * Whether it should be possible to create a guest user on the device. * <p> * Type: int (0 for disabled, 1 for enabled) * @hide */ public static final String GUEST_USER_ENABLED = "guest_user_enabled"; /** * Whether the NetworkScoringService has been first initialized. * <p> Loading packages/SettingsProvider/res/values/defaults.xml +0 −3 Original line number Diff line number Diff line Loading @@ -204,9 +204,6 @@ <!-- Default for Settings.Secure.WAKE_GESTURE_ENABLED --> <bool name="def_wake_gesture_enabled">true</bool> <!-- Default for Settings.Global.GUEST_USER_ENABLED --> <bool name="def_guest_user_enabled">true</bool> <!-- Default state of tap to wake --> <bool name="def_double_tap_to_wake">true</bool> Loading packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java +1 −16 Original line number Diff line number Diff line Loading @@ -1693,20 +1693,7 @@ class DatabaseHelper extends SQLiteOpenHelper { } if (upgradeVersion < 105) { if (mUserHandle == UserHandle.USER_SYSTEM) { db.beginTransaction(); SQLiteStatement stmt = null; try { stmt = db.compileStatement("INSERT OR IGNORE INTO global(name,value)" + " VALUES(?,?);"); loadBooleanSetting(stmt, Settings.Global.GUEST_USER_ENABLED, R.bool.def_guest_user_enabled); db.setTransactionSuccessful(); } finally { db.endTransaction(); if (stmt != null) stmt.close(); } } // No-op: GUEST_USER_ENABLED setting was removed upgradeVersion = 105; } Loading Loading @@ -2705,8 +2692,6 @@ class DatabaseHelper extends SQLiteOpenHelper { loadSetting(stmt, Settings.Global.DEVICE_NAME, getDefaultDeviceName()); loadBooleanSetting(stmt, Settings.Global.GUEST_USER_ENABLED, R.bool.def_guest_user_enabled); loadSetting(stmt, Settings.Global.ENHANCED_4G_MODE_ENABLED, ImsConfig.FeatureValueConstants.ON); Loading Loading
core/java/android/app/admin/DevicePolicyManager.java +11 −0 Original line number Diff line number Diff line Loading @@ -2437,6 +2437,17 @@ public class DevicePolicyManager { return false; } /** * Determine whether or not creating a guest user has been disabled for the device * * @hide */ public boolean getGuestUserDisabled(@Nullable ComponentName admin) { // Currently guest users can always be created if multi-user is enabled // TODO introduce a policy for guest user creation return false; } /** * Called by a device/profile owner to set whether the screen capture is disabled. Disabling * screen capture also prevents the content from being shown on display devices that do not have Loading
core/java/android/os/UserManager.java +8 −4 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ import android.annotation.Nullable; import android.annotation.SystemApi; import android.app.ActivityManager; import android.app.ActivityManagerNative; import android.app.admin.DevicePolicyManager; import android.content.Context; import android.content.pm.UserInfo; import android.content.res.Resources; Loading Loading @@ -1337,12 +1338,15 @@ public class UserManager { } /** * Returns true if the user switcher should be shown, this will be if there * are multiple users that aren't managed profiles. * Returns true if the user switcher should be shown, this will be if device supports multi-user * and there are at least 2 users available that are not managed profiles. * @hide * @return true if user switcher should be shown. */ public boolean isUserSwitcherEnabled() { if (!supportsMultipleUsers()) { return false; } List<UserInfo> users = getUsers(true); if (users == null) { return false; Loading @@ -1353,8 +1357,8 @@ public class UserManager { ++switchableUserCount; } } final boolean guestEnabled = Settings.Global.getInt(mContext.getContentResolver(), Settings.Global.GUEST_USER_ENABLED, 0) == 1; final boolean guestEnabled = !mContext.getSystemService(DevicePolicyManager.class) .getGuestUserDisabled(null); return switchableUserCount > 1 || guestEnabled; } Loading
core/java/android/provider/Settings.java +0 −8 Original line number Diff line number Diff line Loading @@ -7688,14 +7688,6 @@ public final class Settings { */ public static final String DEVICE_NAME = "device_name"; /** * Whether it should be possible to create a guest user on the device. * <p> * Type: int (0 for disabled, 1 for enabled) * @hide */ public static final String GUEST_USER_ENABLED = "guest_user_enabled"; /** * Whether the NetworkScoringService has been first initialized. * <p> Loading
packages/SettingsProvider/res/values/defaults.xml +0 −3 Original line number Diff line number Diff line Loading @@ -204,9 +204,6 @@ <!-- Default for Settings.Secure.WAKE_GESTURE_ENABLED --> <bool name="def_wake_gesture_enabled">true</bool> <!-- Default for Settings.Global.GUEST_USER_ENABLED --> <bool name="def_guest_user_enabled">true</bool> <!-- Default state of tap to wake --> <bool name="def_double_tap_to_wake">true</bool> Loading
packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java +1 −16 Original line number Diff line number Diff line Loading @@ -1693,20 +1693,7 @@ class DatabaseHelper extends SQLiteOpenHelper { } if (upgradeVersion < 105) { if (mUserHandle == UserHandle.USER_SYSTEM) { db.beginTransaction(); SQLiteStatement stmt = null; try { stmt = db.compileStatement("INSERT OR IGNORE INTO global(name,value)" + " VALUES(?,?);"); loadBooleanSetting(stmt, Settings.Global.GUEST_USER_ENABLED, R.bool.def_guest_user_enabled); db.setTransactionSuccessful(); } finally { db.endTransaction(); if (stmt != null) stmt.close(); } } // No-op: GUEST_USER_ENABLED setting was removed upgradeVersion = 105; } Loading Loading @@ -2705,8 +2692,6 @@ class DatabaseHelper extends SQLiteOpenHelper { loadSetting(stmt, Settings.Global.DEVICE_NAME, getDefaultDeviceName()); loadBooleanSetting(stmt, Settings.Global.GUEST_USER_ENABLED, R.bool.def_guest_user_enabled); loadSetting(stmt, Settings.Global.ENHANCED_4G_MODE_ENABLED, ImsConfig.FeatureValueConstants.ON); Loading