From d2a8b1ff021bd9bdee0ab49a7d1610302e640dc5 Mon Sep 17 00:00:00 2001 From: Alex Cruz Date: Fri, 20 Oct 2017 19:26:58 -0400 Subject: [PATCH] Change encryption preference's summary accordingly With this change a summary to the encryption preference was added. https://android.googlesource.com/platform/packages/apps/Settings/+/415ce9a77d44732966fbab641d1ecaa8e8688381 The problem is that even if you're not encrypted, it says that your phone is. Is very misleading to the user that don't bother to enter the actual preference and want to see if they are. This fixes that. This is cherry-picked from https://android-review.googlesource.com/#/c/platform/packages/apps/Settings/+/517875/ Test: Go into Settings/Security & Location Fixes: 68691666 Fixes: 68542516 Change-Id: Iaeaffd340f2e248748f244a947aa71eb8ad4ab94 --- res/values/strings.xml | 2 ++ .../security/EncryptionStatusPreferenceController.java | 2 +- .../security/EncryptionStatusPreferenceControllerTest.java | 4 ++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/res/values/strings.xml b/res/values/strings.xml index 4e81b7a129c..d9b0adf8ca0 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -819,8 +819,10 @@ Encryption & credentials Phone encrypted + Phone not encrypted Device encrypted + Device not encrypted Lock screen preferences diff --git a/src/com/android/settings/security/EncryptionStatusPreferenceController.java b/src/com/android/settings/security/EncryptionStatusPreferenceController.java index 0978935a49b..234124827b5 100644 --- a/src/com/android/settings/security/EncryptionStatusPreferenceController.java +++ b/src/com/android/settings/security/EncryptionStatusPreferenceController.java @@ -56,7 +56,7 @@ public class EncryptionStatusPreferenceController extends BasePreferenceControll if (TextUtils.equals(getPreferenceKey(), PREF_KEY_ENCRYPTION_DETAIL_PAGE)) { preference.setFragment(CryptKeeperSettings.class.getName()); } - preference.setSummary(R.string.summary_placeholder); + preference.setSummary(R.string.decryption_settings_summary); } } diff --git a/tests/robotests/src/com/android/settings/security/EncryptionStatusPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/security/EncryptionStatusPreferenceControllerTest.java index 6f736b1246e..ee6d33aace0 100644 --- a/tests/robotests/src/com/android/settings/security/EncryptionStatusPreferenceControllerTest.java +++ b/tests/robotests/src/com/android/settings/security/EncryptionStatusPreferenceControllerTest.java @@ -84,7 +84,7 @@ public class EncryptionStatusPreferenceControllerTest { mController.updateState(mPreference); - final CharSequence summary = mContext.getText(R.string.summary_placeholder); + final CharSequence summary = mContext.getText(R.string.decryption_settings_summary); assertThat(mPreference.getSummary()).isEqualTo(summary); assertThat(mController.getPreferenceKey()).isNotEqualTo(PREF_KEY_ENCRYPTION_SECURITY_PAGE); assertThat(mPreference.getFragment()).isEqualTo(CryptKeeperSettings.class.getName()); @@ -98,7 +98,7 @@ public class EncryptionStatusPreferenceControllerTest { mController.updateState(mPreference); - final CharSequence summary = mContext.getText(R.string.summary_placeholder); + final CharSequence summary = mContext.getText(R.string.decryption_settings_summary); assertThat(mPreference.getSummary()).isEqualTo(summary); assertThat(mPreference.getFragment()).isNotEqualTo(CryptKeeperSettings.class.getName());