Update Network & internet->Wi-Fi to use MasterSwitchPreference.
- Add a preference controller for Network & internet->Wi-Fi to control the preference toggling and summary update. - Refactor WifiSettings and WifiEnabler to share code between the new wifi preference controller and the wifi setting. - Refactor BluetoothSummaryHelper to have a common base class with the WifiSummaryHelper. - Rename the summary helper to summary updater. Bug: 34280769 Test: make RunSettingsRoboTests Change-Id: I00ebfc161bcef89331bb41ba405ed8cb8232d248
This commit is contained in:
@@ -17,6 +17,8 @@
|
||||
package com.android.settings.widget;
|
||||
|
||||
import android.support.v7.preference.Preference;
|
||||
import android.widget.Switch;
|
||||
import com.android.settingslib.RestrictedLockUtils.EnforcedAdmin;
|
||||
|
||||
/*
|
||||
* The switch controller that is used to update the switch widget in the MasterSwitchPreference
|
||||
@@ -67,4 +69,14 @@ public class MasterSwitchController extends SwitchWidgetController implements
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setDisabledByAdmin(EnforcedAdmin admin) {
|
||||
mPreference.setDisabledByAdmin(admin);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Switch getSwitch() {
|
||||
return mPreference.getSwitch();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user