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
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 4e81b7a..d9b0adf 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -819,8 +819,10 @@
     <string name="encryption_and_credential_settings_title">Encryption &amp; credentials</string>
     <!-- Security Settings screen Encryption and crendential summary -->
     <string name="encryption_and_credential_settings_summary" product="default">Phone encrypted</string>
+    <string name="decryption_settings_summary" product="default">Phone not encrypted</string>
     <!-- Security Settings screen Encryption and crendential summary -->
     <string name="encryption_and_credential_settings_summary" product="tablet">Device encrypted</string>
+    <string name="decryption_settings_summary" product="tablet">Device not encrypted</string>
     <!-- Security Settings screen setting option title for the item to take you to the lock screen preference screen [CHAR LIMIT=60] -->
     <string name="lockscreen_settings_title">Lock screen preferences</string>
 
diff --git a/src/com/android/settings/security/EncryptionStatusPreferenceController.java b/src/com/android/settings/security/EncryptionStatusPreferenceController.java
index 0978935..2341248 100644
--- a/src/com/android/settings/security/EncryptionStatusPreferenceController.java
+++ b/src/com/android/settings/security/EncryptionStatusPreferenceController.java
@@ -56,7 +56,7 @@
             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 6f736b1..ee6d33a 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 @@
 
         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 @@
 
         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());