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

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

Respond to various API council feedback.

Handle many simple, smaller changes in a single CL.  Hide
CPC.closeQuietly(), now that it implements AutoCloseable.  Add more
details to CR.set/getCache() docs.  Add many @Nullable/@NonNull
annotations.

Bug: 124507578, 124447751, 124302519, 123697622
Bug: 123661322, 122887179, 122528742, 122527812, 116224797
Test: manual
Change-Id: Icee556a6ed76bbdf4c8e42b59d69d5580d461b95
parent c2b55eb9
Loading
Loading
Loading
Loading
+6 −10
Original line number Diff line number Diff line
@@ -9409,7 +9409,6 @@ package android.content {
    method @Nullable public android.os.Bundle call(@NonNull String, @NonNull String, @Nullable String, @Nullable android.os.Bundle) throws android.os.RemoteException;
    method @Nullable public final android.net.Uri canonicalize(@NonNull android.net.Uri) throws android.os.RemoteException;
    method public void close();
    method public static void closeQuietly(android.content.ContentProviderClient);
    method public int delete(@NonNull android.net.Uri, @Nullable String, @Nullable String[]) throws android.os.RemoteException;
    method @Nullable public android.content.ContentProvider getLocalContentProvider();
    method @Nullable public String[] getStreamTypes(@NonNull android.net.Uri, @NonNull String) throws android.os.RemoteException;
@@ -9593,10 +9592,10 @@ package android.content {
  public class ContentUris {
    ctor public ContentUris();
    method public static android.net.Uri.Builder appendId(android.net.Uri.Builder, long);
    method public static long parseId(android.net.Uri);
    method public static android.net.Uri removeId(android.net.Uri);
    method public static android.net.Uri withAppendedId(android.net.Uri, long);
    method @NonNull public static android.net.Uri.Builder appendId(@NonNull android.net.Uri.Builder, long);
    method public static long parseId(@NonNull android.net.Uri);
    method @NonNull public static android.net.Uri removeId(@NonNull android.net.Uri);
    method @NonNull public static android.net.Uri withAppendedId(@NonNull android.net.Uri, long);
  }
  public final class ContentValues implements android.os.Parcelable {
@@ -10223,8 +10222,7 @@ package android.content {
    field public static final String ACTION_MEDIA_NOFS = "android.intent.action.MEDIA_NOFS";
    field public static final String ACTION_MEDIA_REMOVED = "android.intent.action.MEDIA_REMOVED";
    field public static final String ACTION_MEDIA_SCANNER_FINISHED = "android.intent.action.MEDIA_SCANNER_FINISHED";
    field public static final String ACTION_MEDIA_SCANNER_SCAN_FILE = "android.intent.action.MEDIA_SCANNER_SCAN_FILE";
    field public static final String ACTION_MEDIA_SCANNER_SCAN_VOLUME = "android.intent.action.MEDIA_SCANNER_SCAN_VOLUME";
    field @Deprecated public static final String ACTION_MEDIA_SCANNER_SCAN_FILE = "android.intent.action.MEDIA_SCANNER_SCAN_FILE";
    field public static final String ACTION_MEDIA_SCANNER_STARTED = "android.intent.action.MEDIA_SCANNER_STARTED";
    field public static final String ACTION_MEDIA_SHARED = "android.intent.action.MEDIA_SHARED";
    field public static final String ACTION_MEDIA_UNMOUNTABLE = "android.intent.action.MEDIA_UNMOUNTABLE";
@@ -34607,11 +34605,9 @@ package android.os {
    ctor public FileUriExposedException(String);
  }
  public class FileUtils {
  public final class FileUtils {
    method public static void closeQuietly(@Nullable AutoCloseable);
    method public static void closeQuietly(@Nullable java.io.FileDescriptor);
    method public static long copy(@NonNull java.io.File, @NonNull java.io.File) throws java.io.IOException;
    method public static long copy(@NonNull java.io.File, @NonNull java.io.File, @Nullable android.os.CancellationSignal, @Nullable java.util.concurrent.Executor, @Nullable android.os.FileUtils.ProgressListener) throws java.io.IOException;
    method public static long copy(@NonNull java.io.InputStream, @NonNull java.io.OutputStream) throws java.io.IOException;
    method public static long copy(@NonNull java.io.InputStream, @NonNull java.io.OutputStream, @Nullable android.os.CancellationSignal, @Nullable java.util.concurrent.Executor, @Nullable android.os.FileUtils.ProgressListener) throws java.io.IOException;
    method public static long copy(@NonNull java.io.FileDescriptor, @NonNull java.io.FileDescriptor) throws java.io.IOException;
+2 −2
Original line number Diff line number Diff line
@@ -1300,9 +1300,9 @@ package android.content {
  }
  public abstract class ContentResolver {
    method public android.os.Bundle getCache(android.net.Uri);
    method @Nullable public android.os.Bundle getCache(@NonNull android.net.Uri);
    method public android.graphics.drawable.Drawable getTypeDrawable(String);
    method public void putCache(android.net.Uri, android.os.Bundle);
    method public void putCache(@NonNull android.net.Uri, @Nullable android.os.Bundle);
  }
  public abstract class Context {
+1 −1
Original line number Diff line number Diff line
@@ -1301,7 +1301,7 @@ package android.os {
    method public static java.io.File getStorageDirectory();
  }

  public class FileUtils {
  public final class FileUtils {
    method public static boolean contains(java.io.File, java.io.File);
  }

+3 −4
Original line number Diff line number Diff line
@@ -626,15 +626,14 @@ public class ContentProviderClient implements ContentInterface, AutoCloseable {
        return ContentProvider.coerceToLocalContentProvider(mContentProvider);
    }

    /**
     * Closes the given object quietly, ignoring any checked exceptions. Does
     * nothing if the given object is {@code null}.
     */
    /** {@hide} */
    @Deprecated
    public static void closeQuietly(ContentProviderClient client) {
        IoUtils.closeQuietly(client);
    }

    /** {@hide} */
    @Deprecated
    public static void releaseQuietly(ContentProviderClient client) {
        IoUtils.closeQuietly(client);
    }
+15 −11
Original line number Diff line number Diff line
@@ -3148,14 +3148,17 @@ public abstract class ContentResolver implements ContentInterface {
    }

    /**
     * Put the cache with the key.
     * Store the given {@link Bundle} as a long-lived cached object within the
     * system. This can be useful to avoid expensive re-parsing when apps are
     * restarted multiple times on low-RAM devices.
     * <p>
     * The {@link Bundle} is automatically invalidated when a
     * {@link #notifyChange(Uri, ContentObserver)} event applies to the key.
     *
     * @param key the key to add
     * @param value the value to add
     * {@hide}
     * @hide
     */
    @SystemApi
    public void putCache(Uri key, Bundle value) {
    public void putCache(@NonNull Uri key, @Nullable Bundle value) {
        try {
            getContentService().putCache(mContext.getPackageName(), key, value,
                    mContext.getUserId());
@@ -3165,15 +3168,16 @@ public abstract class ContentResolver implements ContentInterface {
    }

    /**
     * Get the cache with the key.
     * Retrieve the last {@link Bundle} stored as a long-lived cached object
     * within the system.
     *
     * @param key the key to get the value
     * @return the matched value. If the key doesn't exist, will return null.
     * @see #putCache(Uri, Bundle)
     * {@hide}
     * @return {@code null} if no cached object has been stored, or if the
     *         stored object has been invalidated due to a
     *         {@link #notifyChange(Uri, ContentObserver)} event.
     * @hide
     */
    @SystemApi
    public Bundle getCache(Uri key) {
    public @Nullable Bundle getCache(@NonNull Uri key) {
        try {
            final Bundle bundle = getContentService().getCache(mContext.getPackageName(), key,
                    mContext.getUserId());
Loading