Loading api/current.txt +13 −2 Original line number Diff line number Diff line Loading @@ -9504,6 +9504,7 @@ package android.content { method public void dump(java.io.FileDescriptor, java.io.PrintWriter, String[]); method @Nullable public final String getCallingFeatureId(); method @Nullable public final String getCallingPackage(); method @Nullable public final String getCallingPackageUnchecked(); method @Nullable public final android.content.Context getContext(); method @Nullable public final android.content.pm.PathPermission[] getPathPermissions(); method @Nullable public final String getReadPermission(); Loading @@ -9513,6 +9514,7 @@ package android.content { method @Nullable public abstract android.net.Uri insert(@NonNull android.net.Uri, @Nullable android.content.ContentValues); method @Nullable public android.net.Uri insert(@NonNull android.net.Uri, @Nullable android.content.ContentValues, @Nullable android.os.Bundle); method protected boolean isTemporary(); method public void onCallingPackageChanged(); method public void onConfigurationChanged(android.content.res.Configuration); method public abstract boolean onCreate(); method public void onLowMemory(); Loading Loading @@ -9627,13 +9629,13 @@ package android.content { ctor public ContentProviderResult(@NonNull android.net.Uri); ctor public ContentProviderResult(int); ctor public ContentProviderResult(@NonNull android.os.Bundle); ctor public ContentProviderResult(@NonNull Exception); ctor public ContentProviderResult(@NonNull Throwable); ctor public ContentProviderResult(android.os.Parcel); method public int describeContents(); method public void writeToParcel(android.os.Parcel, int); field @NonNull public static final android.os.Parcelable.Creator<android.content.ContentProviderResult> CREATOR; field @Nullable public final Integer count; field @Nullable public final Exception exception; field @Nullable public final Throwable exception; field @Nullable public final android.os.Bundle extras; field @Nullable public final android.net.Uri uri; } Loading Loading @@ -13324,6 +13326,7 @@ package android.database.sqlite { method @Deprecated public String buildUnionSubQuery(String, String[], java.util.Set<java.lang.String>, int, String, String, String[], String, String); method public int delete(@NonNull android.database.sqlite.SQLiteDatabase, @Nullable String, @Nullable String[]); method @Nullable public android.database.sqlite.SQLiteDatabase.CursorFactory getCursorFactory(); method @Nullable public java.util.Collection<java.util.regex.Pattern> getProjectionGreylist(); method @Nullable public java.util.Map<java.lang.String,java.lang.String> getProjectionMap(); method @Nullable public String getTables(); method public long insert(@NonNull android.database.sqlite.SQLiteDatabase, @NonNull android.content.ContentValues); Loading @@ -13336,6 +13339,7 @@ package android.database.sqlite { method public android.database.Cursor query(android.database.sqlite.SQLiteDatabase, String[], String, String[], String, String, String, String, android.os.CancellationSignal); method public void setCursorFactory(@Nullable android.database.sqlite.SQLiteDatabase.CursorFactory); method public void setDistinct(boolean); method public void setProjectionGreylist(@Nullable java.util.Collection<java.util.regex.Pattern>); method public void setProjectionMap(@Nullable java.util.Map<java.lang.String,java.lang.String>); method public void setStrict(boolean); method public void setStrictColumns(boolean); Loading Loading @@ -36389,15 +36393,22 @@ package android.os.storage { method public boolean isObbMounted(String); method public boolean mountObb(String, String, android.os.storage.OnObbStateChangeListener); method @NonNull public android.os.ParcelFileDescriptor openProxyFileDescriptor(int, android.os.ProxyFileDescriptorCallback, android.os.Handler) throws java.io.IOException; method public void registerStorageVolumeCallback(@NonNull java.util.concurrent.Executor, @NonNull android.os.storage.StorageManager.StorageVolumeCallback); method public void setCacheBehaviorGroup(java.io.File, boolean) throws java.io.IOException; method public void setCacheBehaviorTombstone(java.io.File, boolean) throws java.io.IOException; method public boolean unmountObb(String, boolean, android.os.storage.OnObbStateChangeListener); method public void unregisterStorageVolumeCallback(@NonNull android.os.storage.StorageManager.StorageVolumeCallback); field public static final String ACTION_MANAGE_STORAGE = "android.os.storage.action.MANAGE_STORAGE"; field public static final String EXTRA_REQUESTED_BYTES = "android.os.storage.extra.REQUESTED_BYTES"; field public static final String EXTRA_UUID = "android.os.storage.extra.UUID"; field public static final java.util.UUID UUID_DEFAULT; } public static class StorageManager.StorageVolumeCallback { ctor public StorageManager.StorageVolumeCallback(); method public void onStateChanged(@NonNull android.os.storage.StorageVolume); } public final class StorageVolume implements android.os.Parcelable { method @Deprecated @Nullable public android.content.Intent createAccessIntent(String); method @NonNull public android.content.Intent createOpenDocumentTreeIntent(); api/system-current.txt +15 −0 Original line number Diff line number Diff line Loading @@ -567,6 +567,7 @@ package android.app { } public class DownloadManager { method @RequiresPermission(android.Manifest.permission.WRITE_MEDIA_STORAGE) public void onMediaStoreDownloadsDeleted(@NonNull android.util.LongSparseArray<java.lang.String>); field public static final String ACTION_DOWNLOAD_COMPLETED = "android.intent.action.DOWNLOAD_COMPLETED"; } Loading Loading @@ -1654,11 +1655,17 @@ package android.content { method @NonNull public final android.os.UserHandle getSendingUser(); } public abstract class ContentProvider implements android.content.ComponentCallbacks2 { method public int checkUriPermission(@NonNull android.net.Uri, int, int); } public class ContentProviderClient implements java.lang.AutoCloseable { method @RequiresPermission(android.Manifest.permission.REMOVE_TASKS) public void setDetectNotResponding(long); } public abstract class ContentResolver { method @NonNull public static android.net.Uri decodeFromFile(@NonNull java.io.File); method @NonNull public static java.io.File encodeToFile(@NonNull android.net.Uri); method @Nullable @RequiresPermission("android.permission.CACHE_CONTENT") public android.os.Bundle getCache(@NonNull android.net.Uri); method @RequiresPermission("android.permission.CACHE_CONTENT") public void putCache(@NonNull android.net.Uri, @Nullable android.os.Bundle); } Loading Loading @@ -6974,6 +6981,10 @@ package android.os { method public boolean hasSingleFileDescriptor(); } public class ParcelFileDescriptor implements java.io.Closeable android.os.Parcelable { method @NonNull public static android.os.ParcelFileDescriptor wrap(@NonNull android.os.ParcelFileDescriptor, @NonNull android.os.Handler, @NonNull android.os.ParcelFileDescriptor.OnCloseListener) throws java.io.IOException; } public final class PowerManager { method @RequiresPermission(allOf={android.Manifest.permission.READ_DREAM_STATE, android.Manifest.permission.WRITE_DREAM_STATE}) public void dream(long); method @RequiresPermission(android.Manifest.permission.DEVICE_POWER) public boolean forceSuspend(); Loading Loading @@ -7377,6 +7388,10 @@ package android.os.storage { field @RequiresPermission(android.Manifest.permission.ALLOCATE_AGGRESSIVE) public static final int FLAG_ALLOCATE_AGGRESSIVE = 1; // 0x1 } public final class StorageVolume implements android.os.Parcelable { method @NonNull public String getId(); } } package android.permission { Loading core/java/android/app/DownloadManager.java +35 −0 Original line number Diff line number Diff line Loading @@ -16,7 +16,9 @@ package android.app; import android.annotation.NonNull; import android.annotation.Nullable; import android.annotation.RequiresPermission; import android.annotation.SdkConstant; import android.annotation.SdkConstant.SdkConstantType; import android.annotation.SystemApi; Loading @@ -40,11 +42,13 @@ import android.os.Environment; import android.os.FileUtils; import android.os.ParcelFileDescriptor; import android.os.RemoteException; import android.provider.BaseColumns; import android.provider.Downloads; import android.provider.MediaStore; import android.provider.Settings; import android.provider.Settings.SettingNotFoundException; import android.text.TextUtils; import android.util.LongSparseArray; import android.util.Pair; import java.io.File; Loading Loading @@ -1068,6 +1072,37 @@ public class DownloadManager { mAccessFilename = accessFilename; } /** * Notify {@link DownloadManager} that the given {@link MediaStore} items * were just deleted so that {@link DownloadManager} internal data * structures can be cleaned up. * * @param idToMime map from {@link BaseColumns#_ID} to * {@link ContentResolver#getType(Uri)}. * @hide */ @SystemApi @RequiresPermission(android.Manifest.permission.WRITE_MEDIA_STORAGE) public void onMediaStoreDownloadsDeleted(@NonNull LongSparseArray<String> idToMime) { try (ContentProviderClient client = mResolver .acquireUnstableContentProviderClient(mBaseUri)) { final Bundle callExtras = new Bundle(); final long[] ids = new long[idToMime.size()]; final String[] mimeTypes = new String[idToMime.size()]; for (int i = idToMime.size() - 1; i >= 0; --i) { ids[i] = idToMime.keyAt(i); mimeTypes[i] = idToMime.valueAt(i); } callExtras.putLongArray(android.provider.Downloads.EXTRA_IDS, ids); callExtras.putStringArray(android.provider.Downloads.EXTRA_MIME_TYPES, mimeTypes); client.call(android.provider.Downloads.CALL_MEDIASTORE_DOWNLOADS_DELETED, null, callExtras); } catch (RemoteException e) { // Should not happen } } /** * Enqueue a new download. The download will start automatically once the download manager is * ready to execute it and connectivity is available. Loading core/java/android/content/ContentProvider.java +64 −14 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ import static android.os.Trace.TRACE_TAG_DATABASE; import android.annotation.NonNull; import android.annotation.Nullable; import android.annotation.SystemApi; import android.app.AppOpsManager; import android.compat.annotation.UnsupportedAppUsage; import android.content.pm.PackageManager; Loading Loading @@ -942,7 +943,18 @@ public abstract class ContentProvider implements ContentInterface, ComponentCall return null; } /** {@hide} */ /** * Return the package name of the caller that initiated the request being * processed on the current thread. The returned package will have * <em>not</em> been verified to belong to the calling UID. Returns * {@code null} if not currently processing a request. * <p> * This will always return {@code null} when processing * {@link #getType(Uri)} or {@link #getStreamTypes(Uri, String)} requests. * * @see Binder#getCallingUid() * @see Context#grantUriPermission(String, Uri, int) */ public final @Nullable String getCallingPackageUnchecked() { final Pair<String, String> pkg = mCallingPackage.get(); if (pkg != null) { Loading @@ -952,7 +964,14 @@ public abstract class ContentProvider implements ContentInterface, ComponentCall return null; } /** {@hide} */ /** * Called whenever the value of {@link #getCallingPackage()} changes, giving * the provider an opportunity to invalidate any security related caching it * may be performing. * <p> * This typically happens when a {@link ContentProvider} makes a nested call * back into itself when already processing a call from a remote process. */ public void onCallingPackageChanged() { } Loading Loading @@ -1390,8 +1409,11 @@ public abstract class ContentProvider implements ContentInterface, ComponentCall * @param uri The URI to query. This will be the full URI sent by the client. * @param projection The list of columns to put into the cursor. * If {@code null} provide a default set of columns. * @param queryArgs A Bundle containing all additional information necessary for the query. * Values in the Bundle may include SQL style arguments. * @param queryArgs A Bundle containing additional information necessary for * the operation. Arguments may include SQL style arguments, such * as {@link ContentResolver#QUERY_ARG_SQL_LIMIT}, but note that * the documentation for each individual provider will indicate * which arguments they support. * @param cancellationSignal A signal to cancel the operation in progress, * or {@code null}. * @return a Cursor or {@code null}. Loading Loading @@ -1525,8 +1547,24 @@ public abstract class ContentProvider implements ContentInterface, ComponentCall return false; } /** {@hide} */ /** * Perform a detailed internal check on a {@link Uri} to determine if a UID * is able to access it with specific mode flags. * <p> * This method is typically used when the provider implements more dynamic * access controls that cannot be expressed with {@code <path-permission>} * style static rules. * * @param uri the {@link Uri} to perform an access check on. * @param uid the UID to check the permission for. * @param modeFlags the access flags to use for the access check, such as * {@link Intent#FLAG_GRANT_READ_URI_PERMISSION}. * @return {@link PackageManager#PERMISSION_GRANTED} if access is allowed, * otherwise {@link PackageManager#PERMISSION_DENIED}. * @hide */ @Override @SystemApi public int checkUriPermission(@NonNull Uri uri, int uid, @Intent.AccessUriMode int modeFlags) { return PackageManager.PERMISSION_DENIED; } Loading Loading @@ -1574,9 +1612,14 @@ public abstract class ContentProvider implements ContentInterface, ComponentCall * * @param uri The content:// URI of the insertion request. * @param values A set of column_name/value pairs to add to the database. * @param extras A Bundle containing all additional information necessary * for the insert. * @param extras A Bundle containing additional information necessary for * the operation. Arguments may include SQL style arguments, such * as {@link ContentResolver#QUERY_ARG_SQL_LIMIT}, but note that * the documentation for each individual provider will indicate * which arguments they support. * @return The URI for the newly inserted item. * @throws IllegalArgumentException if the provider doesn't support one of * the requested Bundle arguments. */ @Override public @Nullable Uri insert(@NonNull Uri uri, @Nullable ContentValues values, Loading Loading @@ -1653,10 +1696,13 @@ public abstract class ContentProvider implements ContentInterface, ComponentCall * * @param uri The full URI to query, including a row ID (if a specific * record is requested). * @param extras A Bundle containing all additional information necessary * for the delete. Values in the Bundle may include SQL style * arguments. * @return The number of rows affected. * @param extras A Bundle containing additional information necessary for * the operation. Arguments may include SQL style arguments, such * as {@link ContentResolver#QUERY_ARG_SQL_LIMIT}, but note that * the documentation for each individual provider will indicate * which arguments they support. * @throws IllegalArgumentException if the provider doesn't support one of * the requested Bundle arguments. * @throws SQLException */ @Override Loading Loading @@ -1699,10 +1745,14 @@ public abstract class ContentProvider implements ContentInterface, ComponentCall * @param uri The URI to query. This can potentially have a record ID if * this is an update request for a specific record. * @param values A set of column_name/value pairs to update in the database. * @param extras A Bundle containing all additional information necessary * for the update. Values in the Bundle may include SQL style * arguments. * @param extras A Bundle containing additional information necessary for * the operation. Arguments may include SQL style arguments, such * as {@link ContentResolver#QUERY_ARG_SQL_LIMIT}, but note that * the documentation for each individual provider will indicate * which arguments they support. * @return the number of rows affected. * @throws IllegalArgumentException if the provider doesn't support one of * the requested Bundle arguments. */ @Override public int update(@NonNull Uri uri, @Nullable ContentValues values, Loading core/java/android/content/ContentProviderResult.java +4 −4 Original line number Diff line number Diff line Loading @@ -36,7 +36,7 @@ public class ContentProviderResult implements Parcelable { public final @Nullable Uri uri; public final @Nullable Integer count; public final @Nullable Bundle extras; public final @Nullable Exception exception; public final @Nullable Throwable exception; public ContentProviderResult(@NonNull Uri uri) { this(Objects.requireNonNull(uri), null, null, null); Loading @@ -50,12 +50,12 @@ public class ContentProviderResult implements Parcelable { this(null, null, Objects.requireNonNull(extras), null); } public ContentProviderResult(@NonNull Exception exception) { public ContentProviderResult(@NonNull Throwable exception) { this(null, null, null, exception); } /** {@hide} */ public ContentProviderResult(Uri uri, Integer count, Bundle extras, Exception exception) { public ContentProviderResult(Uri uri, Integer count, Bundle extras, Throwable exception) { this.uri = uri; this.count = count; this.extras = extras; Loading @@ -79,7 +79,7 @@ public class ContentProviderResult implements Parcelable { extras = null; } if (source.readInt() != 0) { exception = (Exception) ParcelableException.readFromParcel(source); exception = ParcelableException.readFromParcel(source); } else { exception = null; } Loading Loading
api/current.txt +13 −2 Original line number Diff line number Diff line Loading @@ -9504,6 +9504,7 @@ package android.content { method public void dump(java.io.FileDescriptor, java.io.PrintWriter, String[]); method @Nullable public final String getCallingFeatureId(); method @Nullable public final String getCallingPackage(); method @Nullable public final String getCallingPackageUnchecked(); method @Nullable public final android.content.Context getContext(); method @Nullable public final android.content.pm.PathPermission[] getPathPermissions(); method @Nullable public final String getReadPermission(); Loading @@ -9513,6 +9514,7 @@ package android.content { method @Nullable public abstract android.net.Uri insert(@NonNull android.net.Uri, @Nullable android.content.ContentValues); method @Nullable public android.net.Uri insert(@NonNull android.net.Uri, @Nullable android.content.ContentValues, @Nullable android.os.Bundle); method protected boolean isTemporary(); method public void onCallingPackageChanged(); method public void onConfigurationChanged(android.content.res.Configuration); method public abstract boolean onCreate(); method public void onLowMemory(); Loading Loading @@ -9627,13 +9629,13 @@ package android.content { ctor public ContentProviderResult(@NonNull android.net.Uri); ctor public ContentProviderResult(int); ctor public ContentProviderResult(@NonNull android.os.Bundle); ctor public ContentProviderResult(@NonNull Exception); ctor public ContentProviderResult(@NonNull Throwable); ctor public ContentProviderResult(android.os.Parcel); method public int describeContents(); method public void writeToParcel(android.os.Parcel, int); field @NonNull public static final android.os.Parcelable.Creator<android.content.ContentProviderResult> CREATOR; field @Nullable public final Integer count; field @Nullable public final Exception exception; field @Nullable public final Throwable exception; field @Nullable public final android.os.Bundle extras; field @Nullable public final android.net.Uri uri; } Loading Loading @@ -13324,6 +13326,7 @@ package android.database.sqlite { method @Deprecated public String buildUnionSubQuery(String, String[], java.util.Set<java.lang.String>, int, String, String, String[], String, String); method public int delete(@NonNull android.database.sqlite.SQLiteDatabase, @Nullable String, @Nullable String[]); method @Nullable public android.database.sqlite.SQLiteDatabase.CursorFactory getCursorFactory(); method @Nullable public java.util.Collection<java.util.regex.Pattern> getProjectionGreylist(); method @Nullable public java.util.Map<java.lang.String,java.lang.String> getProjectionMap(); method @Nullable public String getTables(); method public long insert(@NonNull android.database.sqlite.SQLiteDatabase, @NonNull android.content.ContentValues); Loading @@ -13336,6 +13339,7 @@ package android.database.sqlite { method public android.database.Cursor query(android.database.sqlite.SQLiteDatabase, String[], String, String[], String, String, String, String, android.os.CancellationSignal); method public void setCursorFactory(@Nullable android.database.sqlite.SQLiteDatabase.CursorFactory); method public void setDistinct(boolean); method public void setProjectionGreylist(@Nullable java.util.Collection<java.util.regex.Pattern>); method public void setProjectionMap(@Nullable java.util.Map<java.lang.String,java.lang.String>); method public void setStrict(boolean); method public void setStrictColumns(boolean); Loading Loading @@ -36389,15 +36393,22 @@ package android.os.storage { method public boolean isObbMounted(String); method public boolean mountObb(String, String, android.os.storage.OnObbStateChangeListener); method @NonNull public android.os.ParcelFileDescriptor openProxyFileDescriptor(int, android.os.ProxyFileDescriptorCallback, android.os.Handler) throws java.io.IOException; method public void registerStorageVolumeCallback(@NonNull java.util.concurrent.Executor, @NonNull android.os.storage.StorageManager.StorageVolumeCallback); method public void setCacheBehaviorGroup(java.io.File, boolean) throws java.io.IOException; method public void setCacheBehaviorTombstone(java.io.File, boolean) throws java.io.IOException; method public boolean unmountObb(String, boolean, android.os.storage.OnObbStateChangeListener); method public void unregisterStorageVolumeCallback(@NonNull android.os.storage.StorageManager.StorageVolumeCallback); field public static final String ACTION_MANAGE_STORAGE = "android.os.storage.action.MANAGE_STORAGE"; field public static final String EXTRA_REQUESTED_BYTES = "android.os.storage.extra.REQUESTED_BYTES"; field public static final String EXTRA_UUID = "android.os.storage.extra.UUID"; field public static final java.util.UUID UUID_DEFAULT; } public static class StorageManager.StorageVolumeCallback { ctor public StorageManager.StorageVolumeCallback(); method public void onStateChanged(@NonNull android.os.storage.StorageVolume); } public final class StorageVolume implements android.os.Parcelable { method @Deprecated @Nullable public android.content.Intent createAccessIntent(String); method @NonNull public android.content.Intent createOpenDocumentTreeIntent();
api/system-current.txt +15 −0 Original line number Diff line number Diff line Loading @@ -567,6 +567,7 @@ package android.app { } public class DownloadManager { method @RequiresPermission(android.Manifest.permission.WRITE_MEDIA_STORAGE) public void onMediaStoreDownloadsDeleted(@NonNull android.util.LongSparseArray<java.lang.String>); field public static final String ACTION_DOWNLOAD_COMPLETED = "android.intent.action.DOWNLOAD_COMPLETED"; } Loading Loading @@ -1654,11 +1655,17 @@ package android.content { method @NonNull public final android.os.UserHandle getSendingUser(); } public abstract class ContentProvider implements android.content.ComponentCallbacks2 { method public int checkUriPermission(@NonNull android.net.Uri, int, int); } public class ContentProviderClient implements java.lang.AutoCloseable { method @RequiresPermission(android.Manifest.permission.REMOVE_TASKS) public void setDetectNotResponding(long); } public abstract class ContentResolver { method @NonNull public static android.net.Uri decodeFromFile(@NonNull java.io.File); method @NonNull public static java.io.File encodeToFile(@NonNull android.net.Uri); method @Nullable @RequiresPermission("android.permission.CACHE_CONTENT") public android.os.Bundle getCache(@NonNull android.net.Uri); method @RequiresPermission("android.permission.CACHE_CONTENT") public void putCache(@NonNull android.net.Uri, @Nullable android.os.Bundle); } Loading Loading @@ -6974,6 +6981,10 @@ package android.os { method public boolean hasSingleFileDescriptor(); } public class ParcelFileDescriptor implements java.io.Closeable android.os.Parcelable { method @NonNull public static android.os.ParcelFileDescriptor wrap(@NonNull android.os.ParcelFileDescriptor, @NonNull android.os.Handler, @NonNull android.os.ParcelFileDescriptor.OnCloseListener) throws java.io.IOException; } public final class PowerManager { method @RequiresPermission(allOf={android.Manifest.permission.READ_DREAM_STATE, android.Manifest.permission.WRITE_DREAM_STATE}) public void dream(long); method @RequiresPermission(android.Manifest.permission.DEVICE_POWER) public boolean forceSuspend(); Loading Loading @@ -7377,6 +7388,10 @@ package android.os.storage { field @RequiresPermission(android.Manifest.permission.ALLOCATE_AGGRESSIVE) public static final int FLAG_ALLOCATE_AGGRESSIVE = 1; // 0x1 } public final class StorageVolume implements android.os.Parcelable { method @NonNull public String getId(); } } package android.permission { Loading
core/java/android/app/DownloadManager.java +35 −0 Original line number Diff line number Diff line Loading @@ -16,7 +16,9 @@ package android.app; import android.annotation.NonNull; import android.annotation.Nullable; import android.annotation.RequiresPermission; import android.annotation.SdkConstant; import android.annotation.SdkConstant.SdkConstantType; import android.annotation.SystemApi; Loading @@ -40,11 +42,13 @@ import android.os.Environment; import android.os.FileUtils; import android.os.ParcelFileDescriptor; import android.os.RemoteException; import android.provider.BaseColumns; import android.provider.Downloads; import android.provider.MediaStore; import android.provider.Settings; import android.provider.Settings.SettingNotFoundException; import android.text.TextUtils; import android.util.LongSparseArray; import android.util.Pair; import java.io.File; Loading Loading @@ -1068,6 +1072,37 @@ public class DownloadManager { mAccessFilename = accessFilename; } /** * Notify {@link DownloadManager} that the given {@link MediaStore} items * were just deleted so that {@link DownloadManager} internal data * structures can be cleaned up. * * @param idToMime map from {@link BaseColumns#_ID} to * {@link ContentResolver#getType(Uri)}. * @hide */ @SystemApi @RequiresPermission(android.Manifest.permission.WRITE_MEDIA_STORAGE) public void onMediaStoreDownloadsDeleted(@NonNull LongSparseArray<String> idToMime) { try (ContentProviderClient client = mResolver .acquireUnstableContentProviderClient(mBaseUri)) { final Bundle callExtras = new Bundle(); final long[] ids = new long[idToMime.size()]; final String[] mimeTypes = new String[idToMime.size()]; for (int i = idToMime.size() - 1; i >= 0; --i) { ids[i] = idToMime.keyAt(i); mimeTypes[i] = idToMime.valueAt(i); } callExtras.putLongArray(android.provider.Downloads.EXTRA_IDS, ids); callExtras.putStringArray(android.provider.Downloads.EXTRA_MIME_TYPES, mimeTypes); client.call(android.provider.Downloads.CALL_MEDIASTORE_DOWNLOADS_DELETED, null, callExtras); } catch (RemoteException e) { // Should not happen } } /** * Enqueue a new download. The download will start automatically once the download manager is * ready to execute it and connectivity is available. Loading
core/java/android/content/ContentProvider.java +64 −14 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ import static android.os.Trace.TRACE_TAG_DATABASE; import android.annotation.NonNull; import android.annotation.Nullable; import android.annotation.SystemApi; import android.app.AppOpsManager; import android.compat.annotation.UnsupportedAppUsage; import android.content.pm.PackageManager; Loading Loading @@ -942,7 +943,18 @@ public abstract class ContentProvider implements ContentInterface, ComponentCall return null; } /** {@hide} */ /** * Return the package name of the caller that initiated the request being * processed on the current thread. The returned package will have * <em>not</em> been verified to belong to the calling UID. Returns * {@code null} if not currently processing a request. * <p> * This will always return {@code null} when processing * {@link #getType(Uri)} or {@link #getStreamTypes(Uri, String)} requests. * * @see Binder#getCallingUid() * @see Context#grantUriPermission(String, Uri, int) */ public final @Nullable String getCallingPackageUnchecked() { final Pair<String, String> pkg = mCallingPackage.get(); if (pkg != null) { Loading @@ -952,7 +964,14 @@ public abstract class ContentProvider implements ContentInterface, ComponentCall return null; } /** {@hide} */ /** * Called whenever the value of {@link #getCallingPackage()} changes, giving * the provider an opportunity to invalidate any security related caching it * may be performing. * <p> * This typically happens when a {@link ContentProvider} makes a nested call * back into itself when already processing a call from a remote process. */ public void onCallingPackageChanged() { } Loading Loading @@ -1390,8 +1409,11 @@ public abstract class ContentProvider implements ContentInterface, ComponentCall * @param uri The URI to query. This will be the full URI sent by the client. * @param projection The list of columns to put into the cursor. * If {@code null} provide a default set of columns. * @param queryArgs A Bundle containing all additional information necessary for the query. * Values in the Bundle may include SQL style arguments. * @param queryArgs A Bundle containing additional information necessary for * the operation. Arguments may include SQL style arguments, such * as {@link ContentResolver#QUERY_ARG_SQL_LIMIT}, but note that * the documentation for each individual provider will indicate * which arguments they support. * @param cancellationSignal A signal to cancel the operation in progress, * or {@code null}. * @return a Cursor or {@code null}. Loading Loading @@ -1525,8 +1547,24 @@ public abstract class ContentProvider implements ContentInterface, ComponentCall return false; } /** {@hide} */ /** * Perform a detailed internal check on a {@link Uri} to determine if a UID * is able to access it with specific mode flags. * <p> * This method is typically used when the provider implements more dynamic * access controls that cannot be expressed with {@code <path-permission>} * style static rules. * * @param uri the {@link Uri} to perform an access check on. * @param uid the UID to check the permission for. * @param modeFlags the access flags to use for the access check, such as * {@link Intent#FLAG_GRANT_READ_URI_PERMISSION}. * @return {@link PackageManager#PERMISSION_GRANTED} if access is allowed, * otherwise {@link PackageManager#PERMISSION_DENIED}. * @hide */ @Override @SystemApi public int checkUriPermission(@NonNull Uri uri, int uid, @Intent.AccessUriMode int modeFlags) { return PackageManager.PERMISSION_DENIED; } Loading Loading @@ -1574,9 +1612,14 @@ public abstract class ContentProvider implements ContentInterface, ComponentCall * * @param uri The content:// URI of the insertion request. * @param values A set of column_name/value pairs to add to the database. * @param extras A Bundle containing all additional information necessary * for the insert. * @param extras A Bundle containing additional information necessary for * the operation. Arguments may include SQL style arguments, such * as {@link ContentResolver#QUERY_ARG_SQL_LIMIT}, but note that * the documentation for each individual provider will indicate * which arguments they support. * @return The URI for the newly inserted item. * @throws IllegalArgumentException if the provider doesn't support one of * the requested Bundle arguments. */ @Override public @Nullable Uri insert(@NonNull Uri uri, @Nullable ContentValues values, Loading Loading @@ -1653,10 +1696,13 @@ public abstract class ContentProvider implements ContentInterface, ComponentCall * * @param uri The full URI to query, including a row ID (if a specific * record is requested). * @param extras A Bundle containing all additional information necessary * for the delete. Values in the Bundle may include SQL style * arguments. * @return The number of rows affected. * @param extras A Bundle containing additional information necessary for * the operation. Arguments may include SQL style arguments, such * as {@link ContentResolver#QUERY_ARG_SQL_LIMIT}, but note that * the documentation for each individual provider will indicate * which arguments they support. * @throws IllegalArgumentException if the provider doesn't support one of * the requested Bundle arguments. * @throws SQLException */ @Override Loading Loading @@ -1699,10 +1745,14 @@ public abstract class ContentProvider implements ContentInterface, ComponentCall * @param uri The URI to query. This can potentially have a record ID if * this is an update request for a specific record. * @param values A set of column_name/value pairs to update in the database. * @param extras A Bundle containing all additional information necessary * for the update. Values in the Bundle may include SQL style * arguments. * @param extras A Bundle containing additional information necessary for * the operation. Arguments may include SQL style arguments, such * as {@link ContentResolver#QUERY_ARG_SQL_LIMIT}, but note that * the documentation for each individual provider will indicate * which arguments they support. * @return the number of rows affected. * @throws IllegalArgumentException if the provider doesn't support one of * the requested Bundle arguments. */ @Override public int update(@NonNull Uri uri, @Nullable ContentValues values, Loading
core/java/android/content/ContentProviderResult.java +4 −4 Original line number Diff line number Diff line Loading @@ -36,7 +36,7 @@ public class ContentProviderResult implements Parcelable { public final @Nullable Uri uri; public final @Nullable Integer count; public final @Nullable Bundle extras; public final @Nullable Exception exception; public final @Nullable Throwable exception; public ContentProviderResult(@NonNull Uri uri) { this(Objects.requireNonNull(uri), null, null, null); Loading @@ -50,12 +50,12 @@ public class ContentProviderResult implements Parcelable { this(null, null, Objects.requireNonNull(extras), null); } public ContentProviderResult(@NonNull Exception exception) { public ContentProviderResult(@NonNull Throwable exception) { this(null, null, null, exception); } /** {@hide} */ public ContentProviderResult(Uri uri, Integer count, Bundle extras, Exception exception) { public ContentProviderResult(Uri uri, Integer count, Bundle extras, Throwable exception) { this.uri = uri; this.count = count; this.extras = extras; Loading @@ -79,7 +79,7 @@ public class ContentProviderResult implements Parcelable { extras = null; } if (source.readInt() != 0) { exception = (Exception) ParcelableException.readFromParcel(source); exception = ParcelableException.readFromParcel(source); } else { exception = null; } Loading