From cc48b0104e4d81592055a578a33f2a59f29bf907 Mon Sep 17 00:00:00 2001 From: Kenny Root Date: Mon, 8 Apr 2013 09:56:05 -0700 Subject: [PATCH] Allow multiuser use of keystore Since keystore has been refactored to let muliple users use it simultaneously, we can remove all the restrictions put into place to prevent it. Bug: 7249554 Change-Id: I5aa069ca439cea68e87e141c497be8cd86b0ba9d --- .../android/settings/CredentialStorage.java | 7 ------- .../android/settings/SecuritySettings.java | 21 ++++++++----------- 2 files changed, 9 insertions(+), 19 deletions(-) diff --git a/src/com/android/settings/CredentialStorage.java b/src/com/android/settings/CredentialStorage.java index 1444a73070e..48c24f73369 100644 --- a/src/com/android/settings/CredentialStorage.java +++ b/src/com/android/settings/CredentialStorage.java @@ -25,7 +25,6 @@ import android.content.res.Resources; import android.os.AsyncTask; import android.os.Bundle; import android.os.RemoteException; -import android.os.UserHandle; import android.security.Credentials; import android.security.KeyChain.KeyChainConnection; import android.security.KeyChain; @@ -109,12 +108,6 @@ public final class CredentialStorage extends Activity { protected void onResume() { super.onResume(); - if (UserHandle.myUserId() != UserHandle.USER_OWNER) { - Log.i(TAG, "Cannot install to CredentialStorage as non-primary user"); - finish(); - return; - } - Intent intent = getIntent(); String action = intent.getAction(); diff --git a/src/com/android/settings/SecuritySettings.java b/src/com/android/settings/SecuritySettings.java index b521f8bbdb3..b3f7b21abea 100644 --- a/src/com/android/settings/SecuritySettings.java +++ b/src/com/android/settings/SecuritySettings.java @@ -231,21 +231,18 @@ public class SecuritySettings extends SettingsPreferenceFragment // Show password mShowPassword = (CheckBoxPreference) root.findPreference(KEY_SHOW_PASSWORD); - // Credential storage, only for primary user - if (mIsPrimary) { - mKeyStore = KeyStore.getInstance(); - Preference credentialStorageType = root.findPreference(KEY_CREDENTIAL_STORAGE_TYPE); + // Credential storage + mKeyStore = KeyStore.getInstance(); + Preference credentialStorageType = root.findPreference(KEY_CREDENTIAL_STORAGE_TYPE); - final int storageSummaryRes = - mKeyStore.isHardwareBacked() ? R.string.credential_storage_type_hardware - : R.string.credential_storage_type_software; - credentialStorageType.setSummary(storageSummaryRes); + final int storageSummaryRes = + mKeyStore.isHardwareBacked() ? R.string.credential_storage_type_hardware + : R.string.credential_storage_type_software; + credentialStorageType.setSummary(storageSummaryRes); - mResetCredentials = root.findPreference(KEY_RESET_CREDENTIALS); - } else { - removePreference(KEY_CREDENTIALS_MANAGER); - } + mResetCredentials = root.findPreference(KEY_RESET_CREDENTIALS); + // Application install mToggleAppInstallation = (CheckBoxPreference) findPreference( KEY_TOGGLE_INSTALL_APPLICATIONS); mToggleAppInstallation.setChecked(isNonMarketAppsAllowed());