Merge "Change device ID developer setting to disable option"

This commit is contained in:
Michael Groover
2019-02-07 00:03:59 +00:00
committed by Android (Google) Code Review
2 changed files with 5 additions and 5 deletions

View File

@@ -5857,9 +5857,9 @@
<!-- Summary for whether to enable SMS access restriction [CHAR LIMIT=NONE]--> <!-- Summary for whether to enable SMS access restriction [CHAR LIMIT=NONE]-->
<string name="sms_access_restriction_enabled_summary">Only default phone and messaging apps have SMS &amp; call log permissions</string> <string name="sms_access_restriction_enabled_summary">Only default phone and messaging apps have SMS &amp; call log permissions</string>
<!-- Title for the new device identifier access restrictions [CHAR LIMIT=50]--> <!-- Title for the new device identifier access restrictions [CHAR LIMIT=50]-->
<string name="device_identifier_access_restrictions_title">Enable device identifier restrictions</string> <string name="device_identifier_access_restrictions_title">Disable device identifier restrictions</string>
<!-- Summary for the new device identifier access restrictions [CHAR LIMIT=NONE]--> <!-- Summary for the new device identifier access restrictions [CHAR LIMIT=NONE]-->
<string name="device_identifier_access_restrictions_summary">Enable the new access restrictions for device identifiers.</string> <string name="device_identifier_access_restrictions_summary">Disable the new access restrictions for device identifiers</string>
<!-- Message when there are no available trust agents to display --> <!-- Message when there are no available trust agents to display -->

View File

@@ -50,12 +50,12 @@ public class DeviceIdentifierAccessRestrictionsPreferenceController
private void writeSetting(boolean isEnabled) { private void writeSetting(boolean isEnabled) {
DeviceConfig.setProperty(DeviceConfig.Privacy.NAMESPACE, DeviceConfig.setProperty(DeviceConfig.Privacy.NAMESPACE,
DeviceConfig.Privacy.PROPERTY_DEVICE_IDENTIFIER_ACCESS_RESTRICTIONS_DISABLED, DeviceConfig.Privacy.PROPERTY_DEVICE_IDENTIFIER_ACCESS_RESTRICTIONS_DISABLED,
String.valueOf(!isEnabled), false); String.valueOf(isEnabled), false);
} }
@Override @Override
public void updateState(Preference preference) { public void updateState(Preference preference) {
boolean isEnabled = !Boolean.parseBoolean( boolean isEnabled = Boolean.parseBoolean(
DeviceConfig.getProperty(DeviceConfig.Privacy.NAMESPACE, DeviceConfig.getProperty(DeviceConfig.Privacy.NAMESPACE,
DeviceConfig.Privacy.PROPERTY_DEVICE_IDENTIFIER_ACCESS_RESTRICTIONS_DISABLED)); DeviceConfig.Privacy.PROPERTY_DEVICE_IDENTIFIER_ACCESS_RESTRICTIONS_DISABLED));
((SwitchPreference) mPreference).setChecked(isEnabled); ((SwitchPreference) mPreference).setChecked(isEnabled);
@@ -64,7 +64,7 @@ public class DeviceIdentifierAccessRestrictionsPreferenceController
@Override @Override
protected void onDeveloperOptionsSwitchDisabled() { protected void onDeveloperOptionsSwitchDisabled() {
super.onDeveloperOptionsSwitchDisabled(); super.onDeveloperOptionsSwitchDisabled();
writeSetting(true); writeSetting(false);
((SwitchPreference) mPreference).setChecked(true); ((SwitchPreference) mPreference).setChecked(true);
} }
} }