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

Commit 91d40b7d authored by Emily Bernier's avatar Emily Bernier Committed by Android (Google) Code Review
Browse files

Merge "User restrictions for creds storage & user removal" into jb-mr2-dev

parents 35f02378 11bd33a5
Loading
Loading
Loading
Loading
+10 −6
Original line number Diff line number Diff line
@@ -235,6 +235,8 @@ public class SecuritySettings extends SettingsPreferenceFragment
        mShowPassword = (CheckBoxPreference) root.findPreference(KEY_SHOW_PASSWORD);

        // Credential storage
        final UserManager um = (UserManager) getActivity().getSystemService(Context.USER_SERVICE);
        if (!um.hasUserRestriction(UserManager.DISALLOW_CONFIG_CREDENTIALS)) {
            mKeyStore = KeyStore.getInstance();
            Preference credentialStorageType = root.findPreference(KEY_CREDENTIAL_STORAGE_TYPE);

@@ -244,6 +246,9 @@ public class SecuritySettings extends SettingsPreferenceFragment
            credentialStorageType.setSummary(storageSummaryRes);

            mResetCredentials = root.findPreference(KEY_RESET_CREDENTIALS);
        } else {
            removePreference(KEY_CREDENTIALS_MANAGER);
        }

        // Application install
        PreferenceGroup deviceAdminCategory= (PreferenceGroup)
@@ -252,7 +257,6 @@ public class SecuritySettings extends SettingsPreferenceFragment
                KEY_TOGGLE_INSTALL_APPLICATIONS);
        mToggleAppInstallation.setChecked(isNonMarketAppsAllowed());

        final UserManager um = (UserManager) getActivity().getSystemService(Context.USER_SERVICE);
        boolean isSideloadingAllowed =
                !um.hasUserRestriction(UserManager.DISALLOW_INSTALL_UNKNOWN_SOURCES);
        // Side loading of apps.
+2 −1
Original line number Diff line number Diff line
@@ -233,7 +233,8 @@ public class UserSettings extends SettingsPreferenceFragment

    @Override
    public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
        if (!mIsOwner) {
        UserManager um = (UserManager) getActivity().getSystemService(Context.USER_SERVICE);
        if (!mIsOwner && !um.hasUserRestriction(UserManager.DISALLOW_REMOVE_USER)) {
            String nickname = mUserManager.getUserName();
            MenuItem removeThisUser = menu.add(0, MENU_REMOVE_USER, 0,
                    getResources().getString(R.string.user_remove_user_menu, nickname));