From f0c0320c82ab6c243596ede6b450dff5d1486df3 Mon Sep 17 00:00:00 2001 From: Ng Zhi An Date: Wed, 20 Sep 2017 17:51:28 -0700 Subject: [PATCH] Reflect device encryption status On the Settings & Location settings page, the encryption_and_credential preference will statically show "Phone encrypted" regardless of encryption status of phone. This change changes Settings to check for encryption status of the phone and update the summary as required. This requires adding a string saying that the device is not encrypted. And translations will have to happen after this is merged. Change-Id: I2f5bd281d8f1ed32801446fcdd453ebbaa04bd32 Bug: 65535239 Fixes: 65535239 Test: manual, I had a gobo phone that was not encrypted, made sure that it said "Phone not encrypted", then tap through to encrypt phone, and then check that it is now "Phone encrypted". --- src/com/android/settings/SecuritySettings.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/com/android/settings/SecuritySettings.java b/src/com/android/settings/SecuritySettings.java index 736b85c7612..55f21fd22a4 100644 --- a/src/com/android/settings/SecuritySettings.java +++ b/src/com/android/settings/SecuritySettings.java @@ -359,6 +359,15 @@ public class SecuritySettings extends SettingsPreferenceFragment getResources().getString(R.string.switch_on_text)); } + // Encryption status of device + if (LockPatternUtils.isDeviceEncryptionEnabled()) { + root.findPreference(KEY_ENCRYPTION_AND_CREDENTIALS).setSummary( + R.string.encryption_and_credential_settings_summary); + } else { + root.findPreference(KEY_ENCRYPTION_AND_CREDENTIALS).setSummary( + R.string.summary_placeholder); + } + // Show password mShowPassword = (SwitchPreference) root.findPreference(KEY_SHOW_PASSWORD);