Schematize Crypto state system property

Properties accessed across partitions are now schematized and will
become APIs to make explicit interfaces among partitions.

Bug: 117924132
Test: m -j
Change-Id: I5df6145a436c38dd9fed4325b02ac37a801c2f5e
Merged-In: I957a8e37a88f7bb6d5007a36c02952d3539580fe
This commit is contained in:
Kiyoung Kim
2019-02-22 13:35:46 +09:00
parent 64bf0a791e
commit 7491e86e2b
2 changed files with 4 additions and 3 deletions

View File

@@ -63,7 +63,8 @@ public class FileEncryptionPreferenceController extends DeveloperOptionsPreferen
@Override
public void updateState(Preference preference) {
if (!TextUtils.equals("file", CryptoProperties.type().orElse("none"))) {
if (CryptoProperties.type().orElse(CryptoProperties.type_values.NONE) !=
CryptoProperties.type_values.FILE) {
return;
}

View File

@@ -91,7 +91,7 @@ public class FileEncryptionPreferenceControllerTest {
ReflectionHelpers.setField(mController, "mStorageManager", mStorageManager);
when(mStorageManager.isConvertibleToFBE()).thenReturn(true);
mController.displayPreference(mPreferenceScreen);
CryptoProperties.type("foobar");
CryptoProperties.type(CryptoProperties.type_values.NONE);
mController.updateState(mPreference);
@@ -105,7 +105,7 @@ public class FileEncryptionPreferenceControllerTest {
ReflectionHelpers.setField(mController, "mStorageManager", mStorageManager);
when(mStorageManager.isConvertibleToFBE()).thenReturn(true);
mController.displayPreference(mPreferenceScreen);
CryptoProperties.type("file");
CryptoProperties.type(CryptoProperties.type_values.FILE);
mController.updateState(mPreference);