Introduce boolean flags to show/hide Encryption status.

This adds one new flag:
config_show_encryption_and_credentials_encryption_status

Which when set to false, will hide Encryption status from Encryption &
credentials. This is when the storage is not being handed by Android,
and so this preference would not be necessarily correct.

Bug: 74127210
Test: Updated robotests
Change-Id: I13665fa369086ef29a4de5f99a78bfbaf96f2f6b
(cherry picked from commit 2d5df469d3)
This commit is contained in:
Ben Lin
2018-03-05 16:35:48 -08:00
parent defea95e1d
commit 1f61ff4cf9
4 changed files with 27 additions and 0 deletions

View File

@@ -41,6 +41,12 @@ public class EncryptionStatusPreferenceController extends BasePreferenceControll
@Override
public int getAvailabilityStatus() {
if (TextUtils.equals(getPreferenceKey(), PREF_KEY_ENCRYPTION_DETAIL_PAGE) &&
!mContext.getResources().getBoolean(
R.bool.config_show_encryption_and_credentials_encryption_status)) {
return DISABLED_UNSUPPORTED;
}
return mUserManager.isAdminUser() ? AVAILABLE : DISABLED_FOR_USER;
}