Loading packages/SettingsLib/src/com/android/settingslib/HelpUtils.java +7 −0 Original line number Diff line number Diff line Loading @@ -25,6 +25,7 @@ import android.content.pm.PackageInfo; import android.content.pm.PackageManager.NameNotFoundException; import android.content.res.Resources.Theme; import android.net.Uri; import android.provider.Settings.Global; import android.text.TextUtils; import android.util.Log; import android.util.TypedValue; Loading Loading @@ -91,6 +92,9 @@ public class HelpUtils { */ public static boolean prepareHelpMenuItem(final Activity activity, MenuItem helpMenuItem, String helpUriString, String backupContext) { if (Global.getInt(activity.getContentResolver(), Global.DEVICE_PROVISIONED, 0) == 0) { return false; } if (TextUtils.isEmpty(helpUriString)) { // The help url string is empty or null, so set the help menu item to be invisible. helpMenuItem.setVisible(false); Loading Loading @@ -128,6 +132,9 @@ public class HelpUtils { public static Intent getHelpIntent(Context context, String helpUriString, String backupContext) { if (Global.getInt(context.getContentResolver(), Global.DEVICE_PROVISIONED, 0) == 0) { return null; } // Try to handle as Intent Uri, otherwise just treat as Uri. try { Intent intent = Intent.parseUri(helpUriString, Loading packages/SettingsLib/src/com/android/settingslib/drawer/TileUtils.java +6 −1 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ import android.graphics.drawable.Icon; import android.os.Bundle; import android.os.UserHandle; import android.os.UserManager; import android.provider.Settings.Global; import android.text.TextUtils; import android.util.Log; import android.util.Pair; Loading Loading @@ -115,6 +116,8 @@ public class TileUtils { public static List<DashboardCategory> getCategories(Context context, HashMap<Pair<String, String>, Tile> cache) { final long startTime = System.currentTimeMillis(); boolean setup = Global.getInt(context.getContentResolver(), Global.DEVICE_PROVISIONED, 0) != 0; ArrayList<Tile> tiles = new ArrayList<>(); UserManager userManager = UserManager.get(context); for (UserHandle user : userManager.getUserProfiles()) { Loading @@ -127,8 +130,10 @@ public class TileUtils { getTilesForAction(context, user, MANUFACTURER_SETTINGS, cache, MANUFACTURER_DEFAULT_CATEGORY, tiles, false); } if (setup) { getTilesForAction(context, user, EXTRA_SETTINGS_ACTION, cache, null, tiles, false); } } HashMap<String, DashboardCategory> categoryMap = new HashMap<>(); for (Tile tile : tiles) { DashboardCategory category = categoryMap.get(tile.category); Loading packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java +5 −0 Original line number Diff line number Diff line Loading @@ -1207,6 +1207,11 @@ public class SettingsProvider extends ContentProvider { restriction = UserManager.DISALLOW_CONFIG_VPN; break; case Settings.Global.SAFE_BOOT_DISALLOWED: if ("1".equals(value)) return false; restriction = UserManager.DISALLOW_SAFE_BOOT; break; default: if (setting != null && setting.startsWith(Settings.Global.DATA_ROAMING)) { if ("0".equals(value)) return false; Loading services/core/java/com/android/server/pm/UserManagerService.java +1 −1 Original line number Diff line number Diff line Loading @@ -548,7 +548,7 @@ public class UserManagerService extends IUserManager.Stub { public List<UserInfo> getProfiles(int userId, boolean enabledOnly) { boolean returnFullInfo = true; if (userId != UserHandle.getCallingUserId()) { checkManageUsersPermission("getting profiles related to user " + userId); checkManageOrCreateUsersPermission("getting profiles related to user " + userId); } else { returnFullInfo = hasManageUsersPermission(); } Loading services/core/java/com/android/server/pm/UserRestrictionsUtils.java +3 −0 Original line number Diff line number Diff line Loading @@ -330,6 +330,9 @@ public class UserRestrictionsUtils { // set, and in that case even if the restriction is lifted, changing it to ON would be // wrong. So just don't do anything in such a case. If the user hopes to enable location // later, they can do it on the Settings UI. // WARNING: Remember that Settings.Global and Settings.Secure are changeable via adb. // To prevent this from happening for a given user restriction, you have to add a check to // SettingsProvider.isGlobalOrSecureSettingRestrictedForUser. final ContentResolver cr = context.getContentResolver(); final long id = Binder.clearCallingIdentity(); Loading Loading
packages/SettingsLib/src/com/android/settingslib/HelpUtils.java +7 −0 Original line number Diff line number Diff line Loading @@ -25,6 +25,7 @@ import android.content.pm.PackageInfo; import android.content.pm.PackageManager.NameNotFoundException; import android.content.res.Resources.Theme; import android.net.Uri; import android.provider.Settings.Global; import android.text.TextUtils; import android.util.Log; import android.util.TypedValue; Loading Loading @@ -91,6 +92,9 @@ public class HelpUtils { */ public static boolean prepareHelpMenuItem(final Activity activity, MenuItem helpMenuItem, String helpUriString, String backupContext) { if (Global.getInt(activity.getContentResolver(), Global.DEVICE_PROVISIONED, 0) == 0) { return false; } if (TextUtils.isEmpty(helpUriString)) { // The help url string is empty or null, so set the help menu item to be invisible. helpMenuItem.setVisible(false); Loading Loading @@ -128,6 +132,9 @@ public class HelpUtils { public static Intent getHelpIntent(Context context, String helpUriString, String backupContext) { if (Global.getInt(context.getContentResolver(), Global.DEVICE_PROVISIONED, 0) == 0) { return null; } // Try to handle as Intent Uri, otherwise just treat as Uri. try { Intent intent = Intent.parseUri(helpUriString, Loading
packages/SettingsLib/src/com/android/settingslib/drawer/TileUtils.java +6 −1 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ import android.graphics.drawable.Icon; import android.os.Bundle; import android.os.UserHandle; import android.os.UserManager; import android.provider.Settings.Global; import android.text.TextUtils; import android.util.Log; import android.util.Pair; Loading Loading @@ -115,6 +116,8 @@ public class TileUtils { public static List<DashboardCategory> getCategories(Context context, HashMap<Pair<String, String>, Tile> cache) { final long startTime = System.currentTimeMillis(); boolean setup = Global.getInt(context.getContentResolver(), Global.DEVICE_PROVISIONED, 0) != 0; ArrayList<Tile> tiles = new ArrayList<>(); UserManager userManager = UserManager.get(context); for (UserHandle user : userManager.getUserProfiles()) { Loading @@ -127,8 +130,10 @@ public class TileUtils { getTilesForAction(context, user, MANUFACTURER_SETTINGS, cache, MANUFACTURER_DEFAULT_CATEGORY, tiles, false); } if (setup) { getTilesForAction(context, user, EXTRA_SETTINGS_ACTION, cache, null, tiles, false); } } HashMap<String, DashboardCategory> categoryMap = new HashMap<>(); for (Tile tile : tiles) { DashboardCategory category = categoryMap.get(tile.category); Loading
packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java +5 −0 Original line number Diff line number Diff line Loading @@ -1207,6 +1207,11 @@ public class SettingsProvider extends ContentProvider { restriction = UserManager.DISALLOW_CONFIG_VPN; break; case Settings.Global.SAFE_BOOT_DISALLOWED: if ("1".equals(value)) return false; restriction = UserManager.DISALLOW_SAFE_BOOT; break; default: if (setting != null && setting.startsWith(Settings.Global.DATA_ROAMING)) { if ("0".equals(value)) return false; Loading
services/core/java/com/android/server/pm/UserManagerService.java +1 −1 Original line number Diff line number Diff line Loading @@ -548,7 +548,7 @@ public class UserManagerService extends IUserManager.Stub { public List<UserInfo> getProfiles(int userId, boolean enabledOnly) { boolean returnFullInfo = true; if (userId != UserHandle.getCallingUserId()) { checkManageUsersPermission("getting profiles related to user " + userId); checkManageOrCreateUsersPermission("getting profiles related to user " + userId); } else { returnFullInfo = hasManageUsersPermission(); } Loading
services/core/java/com/android/server/pm/UserRestrictionsUtils.java +3 −0 Original line number Diff line number Diff line Loading @@ -330,6 +330,9 @@ public class UserRestrictionsUtils { // set, and in that case even if the restriction is lifted, changing it to ON would be // wrong. So just don't do anything in such a case. If the user hopes to enable location // later, they can do it on the Settings UI. // WARNING: Remember that Settings.Global and Settings.Secure are changeable via adb. // To prevent this from happening for a given user restriction, you have to add a check to // SettingsProvider.isGlobalOrSecureSettingRestrictedForUser. final ContentResolver cr = context.getContentResolver(); final long id = Binder.clearCallingIdentity(); Loading