Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fcb6aff1 authored by Michael Groover's avatar Michael Groover
Browse files

Change device ID developer setting to disable option

Bug: 123646983
Test: Manually verified toggling the option set the expected value
Change-Id: Ia219c154d9572111c4fce1af4128a103ba0409ec
parent 9285d84a
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -5851,9 +5851,9 @@
    <!-- 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>
    <!-- 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]-->
    <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 -->
+3 −3
Original line number Diff line number Diff line
@@ -50,12 +50,12 @@ public class DeviceIdentifierAccessRestrictionsPreferenceController
    private void writeSetting(boolean isEnabled) {
        DeviceConfig.setProperty(DeviceConfig.Privacy.NAMESPACE,
                DeviceConfig.Privacy.PROPERTY_DEVICE_IDENTIFIER_ACCESS_RESTRICTIONS_DISABLED,
                String.valueOf(!isEnabled), false);
                String.valueOf(isEnabled), false);
    }

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