History log of /frameworks/base/core/java/android/provider/DocumentsProvider.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
ff17024e583b170312d82089fd358d278ce16c9a 19-Nov-2014 Dianne Hackborn <hackbod@google.com> Fix issue with call backs from media process.

All but a few lines of this is for issue #16013164, which allowed
apps to do some operations as the media uid by having it call
back to them to open a file. The problem here is with the tempory
identity stuff in the activity manager, allowing us to make the open
call as the original caller... ideally we should figure out a way
to just get rid of all of that, but the solution here is actually
easier (even though it doesn't look it) -- we now hand a token over
to the openFile() call that it can use when doing permission checks
to say "yes I would like the check to be against whoever is responsible
for the open". This allows us to do the uid remapping for only this
one specific set of permission checks, and nothing else.

Also fix issue #17487348: Isolated services can access system services
they shouldn't be able to. Don't send any system service IBinder objects
down for the first initialization of an isolated process.

Change-Id: I3c70e16e0899d7eef0bae458e83958b41ed2b75e
/frameworks/base/core/java/android/provider/DocumentsProvider.java
5b836f29a3f56f9d13b6004417330c41ec0c18ae 27-Aug-2014 Jeff Sharkey <jsharkey@android.com> Define EXTRA_SIZE for ContentProviders.

Also make Size and SizeF parcelable.

Bug: 17205016
Change-Id: Ide397b84864f6cad7f8d89e66b6c8697a3ad335b
/frameworks/base/core/java/android/provider/DocumentsProvider.java
b9fbb7290b02de1ce621deaa2d28a5e42f2e0937 05-Jun-2014 Jeff Sharkey <jsharkey@android.com> Refactor directory API to "opening document tree."

Cleans up API so it consistently refers to opening or working with a
subtree of documents. Also separates isChildDocument() support from
the concept of directory tree selection.

Bug: 15429194
Change-Id: Ice66a751ff4bd0cc4d34c44c5da13a0dc4186dc9
/frameworks/base/core/java/android/provider/DocumentsProvider.java
b7e1255d5c8d9e4fa8dd389afb9f5aab35434df3 22-May-2014 Jeff Sharkey <jsharkey@android.com> Support for renaming documents.

DocumentsProviders can mark documents as supporting rename, and they
have the opportunity to change the DOCUMENT_ID as a side effect of
the rename. This supports providers that embed the display name
into DOCUMENT_ID. Issues a URI permission grant to the new document,
if any.

Adds renaming support to platform ExternalStorageProvider. Also
adds directory deletion support.

Bug: 12350110
Change-Id: Ica4b1ae6769ee994f70f6b6b2402213eebd064e0
/frameworks/base/core/java/android/provider/DocumentsProvider.java
21de56a94668e0fda1b8bb4ee4f99a09b40d28fd 06-Apr-2014 Jeff Sharkey <jsharkey@android.com> Add directory selection to DocumentsProvider.

Introduce new ACTION_PICK_DIRECTORY that allows users to grant access
to an entire document subtree. Instead of requiring grants for each
individual document, this leverages new prefix URI permission grants
by defining new "via"-style URIs:

content://com.example/via/12/document/24/

This references document 24 by using a prefix grant given for
document 12. Internally, we use isChildDocument() to enforce that
24 is actually a descendant (child, grandchild, etc) of 12. Since
this is an optional API, providers indicate support with
Root.FLAG_SUPPORTS_DIR_SELECTION.

Extend DocumentsUI to support picking directories. Expose
createDocument() API to work with returned directories.

Offer to canonicalize via-style URIs into direct URIs, generating
exact permission grants along the way. Override openAssetFile()
to pass through CancellationSignal. Move testing code into ApiDemos.

Bug: 10607375
Change-Id: Ifffc1cff878870f8152eb6ca0199c5d014b9cb07
/frameworks/base/core/java/android/provider/DocumentsProvider.java
3b945405cf96eae8b882f87934222a453718a559 13-Nov-2013 Jeff Sharkey <jsharkey@android.com> Small DocumentsProvider doc improvements.

Bug: 11670294
Change-Id: I5fb91c7665fc2a4531059ef9f2de0972ebabe1ea
/frameworks/base/core/java/android/provider/DocumentsProvider.java
37ed78e504ef3666dd5fce15ff4994f151c44fcd 05-Nov-2013 Jeff Sharkey <jsharkey@android.com> Clarify DocumentsProvider recents behavior.

Bug: 11448309
Change-Id: I17e0ac757e549b251e08d58d5ce7d25fb253883f
/frameworks/base/core/java/android/provider/DocumentsProvider.java
8a2998eade93032a78d681c66ebadbfa6f802f76 31-Oct-2013 Jeff Sharkey <jsharkey@android.com> Better enforcement in DocumentsProvider.call().

Use ContentProvider.enforceWritePermissionInner() to handle all edge
cases around checking if caller has write permissions. This fixes
bug where call() would throw if caller and provider were the same app.

Bug: 11464234
Change-Id: Iace8e0e4243d56ed1cdcc9680383103975107036
/frameworks/base/core/java/android/provider/DocumentsProvider.java
9352c383e95c3e1facd8a7a2d49ff488fb7bbcaf 23-Oct-2013 Jeff Sharkey <jsharkey@android.com> Add notification docs to DocumentsProvider.

Bug: 11272209
Change-Id: I97d67c91c4f4a312cbde82afd9e27509c26517b2
/frameworks/base/core/java/android/provider/DocumentsProvider.java
e8c00d8ed477e199b7f8d1b1e2f37e9cf8593372 16-Oct-2013 Jeff Sharkey <jsharkey@android.com> Improve DocumentsProvider and contract docs.

Bug: 10567557
Change-Id: I71e7f7ad172e9986e58b9c9533b1c948c5530397
/frameworks/base/core/java/android/provider/DocumentsProvider.java
e66c1778f80f4b18e29e018eca3a338f125f23b9 20-Sep-2013 Jeff Sharkey <jsharkey@android.com> Require that persistable Uri permissions be taken.

Change our Intent flag to indicate that a Uri permission grant is
persistable, but don't actually persist it until explicitly taken by
the receiving app. This prevents apps from spamming each other if
persisted permissions aren't really required.

Remember the last time a persisted grant was taken by an app, and
use this to prune away the oldest grants when the number of grants
grows too large. Allow apps to query persisted grants they are
holding, and allow them to release previously persisted grants. Add
public UriPermission class to return grant details and timestamp.

Track various permission strengths separately, and combine together
after each mutation pass. Persistable grants are currently treated
like global grants, but they could be moved to have owners in the
future. Require that grant holders trying to extend a persistable
permission actually hold a persistable permission themselves.

Bug: 10835779
Change-Id: I95b2f797c04ce7fd2612f9a644685dbd44e03759
/frameworks/base/core/java/android/provider/DocumentsProvider.java
3e1189b3590aefb65a2af720ae2ba959bbd4188d 13-Sep-2013 Jeff Sharkey <jsharkey@android.com> Move search to roots; Documents root; hide empty.

Documents searches now happen root-wide, instead of only under a
subdirectory. Updates abstract class and flags to match. Add flag
for a root to indicate it's empty, and hide empty roots in UI unless
creating.

Define "Documents" public directory and storage backend to contain
files.

Bug: 10712057, 10710865, 10710758
Change-Id: I8716367568969f9cb1d83927b2bf5a7013809350
/frameworks/base/core/java/android/provider/DocumentsProvider.java
4ec973925fc2cd18f9ec0d0ca5af588564fded27 10-Sep-2013 Jeff Sharkey <jsharkey@android.com> More UX work for thumbnails, search, management.

Hide non-finished downloads from normal picker UI, but keep them
around in management mode. Uses a Uri query parameter and a hidden
API on DocumentsProvider.

Scale thumbnails to fit viewport, always show MIME icon while waiting
on thumbnails, and crossfade between them. Cancel thumbnail tasks
when views are recycled.

Filter directories out of search results for now. Also leave sort
ordering from backend intact, since it's custom ranking. Fix
SearchView interaction to dismiss properly and restore across
orientation and drawer state changes.

Hide most actions when drawer is open. Invalidate RootInfo cache
when locale changes. Apply sort ordering when showing recent create
directories. Hide recent summary string when icon is enough for user
to disambiguate.

Bug: 10667184, 10665663
Change-Id: I331d3272a08c497f88dc659d9e112231cb35aa69
/frameworks/base/core/java/android/provider/DocumentsProvider.java
911d7f411f36f2279aae44c89ff1d33a29140046 06-Sep-2013 Jeff Sharkey <jsharkey@android.com> Provide calling package to ContentProviders.

The calling package is important for ContentProviders that want to
grant Uri permissions as a side effect of operations, so offer it
through a new API. Validates the provided package against the
calling UID before returning.

Bug: 10626527
Change-Id: I7277880eebbd48444c024bcf5f69199133cd59e4
/frameworks/base/core/java/android/provider/DocumentsProvider.java
a61dc8e03e6e863005b3a4629ca8f3801d33d3c4 06-Sep-2013 Jeff Sharkey <jsharkey@android.com> Separate root and document management.

Two hidden intents for managing roots and documents, used to support
Downloads UI. Touching an item tries launching as MANAGE_DOCUMENT
first before falling back to VIEW. Provide MIME type for roots.

Bug: 10446265, 10531347, 10599641
Change-Id: Ia5584bd6ce3e5a9b0048e8caf1447e3053664413
/frameworks/base/core/java/android/provider/DocumentsProvider.java
e37ea6123d1aa3cd3e8804988886b1f6046d79d6 04-Sep-2013 Jeff Sharkey <jsharkey@android.com> Fix document management permission enforcement.

Allow both explicit holders of the MANAGE_DOCUMENTS permission and
those holding Uri grants to perform management tasks.

Extend grants for newly created documents when caller doesn't have
permission. Revoke grants when deleting documents.

Test now writes actual content into picked file. Workaround updated
flags for Drive app.

Bug: 10623211
Change-Id: Ia8e90b33e0fac8294b2cacb96d083c43fdf75aab
/frameworks/base/core/java/android/provider/DocumentsProvider.java
ae9b51bfa313c51a31af30875a71255d7b6d2e61 01-Sep-2013 Jeff Sharkey <jsharkey@android.com> Refactoring of DocumentsContract.

Combines related columns and constants onto the same class so they
are easier to discover. Move back to surfacing roots with columns
so they are consistent with documents.

Advanced roots are represented with a flag instead of distinct
types. Flags to indicate supporting of well-known media types,
instead of arbitrary an MIME filter. Reintroduce well-formed rootId
to support recents.

Always use the expanded version of "documents" in constants, methods,
and argument names.

Refactor DocumentProvider method names to clearly distinguish if
a single item or multiple could be returned, and of which type. Add
documentation to clearly define which methods have already been
overridden.

Bug: 10567506, 10567557
Change-Id: I981f26ab82f2b520a19aa1ce66f659de50d7fac0
/frameworks/base/core/java/android/provider/DocumentsProvider.java
aeb16e2435f9975b9fa1fc4b747796647a21292e 28-Aug-2013 Jeff Sharkey <jsharkey@android.com> 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
/frameworks/base/core/java/android/provider/DocumentsProvider.java