Add isAvailable check to devOptionsController
- This avoids the null check for PreferenceControllers where isAvailable() is not always true Bug: 34203528 Test: make RunSettingsRoboTests -j40 Change-Id: Ibed8bc6a2a812355c521620d77fb571c1fd8a649
This commit is contained in:
@@ -122,12 +122,12 @@ public class OemUnlockPreferenceController extends DeveloperOptionsPreferenceCon
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDeveloperOptionsEnabled() {
|
||||
protected void onDeveloperOptionsSwitchEnabled() {
|
||||
handleDeveloperOptionsToggled();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDeveloperOptionsDisabled() {
|
||||
protected void onDeveloperOptionsSwitchDisabled() {
|
||||
handleDeveloperOptionsToggled();
|
||||
}
|
||||
|
||||
@@ -143,10 +143,6 @@ public class OemUnlockPreferenceController extends DeveloperOptionsPreferenceCon
|
||||
}
|
||||
|
||||
private void handleDeveloperOptionsToggled() {
|
||||
if (mPreference == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
mPreference.setEnabled(enableOemUnlockPreference());
|
||||
if (mPreference.isEnabled()) {
|
||||
// Check restriction, disable mEnableOemUnlock and apply policy transparency.
|
||||
|
Reference in New Issue
Block a user