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

Commit d0d26958 authored by Jeff Sharkey's avatar Jeff Sharkey
Browse files

Hide "Pending" APIs based on feedback.

We've been advised that the current API design strategy is to
implement new APIs in the support library, and leave the core OS to
be bare minimal APIs.

Bug: 126636931
Test: atest cts/tests/tests/provider/src/android/provider/cts/MediaStore*
Change-Id: I9488f0fd789bab08cd376f86056badcbcfb6cc2e
parent ab864c6d
Loading
Loading
Loading
Loading
+1 −19
Original line number Diff line number Diff line
@@ -38405,14 +38405,12 @@ package android.provider {
  public final class MediaStore {
    ctor public MediaStore();
    method @NonNull public static android.net.Uri createPending(@NonNull android.content.Context, @NonNull android.provider.MediaStore.PendingParams);
    method @NonNull public static java.util.Set<java.lang.String> getAllVolumeNames(android.content.Context);
    method public static android.net.Uri getDocumentUri(android.content.Context, android.net.Uri);
    method public static android.net.Uri getMediaScannerUri();
    method public static android.net.Uri getMediaUri(android.content.Context, android.net.Uri);
    method public static String getVersion(android.content.Context);
    method @NonNull public static String getVolumeName(@NonNull android.net.Uri);
    method @NonNull public static android.provider.MediaStore.PendingSession openPending(@NonNull android.content.Context, @NonNull android.net.Uri);
    method @NonNull public static android.net.Uri setIncludePending(@NonNull android.net.Uri);
    method @NonNull public static android.net.Uri setRequireOriginal(@NonNull android.net.Uri);
    field public static final String ACTION_IMAGE_CAPTURE = "android.media.action.IMAGE_CAPTURE";
@@ -38685,6 +38683,7 @@ package android.provider {
  public static interface MediaStore.MediaColumns extends android.provider.BaseColumns {
    field @Deprecated public static final String DATA = "_data";
    field public static final String DATE_ADDED = "date_added";
    field public static final String DATE_EXPIRES = "date_expires";
    field public static final String DATE_MODIFIED = "date_modified";
    field public static final String DISPLAY_NAME = "_display_name";
    field public static final String DOCUMENT_ID = "document_id";
@@ -38701,23 +38700,6 @@ package android.provider {
    field public static final String WIDTH = "width";
  }
  public static class MediaStore.PendingParams {
    ctor public MediaStore.PendingParams(@NonNull android.net.Uri, @NonNull String, @NonNull String);
    method public void setDownloadUri(@Nullable android.net.Uri);
    method public void setPrimaryDirectory(@Nullable String);
    method public void setRefererUri(@Nullable android.net.Uri);
    method public void setSecondaryDirectory(@Nullable String);
  }
  public static class MediaStore.PendingSession implements java.lang.AutoCloseable {
    method public void abandon();
    method public void close();
    method public void notifyProgress(@IntRange(from=0, to=100) int);
    method @NonNull public android.os.ParcelFileDescriptor open() throws java.io.FileNotFoundException;
    method @NonNull public java.io.OutputStream openOutputStream() throws java.io.FileNotFoundException;
    method @NonNull public android.net.Uri publish();
  }
  public static final class MediaStore.Video {
    ctor public MediaStore.Video();
    method @Deprecated public static android.database.Cursor query(android.content.ContentResolver, android.net.Uri, String[]);
+19 −1
Original line number Diff line number Diff line
@@ -508,6 +508,8 @@ package android.provider {
  }

  public final class MediaStore {
    method @Deprecated @NonNull public static android.net.Uri createPending(@NonNull android.content.Context, @NonNull android.provider.MediaStore.PendingParams);
    method @Deprecated @NonNull public static android.provider.MediaStore.PendingSession openPending(@NonNull android.content.Context, @NonNull android.net.Uri);
    method @Deprecated @NonNull public static android.net.Uri setIncludeTrashed(@NonNull android.net.Uri);
    method @Deprecated public static void trash(@NonNull android.content.Context, @NonNull android.net.Uri);
    method @Deprecated public static void trash(@NonNull android.content.Context, @NonNull android.net.Uri, long);
@@ -515,11 +517,27 @@ package android.provider {
  }

  public static interface MediaStore.MediaColumns extends android.provider.BaseColumns {
    field @Deprecated public static final String DATE_EXPIRES = "date_expires";
    field @Deprecated public static final String HASH = "_hash";
    field @Deprecated public static final String IS_TRASHED = "is_trashed";
  }

  @Deprecated public static class MediaStore.PendingParams {
    ctor public MediaStore.PendingParams(@NonNull android.net.Uri, @NonNull String, @NonNull String);
    method public void setDownloadUri(@Nullable android.net.Uri);
    method public void setPrimaryDirectory(@Nullable String);
    method public void setRefererUri(@Nullable android.net.Uri);
    method public void setSecondaryDirectory(@Nullable String);
  }

  @Deprecated public static class MediaStore.PendingSession implements java.lang.AutoCloseable {
    method public void abandon();
    method public void close();
    method public void notifyProgress(@IntRange(from=0, to=100) int);
    method @NonNull public android.os.ParcelFileDescriptor open() throws java.io.FileNotFoundException;
    method @NonNull public java.io.OutputStream openOutputStream() throws java.io.FileNotFoundException;
    method @NonNull public android.net.Uri publish();
  }

  public static final class Settings.Global extends android.provider.Settings.NameValueTable {
    field @Deprecated public static final String CONTACT_METADATA_SYNC = "contact_metadata_sync";
  }
+18 −24
Original line number Diff line number Diff line
@@ -529,7 +529,6 @@ public final class MediaStore {
     *
     * @see MediaColumns#IS_PENDING
     * @see MediaStore#setIncludePending(Uri)
     * @see MediaStore#createPending(Context, PendingParams)
     */
    public static @NonNull Uri setIncludePending(@NonNull Uri uri) {
        return setIncludePending(uri.buildUpon()).build();
@@ -586,7 +585,9 @@ public final class MediaStore {
     * @see MediaColumns#IS_PENDING
     * @see MediaStore#setIncludePending(Uri)
     * @see MediaStore#createPending(Context, PendingParams)
     * @removed
     */
    @Deprecated
    public static @NonNull Uri createPending(@NonNull Context context,
            @NonNull PendingParams params) {
        return context.getContentResolver().insert(params.insertUri, params.insertValues);
@@ -599,14 +600,19 @@ public final class MediaStore {
     *
     * @param uri token which was previously returned from
     *            {@link #createPending(Context, PendingParams)}.
     * @removed
     */
    @Deprecated
    public static @NonNull PendingSession openPending(@NonNull Context context, @NonNull Uri uri) {
        return new PendingSession(context, uri);
    }

    /**
     * Parameters that describe a pending media item.
     *
     * @removed
     */
    @Deprecated
    public static class PendingParams {
        /** {@hide} */
        public final Uri insertUri;
@@ -711,7 +717,10 @@ public final class MediaStore {
     * expected to have a short lifetime, and owners should either
     * {@link PendingSession#publish()} or {@link PendingSession#abandon()} a
     * pending item within a few hours after first creating it.
     *
     * @removed
     */
    @Deprecated
    public static class PendingSession implements AutoCloseable {
        /** {@hide} */
        private final Context mContext;
@@ -976,9 +985,7 @@ public final class MediaStore {
         * Flag indicating if a media item is pending, and still being inserted
         * by its owner.
         *
         * @see MediaColumns#IS_PENDING
         * @see MediaStore#setIncludePending(Uri)
         * @see MediaStore#createPending(Context, PendingParams)
         */
        @Column(Cursor.FIELD_TYPE_INTEGER)
        public static final String IS_PENDING = "is_pending";
@@ -998,12 +1005,8 @@ public final class MediaStore {

        /**
         * The time the media item should be considered expired. Typically only
         * meaningful in the context of {@link #IS_PENDING} or
         * {@link #IS_TRASHED}.
         *
         * @removed
         * meaningful in the context of {@link #IS_PENDING}.
         */
        @Deprecated
        @CurrentTimeSecondsLong
        @Column(Cursor.FIELD_TYPE_INTEGER)
        public static final String DATE_EXPIRES = "date_expires";
@@ -1030,8 +1033,6 @@ public final class MediaStore {
        /**
         * The primary directory name this media exists under. The value may be
         * {@code NULL} if the media doesn't have a primary directory name.
         *
         * @see PendingParams#setPrimaryDirectory(String)
         */
        @Column(Cursor.FIELD_TYPE_STRING)
        public static final String PRIMARY_DIRECTORY = "primary_directory";
@@ -1039,8 +1040,6 @@ public final class MediaStore {
        /**
         * The secondary directory name this media exists under. The value may
         * be {@code NULL} if the media doesn't have a secondary directory name.
         *
         * @see PendingParams#setSecondaryDirectory(String)
         */
        @Column(Cursor.FIELD_TYPE_STRING)
        public static final String SECONDARY_DIRECTORY = "secondary_directory";
@@ -1292,12 +1291,7 @@ public final class MediaStore {
    }

    /**
     * Container for downloaded files.
     *
     * <p>
     * Querying for downloads from this table will return files contributed via
     * {@link PendingSession} and also ones which were downloaded using
     * {@link android.app.DownloadManager} APIs.
     * Collection of downloaded items.
     */
    public static final class Downloads implements DownloadColumns {
        private Downloads() {}
@@ -1620,9 +1614,9 @@ public final class MediaStore {
             * @param name The name of the image
             * @param description The description of the image
             * @return The URL to the newly created image
             * @deprecated inserting of images should be performed through
             *             {@link MediaStore#createPending(Context, PendingParams)},
             *             which offers richer control over lifecycle.
             * @deprecated inserting of images should be performed using
             *             {@link MediaColumns#IS_PENDING}, which offers richer
             *             control over lifecycle.
             */
            @Deprecated
            public static final String insertImage(ContentResolver cr, String imagePath,
@@ -1651,9 +1645,9 @@ public final class MediaStore {
             * @param description The description of the image
             * @return The URL to the newly created image, or <code>null</code> if the image failed to be stored
             *              for any reason.
             * @deprecated inserting of images should be performed through
             *             {@link MediaStore#createPending(Context, PendingParams)},
             *             which offers richer control over lifecycle.
             * @deprecated inserting of images should be performed using
             *             {@link MediaColumns#IS_PENDING}, which offers richer
             *             control over lifecycle.
             */
            @Deprecated
            public static final String insertImage(ContentResolver cr, Bitmap source,