Update Settings to use the proper DeviceConfig API.

Exempt-From-Owner-Approval: carry over approval from ag/6908306

bug:124769181

Change-Id: If18d0dc5e55dabf82b7c7a2b6df240fb8b24f736
This commit is contained in:
Svet Ganov
2019-04-05 19:00:05 -07:00
parent 6010c3a9a8
commit 864765f8b4
12 changed files with 45 additions and 206 deletions

View File

@@ -24,6 +24,7 @@ import android.provider.Settings;
import androidx.preference.Preference;
import androidx.preference.SwitchPreference;
import com.android.settings.Utils;
import com.android.settings.core.PreferenceControllerMixin;
import com.android.settingslib.development.DeveloperOptionsPreferenceController;
@@ -53,10 +54,8 @@ public class DeviceIdentifierAccessRestrictionsPreferenceController
public boolean isAvailable() {
// If the new access restrictions have been disabled from the server side then do not
// display the option.
boolean disabledFromServerSide = Boolean.parseBoolean(
DeviceConfig.getProperty(DeviceConfig.Privacy.NAMESPACE,
DeviceConfig.Privacy.
PROPERTY_DEVICE_IDENTIFIER_ACCESS_RESTRICTIONS_DISABLED));
boolean disabledFromServerSide = DeviceConfig.getBoolean(DeviceConfig.NAMESPACE_PRIVACY,
Utils.PROPERTY_DEVICE_IDENTIFIER_ACCESS_RESTRICTIONS_DISABLED, false);
return !disabledFromServerSide;
}