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

Commit 19ea8a6a authored by Matt Pape's avatar Matt Pape
Browse files

Remove interface for Storage.

Per API council feedback, we are making changes to include only the
namespace in the system API defined in DeviceConfig.java. Strings which
define property names should be defined in code local to the feature
instead.

Bug: 126411407
Test: atest FrameworksCoreTests:DeviceConfigTest

Change-Id: I751254a183c8a9d150022d964539fb997c1d89fa
parent 09eb96c4
Loading
Loading
Loading
Loading
+1 −5
Original line number Diff line number Diff line
@@ -5881,6 +5881,7 @@ package android.provider {
    field public static final String NAMESPACE_RUNTIME_NATIVE = "runtime_native";
    field public static final String NAMESPACE_RUNTIME_NATIVE_BOOT = "runtime_native_boot";
    field public static final String NAMESPACE_SCHEDULER = "scheduler";
    field public static final String NAMESPACE_STORAGE = "storage";
    field public static final String NAMESPACE_SYSTEMUI = "systemui";
    field public static final String NAMESPACE_TEXTCLASSIFIER = "textclassifier";
  }
@@ -5909,11 +5910,6 @@ package android.provider {
    method @Nullable public String getString(@NonNull String, @Nullable String);
  }
  public static interface DeviceConfig.Storage {
    field public static final String ISOLATED_STORAGE_ENABLED = "isolated_storage_enabled";
    field public static final String NAMESPACE = "storage";
  }
  public static interface DeviceConfig.Telephony {
    field public static final String NAMESPACE = "telephony";
    field public static final String RAMPING_RINGER_DURATION = "ramping_ringer_duration";
+8 −17
Original line number Diff line number Diff line
@@ -224,6 +224,14 @@ public final class DeviceConfig {
    @SystemApi
    public static final String NAMESPACE_SCHEDULER = "scheduler";

    /**
     * Namespace for storage-related features.
     *
     * @hide
     */
    @SystemApi
    public static final String NAMESPACE_STORAGE = "storage";

    /**
     * Namespace for System UI related features.
     *
@@ -294,23 +302,6 @@ public final class DeviceConfig {
        String RAMPING_RINGER_VIBRATION_DURATION = "ramping_ringer_vibration_duration";
    }

    /**
     * Namespace for storage-related features.
     *
     * @hide
     */
    @SystemApi
    public interface Storage {
        String NAMESPACE = "storage";

        /**
         * If {@code 1}, enables the isolated storage feature. If {@code -1},
         * disables the isolated storage feature. If {@code 0}, uses the default
         * value from the build system.
         */
        String ISOLATED_STORAGE_ENABLED = "isolated_storage_enabled";
    }

    private static final Object sLock = new Object();
    @GuardedBy("sLock")
    private static ArrayMap<OnPropertyChangedListener, Pair<String, Executor>> sSingleListeners =
+9 −3
Original line number Diff line number Diff line
@@ -208,6 +208,13 @@ class StorageManagerService extends IStorageManager.Stub
    private static final boolean ENABLE_LEGACY_GREYLIST = SystemProperties
            .getBoolean(StorageManager.PROP_LEGACY_GREYLIST, true);

    /**
     * If {@code 1}, enables the isolated storage feature. If {@code -1},
     * disables the isolated storage feature. If {@code 0}, uses the default
     * value from the build system.
     */
    private static final String ISOLATED_STORAGE_ENABLED = "isolated_storage_enabled";

    public static class Lifecycle extends SystemService {
        private StorageManagerService mStorageManagerService;

@@ -797,7 +804,7 @@ class StorageManagerService extends IStorageManager.Stub
                }
            });
        // For now, simply clone property when it changes
        DeviceConfig.addOnPropertyChangedListener(DeviceConfig.Storage.NAMESPACE,
        DeviceConfig.addOnPropertyChangedListener(DeviceConfig.NAMESPACE_STORAGE,
                mContext.getMainExecutor(), (namespace, name, value) -> {
                    refreshIsolatedStorageSettings();
                });
@@ -837,8 +844,7 @@ class StorageManagerService extends IStorageManager.Stub
        // Always copy value from newer DeviceConfig location
        Settings.Global.putString(mResolver,
                Settings.Global.ISOLATED_STORAGE_REMOTE,
                DeviceConfig.getProperty(DeviceConfig.Storage.NAMESPACE,
                        DeviceConfig.Storage.ISOLATED_STORAGE_ENABLED));
                DeviceConfig.getProperty(DeviceConfig.NAMESPACE_STORAGE, ISOLATED_STORAGE_ENABLED));

        final int local = Settings.Global.getInt(mContext.getContentResolver(),
                Settings.Global.ISOLATED_STORAGE_LOCAL, 0);