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

Commit 179d6b3f authored by Jeff Sharkey's avatar Jeff Sharkey
Browse files

Deprecate storage "low" and "ok" broadcasts.

These broadcasts resulted in a terrible user experience where dozens
of apps would wake up and try deleting everything they possibly can,
meaning that we'd thrash between showing/hiding the low space
notification to users.

Instead, if apps have data that they're okay being purged when the
system is chronically low on space, we want to strongly encourage
them to rely on the much-improved getCacheDir() behaviors in OC.

Test: builds, boots
Bug: 35406598
Change-Id: I74abfba1b8d3948363b79f8b66ca0ad60faac756
parent 51673a50
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -9269,8 +9269,8 @@ package android.content {
    field public static final java.lang.String ACTION_DATE_CHANGED = "android.intent.action.DATE_CHANGED";
    field public static final java.lang.String ACTION_DEFAULT = "android.intent.action.VIEW";
    field public static final java.lang.String ACTION_DELETE = "android.intent.action.DELETE";
    field public static final java.lang.String ACTION_DEVICE_STORAGE_LOW = "android.intent.action.DEVICE_STORAGE_LOW";
    field public static final java.lang.String ACTION_DEVICE_STORAGE_OK = "android.intent.action.DEVICE_STORAGE_OK";
    field public static final deprecated java.lang.String ACTION_DEVICE_STORAGE_LOW = "android.intent.action.DEVICE_STORAGE_LOW";
    field public static final deprecated java.lang.String ACTION_DEVICE_STORAGE_OK = "android.intent.action.DEVICE_STORAGE_OK";
    field public static final java.lang.String ACTION_DIAL = "android.intent.action.DIAL";
    field public static final java.lang.String ACTION_DOCK_EVENT = "android.intent.action.DOCK_EVENT";
    field public static final java.lang.String ACTION_DREAMING_STARTED = "android.intent.action.DREAMING_STARTED";
+2 −2
Original line number Diff line number Diff line
@@ -9791,8 +9791,8 @@ package android.content {
    field public static final java.lang.String ACTION_DATE_CHANGED = "android.intent.action.DATE_CHANGED";
    field public static final java.lang.String ACTION_DEFAULT = "android.intent.action.VIEW";
    field public static final java.lang.String ACTION_DELETE = "android.intent.action.DELETE";
    field public static final java.lang.String ACTION_DEVICE_STORAGE_LOW = "android.intent.action.DEVICE_STORAGE_LOW";
    field public static final java.lang.String ACTION_DEVICE_STORAGE_OK = "android.intent.action.DEVICE_STORAGE_OK";
    field public static final deprecated java.lang.String ACTION_DEVICE_STORAGE_LOW = "android.intent.action.DEVICE_STORAGE_LOW";
    field public static final deprecated java.lang.String ACTION_DEVICE_STORAGE_OK = "android.intent.action.DEVICE_STORAGE_OK";
    field public static final java.lang.String ACTION_DIAL = "android.intent.action.DIAL";
    field public static final java.lang.String ACTION_DOCK_EVENT = "android.intent.action.DOCK_EVENT";
    field public static final java.lang.String ACTION_DREAMING_STARTED = "android.intent.action.DREAMING_STARTED";
+2 −2
Original line number Diff line number Diff line
@@ -9299,8 +9299,8 @@ package android.content {
    field public static final java.lang.String ACTION_DATE_CHANGED = "android.intent.action.DATE_CHANGED";
    field public static final java.lang.String ACTION_DEFAULT = "android.intent.action.VIEW";
    field public static final java.lang.String ACTION_DELETE = "android.intent.action.DELETE";
    field public static final java.lang.String ACTION_DEVICE_STORAGE_LOW = "android.intent.action.DEVICE_STORAGE_LOW";
    field public static final java.lang.String ACTION_DEVICE_STORAGE_OK = "android.intent.action.DEVICE_STORAGE_OK";
    field public static final deprecated java.lang.String ACTION_DEVICE_STORAGE_LOW = "android.intent.action.DEVICE_STORAGE_LOW";
    field public static final deprecated java.lang.String ACTION_DEVICE_STORAGE_OK = "android.intent.action.DEVICE_STORAGE_OK";
    field public static final java.lang.String ACTION_DIAL = "android.intent.action.DIAL";
    field public static final java.lang.String ACTION_DOCK_EVENT = "android.intent.action.DOCK_EVENT";
    field public static final java.lang.String ACTION_DREAMING_STARTED = "android.intent.action.DREAMING_STARTED";
+48 −20
Original line number Diff line number Diff line
@@ -40,6 +40,7 @@ import android.os.ResultReceiver;
import android.os.ShellCommand;
import android.os.StrictMode;
import android.os.UserHandle;
import android.os.storage.StorageManager;
import android.provider.DocumentsContract;
import android.provider.DocumentsProvider;
import android.provider.MediaStore;
@@ -2443,45 +2444,72 @@ public class Intent implements Parcelable, Cloneable {
     */
    public static final String ACTION_REQUEST_SHUTDOWN = "android.intent.action.ACTION_REQUEST_SHUTDOWN";
    /**
     * Broadcast Action:  A sticky broadcast that indicates low memory
     * Broadcast Action: A sticky broadcast that indicates low storage space
     * condition on the device
     * <p class="note">
     * This is a protected intent that can only be sent by the system.
     *
     * <p class="note">This is a protected intent that can only be sent
     * by the system.
     * @deprecated if your app targets {@link android.os.Build.VERSION_CODES#O}
     *             or above, this broadcast will no longer be delivered to any
     *             {@link BroadcastReceiver} defined in your manifest. Instead,
     *             apps are strongly encouraged to use the improved
     *             {@link Context#getCacheDir()} behavior so the system can
     *             automatically free up storage when needed.
     */
    @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
    @Deprecated
    public static final String ACTION_DEVICE_STORAGE_LOW = "android.intent.action.DEVICE_STORAGE_LOW";
    /**
     * Broadcast Action:  Indicates low memory condition on the device no longer exists
     * Broadcast Action: Indicates low storage space condition on the device no
     * longer exists
     * <p class="note">
     * This is a protected intent that can only be sent by the system.
     *
     * <p class="note">This is a protected intent that can only be sent
     * by the system.
     * @deprecated if your app targets {@link android.os.Build.VERSION_CODES#O}
     *             or above, this broadcast will no longer be delivered to any
     *             {@link BroadcastReceiver} defined in your manifest. Instead,
     *             apps are strongly encouraged to use the improved
     *             {@link Context#getCacheDir()} behavior so the system can
     *             automatically free up storage when needed.
     */
    @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
    @Deprecated
    public static final String ACTION_DEVICE_STORAGE_OK = "android.intent.action.DEVICE_STORAGE_OK";
    /**
     * Broadcast Action:  A sticky broadcast that indicates a memory full
     * condition on the device. This is intended for activities that want
     * to be able to fill the data partition completely, leaving only
     * enough free space to prevent system-wide SQLite failures.
     *
     * <p class="note">This is a protected intent that can only be sent
     * by the system.
     * Broadcast Action: A sticky broadcast that indicates a storage space full
     * condition on the device. This is intended for activities that want to be
     * able to fill the data partition completely, leaving only enough free
     * space to prevent system-wide SQLite failures.
     * <p class="note">
     * This is a protected intent that can only be sent by the system.
     *
     * {@hide}
     * @deprecated if your app targets {@link android.os.Build.VERSION_CODES#O}
     *             or above, this broadcast will no longer be delivered to any
     *             {@link BroadcastReceiver} defined in your manifest. Instead,
     *             apps are strongly encouraged to use the improved
     *             {@link Context#getCacheDir()} behavior so the system can
     *             automatically free up storage when needed.
     * @hide
     */
    @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
    @Deprecated
    public static final String ACTION_DEVICE_STORAGE_FULL = "android.intent.action.DEVICE_STORAGE_FULL";
    /**
     * Broadcast Action:  Indicates memory full condition on the device
     * no longer exists.
     *
     * <p class="note">This is a protected intent that can only be sent
     * by the system.
     * Broadcast Action: Indicates storage space full condition on the device no
     * longer exists.
     * <p class="note">
     * This is a protected intent that can only be sent by the system.
     *
     * {@hide}
     * @deprecated if your app targets {@link android.os.Build.VERSION_CODES#O}
     *             or above, this broadcast will no longer be delivered to any
     *             {@link BroadcastReceiver} defined in your manifest. Instead,
     *             apps are strongly encouraged to use the improved
     *             {@link Context#getCacheDir()} behavior so the system can
     *             automatically free up storage when needed.
     * @hide
     */
    @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
    @Deprecated
    public static final String ACTION_DEVICE_STORAGE_NOT_FULL = "android.intent.action.DEVICE_STORAGE_NOT_FULL";
    /**
     * Broadcast Action:  Indicates low memory condition notification acknowledged by user