diff options
| author | Jeff Sharkey <jsharkey@android.com> | 2013-08-27 18:26:48 -0700 |
|---|---|---|
| committer | Jeff Sharkey <jsharkey@android.com> | 2013-08-28 20:49:42 -0700 |
| commit | aeb16e2435f9975b9fa1fc4b747796647a21292e (patch) | |
| tree | 2e228b0ca25799bf59472d5df08d71e068498b2b /core/java/android/content/ContentProviderClient.java | |
| parent | 61f0f9ada51a6718075acfe7fafbb9954f38e980 (diff) | |
Stronger DocumentsProvider contract.
Using a contract class requires that a provider implement it exactly
with little help. This change introduces a DocumentsProvider abstract
class that provides a client-side implementation of the contract that
greatly reduces developer burden, and improves correctness.
This also moves to first-class DocumentRoot objects, and moves calls
with complex side effects to be ContentProvider.call() invocations,
offering more granular permission control over Uri operations that
shouldn't be available through Uri grants.
This new design also relaxes the requirement that root information be
burned into every Uri. Migrate ExternalDocumentsProvider and
DocumentsUI to adopt new API.
Bug: 10497206
Change-Id: I6f2b3f519bfd62a9d693223ea5628a971ce2e743
Diffstat (limited to 'core/java/android/content/ContentProviderClient.java')
| -rw-r--r-- | core/java/android/content/ContentProviderClient.java | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/core/java/android/content/ContentProviderClient.java b/core/java/android/content/ContentProviderClient.java index 024a52153461..4e8dd829a348 100644 --- a/core/java/android/content/ContentProviderClient.java +++ b/core/java/android/content/ContentProviderClient.java @@ -316,4 +316,11 @@ public class ContentProviderClient { public ContentProvider getLocalContentProvider() { return ContentProvider.coerceToLocalContentProvider(mContentProvider); } + + /** {@hide} */ + public static void closeQuietly(ContentProviderClient client) { + if (client != null) { + client.release(); + } + } } |
