Move OemUnlockPreferenceControllerTest to sdk 26

Test: make RunSettingsRoboTests -j40
Change-Id: I25d96c82bd99c5c7adba6b6269f1a5735b22ca5b
This commit is contained in:
jeffreyhuang
2017-11-28 11:56:57 -08:00
parent 6a68f306d7
commit 0545d6e7d7
2 changed files with 27 additions and 10 deletions

View File

@@ -98,7 +98,7 @@ public class OemUnlockPreferenceController extends DeveloperOptionsPreferenceCon
@Override
public void updateState(Preference preference) {
super.updateState(preference);
mPreference.setChecked(mOemLockManager.isOemUnlockAllowed());
mPreference.setChecked(isOemUnlockedAllowed());
updateOemUnlockSettingDescription();
// Showing mEnableOemUnlock preference as device has persistent data block.
mPreference.setDisabledByAdmin(null);
@@ -183,7 +183,8 @@ public class OemUnlockPreferenceController extends DeveloperOptionsPreferenceCon
/**
* Returns {@code true} if the bootloader has been unlocked. Otherwise, returns {code false}.
*/
private boolean isBootloaderUnlocked() {
@VisibleForTesting
boolean isBootloaderUnlocked() {
return mOemLockManager.isDeviceOemUnlocked();
}
@@ -216,4 +217,9 @@ public class OemUnlockPreferenceController extends DeveloperOptionsPreferenceCon
userHandle);
}
@VisibleForTesting
boolean isOemUnlockedAllowed() {
return mOemLockManager.isOemUnlockAllowed();
}
}