sys user split: first pass updating Settings

Update various places in Settings to use "admin" ueser flag
instead of checking user id "0".  This should be no-op in
single user mode since the only admin user would be user 0.
In split system user mode, this will correctly ACL admin
user instead of non-interactive system user.

Bug: 19913735
Change-Id: Ida4d59c5f689ea0dc34b3b3ff0822b087fa0afd6
This commit is contained in:
Xiaohui Chen
2015-07-22 13:53:22 -07:00
parent 9a946b3cac
commit 44879a387a
16 changed files with 62 additions and 72 deletions

View File

@@ -289,7 +289,7 @@ public class DevelopmentSettings extends SettingsPreferenceFragment
mWifiManager = (WifiManager) getSystemService(Context.WIFI_SERVICE);
if (android.os.Process.myUserHandle().getIdentifier() != UserHandle.USER_OWNER
if (!mUm.isAdminUser()
|| mUm.hasUserRestriction(UserManager.DISALLOW_DEBUGGING_FEATURES)) {
mUnavailable = true;
setPreferenceScreen(new PreferenceScreen(getActivity(), null));
@@ -328,8 +328,7 @@ public class DevelopmentSettings extends SettingsPreferenceFragment
mPassword = (PreferenceScreen) findPreference(LOCAL_BACKUP_PASSWORD);
mAllPrefs.add(mPassword);
if (!android.os.Process.myUserHandle().equals(UserHandle.OWNER)) {
if (!mUm.isAdminUser()) {
disableForUser(mEnableAdb);
disableForUser(mClearAdbKeys);
disableForUser(mEnableTerminal);