Fix the availability of UseOpenWifiPreferenceController.
Right now, it crashes if mEnableUseWifiComponentName is disabled by the open wifi app. Bug: 150773571 Test: manual - along with ag/10741759, verified that disabling mEnableUseWifiComponentName hides the toggle instead of causing crash. Test: make RunSettingsRoboTests ROBOTEST_FILTER=UseOpenWifiPreferenceControllerTest Change-Id: I47e36fab411e4e4d1a23b7c91504139f124222e1
This commit is contained in:
@@ -100,6 +100,10 @@ public class UseOpenWifiPreferenceController extends TogglePreferenceController
|
||||
|
||||
@Override
|
||||
public int getAvailabilityStatus() {
|
||||
// It is possible that mEnableUseWifiComponentName is no longer enabled by
|
||||
// USE_OPEN_WIFI_PACKAGE. So update this component to reflect correct availability.
|
||||
updateEnableUseWifiComponentName();
|
||||
checkForFeatureSupportedScorers();
|
||||
return mDoFeatureSupportedScorersExist ? AVAILABLE : CONDITIONALLY_UNAVAILABLE;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user