diff options
author | Kenny Root <kroot@google.com> | 2013-03-29 14:36:30 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2013-03-29 14:36:30 -0700 |
commit | 265398ecb3fbacd1c93f097dbb11512770edb788 (patch) | |
tree | d7203b7a2cd424acc0d31e98d9b21245aadcbb3f | |
parent | a8a4373a0998ad302f8103210f00342999deaabf (diff) | |
parent | ab6a6645b01312816fe0688c76b5a26948252850 (diff) | |
download | packages_apps_Settings-265398ecb3fbacd1c93f097dbb11512770edb788.tar.gz packages_apps_Settings-265398ecb3fbacd1c93f097dbb11512770edb788.tar.bz2 packages_apps_Settings-265398ecb3fbacd1c93f097dbb11512770edb788.zip |
am ab6a6645: Merge "Add KeyStore storage type to Settings UI" into jb-mr2-dev
* commit 'ab6a6645b01312816fe0688c76b5a26948252850':
Add KeyStore storage type to Settings UI
-rw-r--r-- | res/values/strings.xml | 6 | ||||
-rw-r--r-- | res/xml/security_settings_misc.xml | 5 | ||||
-rw-r--r-- | src/com/android/settings/SecuritySettings.java | 13 |
3 files changed, 22 insertions, 2 deletions
diff --git a/res/values/strings.xml b/res/values/strings.xml index 7a427a5d5..3a18b3ae8 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -3529,6 +3529,12 @@ <string name="trusted_credentials">Trusted credentials</string> <!-- Summary of preference to display trusted credentials (aka CA certificates) [CHAR LIMIT=NONE] --> <string name="trusted_credentials_summary">Display trusted CA certificates</string> + <!-- Title of preference of what type of credential storage this device has: hardware or software [CHAR LIMIT=30] --> + <string name="credential_storage_type">Storage type</string> + <!-- Summary text for preference showing what type of credential storage this device has when it is stored in a hardware-backed storage (as opposed to "software only") [CHAR LIMIT=NONE] --> + <string name="credential_storage_type_hardware">Hardware-backed</string> + <!-- Summary text for preference showing what type of credential storage this device has when it is stored in software only (as opposed to "hardware-backed") [CHAR LIMIT=NONE] --> + <string name="credential_storage_type_software">Software only</string> <!-- Message to draw an unlock pattern when installing credentials --> <string name="credentials_install_gesture_prompt">Draw your unlock pattern</string> diff --git a/res/xml/security_settings_misc.xml b/res/xml/security_settings_misc.xml index ee87e515a..10fc98f2b 100644 --- a/res/xml/security_settings_misc.xml +++ b/res/xml/security_settings_misc.xml @@ -63,6 +63,11 @@ <PreferenceCategory android:key="credentials_management" android:title="@string/credentials_title" android:persistent="false"> + <Preference android:key="credential_storage_type" + android:title="@string/credential_storage_type" + style="?android:attr/preferenceInformationStyle" + android:persistent="false" /> + <Preference android:title="@string/trusted_credentials" android:summary="@string/trusted_credentials_summary" android:persistent="false" diff --git a/src/com/android/settings/SecuritySettings.java b/src/com/android/settings/SecuritySettings.java index 00a0e0945..971a19609 100644 --- a/src/com/android/settings/SecuritySettings.java +++ b/src/com/android/settings/SecuritySettings.java @@ -73,6 +73,7 @@ public class SecuritySettings extends SettingsPreferenceFragment // Misc Settings private static final String KEY_SIM_LOCK = "sim_lock"; private static final String KEY_SHOW_PASSWORD = "show_password"; + private static final String KEY_CREDENTIAL_STORAGE_TYPE = "credential_storage_type"; private static final String KEY_RESET_CREDENTIALS = "reset_credentials"; private static final String KEY_TOGGLE_INSTALL_APPLICATIONS = "toggle_install_applications"; private static final String KEY_TOGGLE_VERIFY_APPLICATIONS = "toggle_verify_applications"; @@ -91,6 +92,7 @@ public class SecuritySettings extends SettingsPreferenceFragment private CheckBoxPreference mShowPassword; + private KeyStore mKeyStore; private Preference mResetCredentials; private CheckBoxPreference mToggleAppInstallation; @@ -231,6 +233,14 @@ public class SecuritySettings extends SettingsPreferenceFragment // Credential storage, only for primary user if (mIsPrimary) { + 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); + mResetCredentials = root.findPreference(KEY_RESET_CREDENTIALS); } else { removePreference(KEY_CREDENTIALS_MANAGER); @@ -427,8 +437,7 @@ public class SecuritySettings extends SettingsPreferenceFragment } if (mResetCredentials != null) { - KeyStore keyStore = KeyStore.getInstance(); - mResetCredentials.setEnabled(!keyStore.isUnlocked()); + mResetCredentials.setEnabled(!mKeyStore.isUnlocked()); } } |