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

Commit 7aa4821b authored by Matt Pape's avatar Matt Pape Committed by Android (Google) Code Review
Browse files

Merge "Annotate atomic DeviceConfig methods for testing."

parents cde70623 e8c4eda3
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -2514,10 +2514,12 @@ package android.provider {
    method @RequiresPermission("android.permission.READ_DEVICE_CONFIG") public static float getFloat(@NonNull String, @NonNull String, float);
    method @RequiresPermission("android.permission.READ_DEVICE_CONFIG") public static int getInt(@NonNull String, @NonNull String, int);
    method @RequiresPermission("android.permission.READ_DEVICE_CONFIG") public static long getLong(@NonNull String, @NonNull String, long);
    method @NonNull @RequiresPermission("android.permission.READ_DEVICE_CONFIG") public static android.provider.DeviceConfig.Properties getProperties(@NonNull String, @NonNull java.lang.String...);
    method @RequiresPermission("android.permission.READ_DEVICE_CONFIG") public static String getProperty(@NonNull String, @NonNull String);
    method @RequiresPermission("android.permission.READ_DEVICE_CONFIG") public static String getString(@NonNull String, @NonNull String, @Nullable String);
    method public static void removeOnPropertiesChangedListener(@NonNull android.provider.DeviceConfig.OnPropertiesChangedListener);
    method @RequiresPermission(android.Manifest.permission.WRITE_DEVICE_CONFIG) public static void resetToDefaults(int, @Nullable String);
    method @RequiresPermission(android.Manifest.permission.WRITE_DEVICE_CONFIG) public static boolean setProperties(@NonNull android.provider.DeviceConfig.Properties) throws android.provider.DeviceConfig.BadConfigException;
    method @RequiresPermission(android.Manifest.permission.WRITE_DEVICE_CONFIG) public static boolean setProperty(@NonNull String, @NonNull String, @Nullable String, boolean);
    field public static final String NAMESPACE_ANDROID = "android";
    field public static final String NAMESPACE_AUTOFILL = "autofill";
@@ -2529,6 +2531,10 @@ package android.provider {
    field public static final String NAMESPACE_ROLLBACK_BOOT = "rollback_boot";
  }

  public static class DeviceConfig.BadConfigException extends java.lang.Exception {
    ctor public DeviceConfig.BadConfigException();
  }

  public static interface DeviceConfig.OnPropertiesChangedListener {
    method public void onPropertiesChanged(@NonNull android.provider.DeviceConfig.Properties);
  }
+3 −0
Original line number Diff line number Diff line
@@ -424,6 +424,7 @@ public final class DeviceConfig {
     * @hide
     */
    @SystemApi
    @TestApi
    @NonNull
    @RequiresPermission(READ_DEVICE_CONFIG)
    public static Properties getProperties(@NonNull String namespace, @NonNull String ... names) {
@@ -593,6 +594,7 @@ public final class DeviceConfig {
     * @hide
     */
    @SystemApi
    @TestApi
    @RequiresPermission(WRITE_DEVICE_CONFIG)
    public static boolean setProperties(@NonNull Properties properties) throws BadConfigException {
        ContentResolver contentResolver = ActivityThread.currentApplication().getContentResolver();
@@ -817,6 +819,7 @@ public final class DeviceConfig {
     * @hide
     */
    @SystemApi
    @TestApi
    public static class BadConfigException extends Exception {}

    /**
+2 −0
Original line number Diff line number Diff line
@@ -2746,6 +2746,8 @@ public final class Settings {
        public ArrayMap<String, String> getStringsForPrefix(ContentResolver cr, String prefix,
                List<String> names) {
            String namespace = prefix.substring(0, prefix.length() - 1);
            DeviceConfig.enforceReadPermission(ActivityThread.currentApplication(), namespace);
            ArrayMap<String, String> keyValues = new ArrayMap<>();
            int currentGeneration = -1;