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

@@ -67,6 +67,23 @@ public class EncryptionStatusPreferenceControllerTest {
assertThat(mController.isAvailable()).isFalse();
}
@Test
@Config(qualifiers = "mcc999")
public void isAvailable_notVisible_false() {
assertThat(mController.isAvailable()).isFalse();
}
@Test
@Config(qualifiers = "mcc999")
public void isAvailable_notVisible_butNotDetailPage_true() {
mController = new EncryptionStatusPreferenceController(mContext,
PREF_KEY_ENCRYPTION_SECURITY_PAGE);
UserManager userManager = (UserManager) mContext.getSystemService(Context.USER_SERVICE);
Shadows.shadowOf(userManager).setIsAdminUser(true);
assertThat(mController.isAvailable()).isTrue();
}
@Test
public void updateSummary_encrypted_shouldSayEncrypted() {
ShadowLockPatternUtils.setDeviceEncryptionEnabled(true);