Merge "Rename Enhanced MAC Randomization to Non-Persistent"

This commit is contained in:
Quang Luong
2021-07-09 14:55:57 +00:00
committed by Android (Google) Code Review
3 changed files with 24 additions and 24 deletions

View File

@@ -505,7 +505,7 @@ public class DevelopmentSettingsDashboardFragment extends RestrictedDashboardFra
controllers.add(new WifiDisplayCertificationPreferenceController(context));
controllers.add(new WifiVerboseLoggingPreferenceController(context));
controllers.add(new WifiScanThrottlingPreferenceController(context));
controllers.add(new WifiEnhancedMacRandomizationPreferenceController(context));
controllers.add(new WifiNonPersistentMacRandomizationPreferenceController(context));
controllers.add(new MobileDataAlwaysOnPreferenceController(context));
controllers.add(new TetheringHardwareAccelPreferenceController(context));
controllers.add(new BluetoothDeviceNoNamePreferenceController(context));

View File

@@ -26,30 +26,30 @@ import com.android.settings.core.PreferenceControllerMixin;
import com.android.settingslib.development.DeveloperOptionsPreferenceController;
/**
* Developer option controller for enhanced MAC randomization.
* Developer option controller for non-persistent MAC randomization.
*/
public class WifiEnhancedMacRandomizationPreferenceController
public class WifiNonPersistentMacRandomizationPreferenceController
extends DeveloperOptionsPreferenceController
implements Preference.OnPreferenceChangeListener, PreferenceControllerMixin {
private static final String WIFI_ENHANCED_MAC_RANDOMIZATION_KEY =
"wifi_enhanced_mac_randomization";
private static final String ENHANCED_MAC_RANDOMIZATION_FEATURE_FLAG =
"enhanced_mac_randomization_force_enabled";
private static final String WIFI_NON_PERSISTENT_MAC_RANDOMIZATION_KEY =
"wifi_non_persistent_mac_randomization";
private static final String NON_PERSISTENT_MAC_RANDOMIZATION_FEATURE_FLAG =
"non_persistent_mac_randomization_force_enabled";
public WifiEnhancedMacRandomizationPreferenceController(Context context) {
public WifiNonPersistentMacRandomizationPreferenceController(Context context) {
super(context);
}
@Override
public String getPreferenceKey() {
return WIFI_ENHANCED_MAC_RANDOMIZATION_KEY;
return WIFI_NON_PERSISTENT_MAC_RANDOMIZATION_KEY;
}
@Override
public boolean onPreferenceChange(Preference preference, Object newValue) {
int isEnabledInt = ((Boolean) newValue) ? 1 : 0;
Settings.Global.putInt(mContext.getContentResolver(),
ENHANCED_MAC_RANDOMIZATION_FEATURE_FLAG, isEnabledInt);
NON_PERSISTENT_MAC_RANDOMIZATION_FEATURE_FLAG, isEnabledInt);
return true;
}
@@ -57,7 +57,7 @@ public class WifiEnhancedMacRandomizationPreferenceController
public void updateState(Preference preference) {
boolean enabled = false;
if (Settings.Global.getInt(mContext.getContentResolver(),
ENHANCED_MAC_RANDOMIZATION_FEATURE_FLAG, 0) == 1) {
NON_PERSISTENT_MAC_RANDOMIZATION_FEATURE_FLAG, 0) == 1) {
enabled = true;
}
((SwitchPreference) mPreference).setChecked(enabled);
@@ -67,7 +67,7 @@ public class WifiEnhancedMacRandomizationPreferenceController
protected void onDeveloperOptionsSwitchDisabled() {
super.onDeveloperOptionsSwitchDisabled();
Settings.Global.putInt(mContext.getContentResolver(),
ENHANCED_MAC_RANDOMIZATION_FEATURE_FLAG, 0);
NON_PERSISTENT_MAC_RANDOMIZATION_FEATURE_FLAG, 0);
((SwitchPreference) mPreference).setChecked(false);
}
}