History log of /frameworks/base/packages/DocumentsUI/src/com/android/documentsui/DocumentsActivity.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
43aef1643b82e0fe1a524b20c2a533fd620ecfc3 24-Nov-2014 Jeff Sharkey <jsharkey@android.com> Move Documents action bar update even later.

At some point Activity started restoring the Toolbar/ActionBar title
during onPostCreate(), which would clobber some of the setup we just
finished doing. To fix, move our update to be even later in the
restore lifecycle.

Also fix grid item widths for small screen devices.

Bug: 17428127
Change-Id: I258121b6a6eec5924f92b02290a67d3ae7dd9cf6
/frameworks/base/packages/DocumentsUI/src/com/android/documentsui/DocumentsActivity.java
0166ddf5bbb5d855cb2f5bca4c6a9f0281c14814 23-Oct-2014 Jeff Sharkey <jsharkey@android.com> Recent directories can't show file size.

Don't show the toggle to the user, which can avoid crashing.

Bug: 17942524
Change-Id: Iaedd61b7c69e14b57508cb9865d1e0124ca2e505
/frameworks/base/packages/DocumentsUI/src/com/android/documentsui/DocumentsActivity.java
b7b30f691c5b87468ef6ad769487a9f4b315075d 13-Oct-2014 Jeff Sharkey <jsharkey@android.com> DocumentsUI: Add content description for nav.

Bug: 17922955
Change-Id: I44c0107d8dd03aab36da55deeb864e328b492124
/frameworks/base/packages/DocumentsUI/src/com/android/documentsui/DocumentsActivity.java
669f8e7c70c595964a1c9ca154ac123da84d99a1 09-Aug-2014 Jeff Sharkey <jsharkey@android.com> Move DocumentsUI settings into overflow menu.

Also use different strings based on device type to make clearer.

Bug: 13437894
Change-Id: I4053780de2c7197fb45cc53aee7659e9d0d75c0a
/frameworks/base/packages/DocumentsUI/src/com/android/documentsui/DocumentsActivity.java
c29dd61cbfc9f073239bdce3f4fe397deae2c623 08-Aug-2014 Jeff Sharkey <jsharkey@android.com> More material updates to DocumentsUI.

All assets cut as alpha variants so we apply desired tinting at
runtime. Small script to automatically generate XML resources.

Bug: 15836082, 16658537
Change-Id: I803b3f0bf6f121194a5445fd1c6600fabaf28f60
/frameworks/base/packages/DocumentsUI/src/com/android/documentsui/DocumentsActivity.java
a847d79310320ae8adbedb281123a0f879c2fc6e 30-Jul-2014 Jeff Sharkey <jsharkey@android.com> Light icons for DocumentsUI.

In some cases we want to show light variants. Also tweak drawer
sizes and grid padding.

Bug: 15836082
Change-Id: Ic6459ff0533a7d346c03db5d7deb3d6da42e7649
/frameworks/base/packages/DocumentsUI/src/com/android/documentsui/DocumentsActivity.java
8a850b4c0e0d4ceff4553dbb2490fe13f0e05f9d 30-Jul-2014 Jeff Sharkey <jsharkey@android.com> Latest DocumentsUI material asset drop.

Bug: 15836082
Change-Id: Ifdd8a42a963071f1c958d56b3f835228f257cf9a
/frameworks/base/packages/DocumentsUI/src/com/android/documentsui/DocumentsActivity.java
f52773fd62fc2fec40c2e17230b644dfbee6cf2d 29-Jul-2014 Jeff Sharkey <jsharkey@android.com> More DocumentsUI material iteration.

Move to using Toolbar for all actions. Drawer contains its own
Toolbar with separate title, and hamburger is always visible. Change
drawer items to match spec. Switching to Toolbar allows us to remove
nasty dialog-on-tablet hacks, yay! This also means we can finally
get real IME resizing support.

Move to using elevation for all shadows; this removes more nasty
hacks around drawing directory shadows.

Bug: 15836082
Change-Id: Iba70b898f385a7debd8aabfc98ff39d20bca860d
/frameworks/base/packages/DocumentsUI/src/com/android/documentsui/DocumentsActivity.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/packages/DocumentsUI/src/com/android/documentsui/DocumentsActivity.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/packages/DocumentsUI/src/com/android/documentsui/DocumentsActivity.java
96c620595bd0585f934b0971b4552c57845e9a78 26-Oct-2013 Jeff Sharkey <jsharkey@android.com> Extra to always show advanced devices.

Also always lower-case extension to extract MIME type correctly,
we may want to fix in MimeUtils at some point.

Bug: 11354402
Change-Id: I77d0c06a663cd0c4320c41553ff1980b6f9a7778
/frameworks/base/packages/DocumentsUI/src/com/android/documentsui/DocumentsActivity.java
04d45a0bdd47c243ad7ccb179aa52a83e7bf45db 24-Oct-2013 Jeff Sharkey <jsharkey@android.com> Show spinner while waiting for mutations.

When mutation operations are waiting for a storage backend, show a
spinner in place of the save button.

Bug: 11333249
Change-Id: I2b620b4532ad977a2b60d4bdc5caa55f89021456
/frameworks/base/packages/DocumentsUI/src/com/android/documentsui/DocumentsActivity.java
15be83612c34b65404f15d0feafdb4a329467769 09-Oct-2013 Jeff Sharkey <jsharkey@android.com> Support overriding calling package in Documents.

Calling package is only used to pick the stack to restore, not for
security purposes. This lets other system tools (like Printing)
indicate the real caller.

Bug: 11149540
Change-Id: I155e32577eaeda7dfcb80a7d84ac3b54f281590a
/frameworks/base/packages/DocumentsUI/src/com/android/documentsui/DocumentsActivity.java
d01571e6d4e1c403534e19142720530d324eac9b 02-Oct-2013 Jeff Sharkey <jsharkey@android.com> Isolate calls to each remote DocumentsProvider.

All background work is going through AsyncTasks, which uses a shared
thread pool. Even with the new ContentProviderClient logic to detect
ANRs, the UI can still appear to be unresponsive for 20 seconds, even
if the user attempted to switch to a different backend. In the worst
case, a backlog of thumbnail requests would end up wedging Loaders
for a long time, since they all share the same THREAD_POOL_EXECUTOR.

This change isolates calls to each provider onto their own thread,
which they're free to wedge and recover from over time.

It also means we no longer need a dedicated thread pool for recents
loading, and can use a simpler Semaphore instead.

Disables thumbnails in recents on svelte devices.

Bug: 10993301, 11014856
Change-Id: I7f8a5bbb5f64437e006cb2c48b7e854136d5c38c
/frameworks/base/packages/DocumentsUI/src/com/android/documentsui/DocumentsActivity.java
7aa7601c09ab5d87cc15a0ed9a8f511d494a4cbc 30-Sep-2013 Jeff Sharkey <jsharkey@android.com> Detect wedged ContentProviders, treat as ANR.

All ContentProvider calls are currently blocking, making it hard for
an app to recover when a remote provider is wedged. This change adds
hidden support to ContentProviderClient to timeout remote calls,
treating them as ANRs. This behavior is disabled by default.

Update DocumentsUI to use a 20 second timeout whenever interacting
with a storage provider.

Bug: 10993301, 10819461, 10852518
Change-Id: I10fa3c425c6a7225fff9cb7a0a07659028230cd3
/frameworks/base/packages/DocumentsUI/src/com/android/documentsui/DocumentsActivity.java
6efba22ce510352bb84910d6efc42fecafd31ed7 28-Sep-2013 Jeff Sharkey <jsharkey@android.com> New roots UX, async, performance, docs.

Yet another iteration from UX on how roots should be ordered. Since
we no longer categorize by type, remove from public API. Updated
asset drop with new dividers.

Update public API docs to be explicit about required columns. Hide
flags and columns that aren't required for third-party apps.

Move remainder of potentially blocking work to AsyncTasks, including
creating directories, picked root resolution, and creation of new
documents once picked.

Improve performance of layouts by removing baseline alignment and
reduce hierarchy depth. Set alpha on ImageViews directly to avoid
offscreen rendering hit.

Limit returned recents to 45 days. Show load in recents when still
waiting for backends. Show empty message when no recents stacks to
create from. Use unique key when saving recent stacks.

Bug: 10941423, 10819454, 10964412, 10960718
Change-Id: I08cf589dcda7e203acf67928f4d30322ae36ee94
/frameworks/base/packages/DocumentsUI/src/com/android/documentsui/DocumentsActivity.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/packages/DocumentsUI/src/com/android/documentsui/DocumentsActivity.java
6a20e574116af1072782c1e87cb03eb33f05ec50 25-Sep-2013 Jeff Sharkey <jsharkey@android.com> Handle null stacks gracefully.

Bug: 10928395
Change-Id: Ie7c3f7e0eb068ece0cf678a5d6346f18a413856b
/frameworks/base/packages/DocumentsUI/src/com/android/documentsui/DocumentsActivity.java
deffadeb7485e8660ecce12822e259d96fa06dce 24-Sep-2013 Jeff Sharkey <jsharkey@android.com> Freshen restored stacks, more UX bug fixes.

When restoring a persisted stack, such as last location or a location
where save occurred, freshen the DocumentStack to get the latest
details from backend, and ensure the path is still valid.

Filter Recent directories in create mode based on roots allowed by
incoming request.

Remember when user last picked an external app, and open drawer next
time user launches for GET_CONTENT.

Fix state list drawable ordering, and avoid clobbering Drawable
callback when wrapping in InsetDrawable; tricksy hobbitses!

Make grid items smaller to always fit two columns on phones. Draw
grid items all the way to screen edge; don't clip to padding. Better
error message when folder creation failed. Show Recents in grid mode
when picking any visual content, not just images.

Bug: 10846100, 10903211, 10898993, 10892808, 10892058, 10892009, 10885012
Change-Id: Ia0f88d911abc6ea03645d6fd3e04271c21d5936a
/frameworks/base/packages/DocumentsUI/src/com/android/documentsui/DocumentsActivity.java
1feeddf518d31a7ff5d28000a631857442cd7161 22-Sep-2013 Jeff Sharkey <jsharkey@android.com> Latest UX asset drop, grid padding.

Bring in latest asset drop. Apply grid padding programmatically
instead of waiting for asset. Remove alpha from directory animation.

Update save footer background to match spec.

Bug: 10700025
Change-Id: I8eef08f36d04767b78e91b23f72bdbebfbb02f58
/frameworks/base/packages/DocumentsUI/src/com/android/documentsui/DocumentsActivity.java
5545f56f7561810187545a1817b6001dd1f9931b 21-Sep-2013 Jeff Sharkey <jsharkey@android.com> Create unique files, root ordering, UI bugs.

When a file already exists on disk, try adding a counter suffix to
make a unique name. Move services near top of roots list, just below
recents. Remove "Documents" root.

Increase number of recents allowed from single provider, and add more
logging to diagnose wedged loaders.

When launching GET_CONTENT apps, wait for successful result before
relaying result; canceled requests now return to DocumentsUI.

Add CloseGuard to ContentProviderClients, since leaked instances can
keep the remote process alive.

Fix UI bug around trailing breadcrumbs. Fix bug that dropped Recents
from roots list. Add up action to Settings activity. Give our
activity a default icon while waiting for async roots to load.

Bug: 10818683, 10819461, 10819461, 10819196, 10860199
Change-Id: I7b9e26b1cf8353dd3175458b23da2b4bda6c5831
/frameworks/base/packages/DocumentsUI/src/com/android/documentsui/DocumentsActivity.java
a9ce049db87259e302e2368d2a4a1c11a94fd831 20-Sep-2013 Jeff Sharkey <jsharkey@android.com> Load RootInfo in background, invalidation.

Move all RootInfo queries to background threads to avoid janking
the UI. Update passes happen on spawed task, which swaps out updated
cache results when finished. Support partial updates when only a
single package/authority has changed. Watch for change notifications
for roots, since flags can change over time.

Ignore stopped packages when in background, but query them for roots
when launching any picker UI.

Optimize management launches by treating as one-shot requests that
don't need to wait for all RootInfo.

Bug: 10600454, 10745490
Change-Id: Ibc7b15688ef6b41bd7e9dd0d7564b501e60e49a9
/frameworks/base/packages/DocumentsUI/src/com/android/documentsui/DocumentsActivity.java
e20a3acdc2d52c7eeb76940206145b3c419394a6 19-Sep-2013 Jeff Sharkey <jsharkey@android.com> Save directory state and animate.

Save scroll position and restore when rotating or going up the
directory stack. Also show directory animations when navigating
the directory stack.

Bug: 10417201
Change-Id: Ia2c508debc2bffffe6306eb9078afefef259dfe2
/frameworks/base/packages/DocumentsUI/src/com/android/documentsui/DocumentsActivity.java
f6db154975ef575479ba4ab59d80bcf592288252 13-Sep-2013 Jeff Sharkey <jsharkey@android.com> More UX updates around picking images.

When picking images or videos, hide the titles in recents, since the
thumbnails should speak for themselves. Also respect new flag that
allows a directory to request their titles be hidden.

Show directory icon hint in grid mode when showing a thumbnail, to
remind user it's a directory.

Filter directories out of recents. Hide most action bar icons on
phones, even when room. Only show drawer on first launch. Hide most
drawer headers to match spec.

Bug: 10710331
Change-Id: I0ef1973ddd62750f57345336388366eda1449720
/frameworks/base/packages/DocumentsUI/src/com/android/documentsui/DocumentsActivity.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/packages/DocumentsUI/src/com/android/documentsui/DocumentsActivity.java
88f322c3115e85bb96fb46f9192b5daecd472c64 13-Sep-2013 Jeff Sharkey <jsharkey@android.com> DocumentsUI tablet support.

Shows as a faux dialog on larger tablets, since the normal dialog
themes from framework don't support action bars. Instead, this hacks
itself to look like a dialog with an InsetDrawable. Detects touches
in dim area to dismiss dialog.

Show all action bar icons on tablets, and roots panel is always
visible with a different shadow. Show settings in dialog. Allow mode
switches in recents.

Bug: 10329832
Change-Id: Id02982ce7b0d4694962d32f8d5286fdfcc207208
/frameworks/base/packages/DocumentsUI/src/com/android/documentsui/DocumentsActivity.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/packages/DocumentsUI/src/com/android/documentsui/DocumentsActivity.java
fb3445c9b31c7f8401d6eec0606dabee366c8aad 10-Sep-2013 Jeff Sharkey <jsharkey@android.com> Sort order is sticky for session, back leaves.

Instead of persisting sort order per-directory, the order is now
sticky for that session. Any user selected sort order takes
precedence over an ordering hinted by a backend.

When a restored DocumentStack is untouched, the back key now leaves
the dialog, instead of popping from the restored stack.

Persist list/grid mode changes async.

Bug: 10659604, 10672973
Change-Id: I9f022a081c014537447c9c2af10e19d8cd9566aa
/frameworks/base/packages/DocumentsUI/src/com/android/documentsui/DocumentsActivity.java
d182bb641f228b2d28527a6aa86075f6358ab838 07-Sep-2013 Jeff Sharkey <jsharkey@android.com> Remember mode and sort on per-directory basis.

Persist the last user-selected list/grid mode and sort order for
each directory. Remembered user choice always overrides provider
hinting.

Filter out recent documents that don't match requested MIME type, and
show recents in grid mode when picking images. Hide mode and sort
order in recents.

Add hinting flag for backend to indicate a directory would like to be
sorted by last modified. Include explicit root in DocumentStack and
clearly mark derived fields.

Bug: 10392047, 10608506
Change-Id: I2dd3a0e4112852ebf87e7dbb08b3781c86587dcf
/frameworks/base/packages/DocumentsUI/src/com/android/documentsui/DocumentsActivity.java
28c05ee8931cecf4c51c470e0043d30196010c49 06-Sep-2013 Jeff Sharkey <jsharkey@android.com> Item layout tweaking, hook up more assets.

Update layouts for items in both list and grid mode to reflect
latest UX. Use new card background in grid mode, and apply gradient
treatment over thumbnails.

Visibly mark currently selected root.

Bug: 10510022
Change-Id: I36b290d7082b5cdfd7b3167df7d976032bc01bd6
/frameworks/base/packages/DocumentsUI/src/com/android/documentsui/DocumentsActivity.java
6d97d3c1a2ebac4e3f32c7e5bc134864ace1c17f 06-Sep-2013 Jeff Sharkey <jsharkey@android.com> Another asset drop, provider icons, tests.

Latest asset update, including provider icons which are treated as
special cases for now instead of checking into separate apps. Add
tests for MIME type matching of roots. Remove unused XML.

Bug: 10510022
Change-Id: Id567a9e06ba241f60ac011823e550253c6c797fb
/frameworks/base/packages/DocumentsUI/src/com/android/documentsui/DocumentsActivity.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/packages/DocumentsUI/src/com/android/documentsui/DocumentsActivity.java
ded77187ef53341765fcab8e29cda94810fc2ca5 03-Sep-2013 Jeff Sharkey <jsharkey@android.com> Updated documents UX around action bar.

Change action bar to match current design; drawer is always available
and navigation dropdown is used to interact with current traversal
path in hierarchy. On first launch, show recents with drawer
expanded. On subsequent launches, resume from last location with
drawer closed. If last location root isn't applicable, then behave
like initial launch. Move sort order into action bar submenu.

Delete documents using contract. Use unstable provider when
inflating DocumentInfo from Uri.

Bug: 10330219, 10510851
Change-Id: I6e94637d70ebca156a6c5d50272e878156d0dd62
/frameworks/base/packages/DocumentsUI/src/com/android/documentsui/DocumentsActivity.java
348ad6866b91afa4d59d45df533ef88094c74d13 03-Sep-2013 Jeff Sharkey <jsharkey@android.com> Filter roots based on incoming request.

When incoming request is for local-only content, or for ACTION_CREATE,
only include roots advertise those features.

Filters roots based on the allowed MIME types and the supported types
advertised by each root. This supports displaying Images and Audio
roots only when requesting those content types. Applies the same
filter when deciding which roots to query for recents.

Fixes advanced filtering instead of limiting to just devices. Update
sorting so that Recent always appears first. Add testing support for
LOCAL_ONLY.

Bug: 10597317, 10526535
Change-Id: Ic5ccf475c4fe93fd52b29388d369d7f6915c0c42
/frameworks/base/packages/DocumentsUI/src/com/android/documentsui/DocumentsActivity.java
b51331116eb2ebbc41aaf69142916f9af6dffdd5 02-Sep-2013 Jeff Sharkey <jsharkey@android.com> Instance state, fix sharing, Durable objects.

Remember instance state across configuration changes, and enable
rotation. This remembers current modes and in-progress traversals.

Always finish action modes after launching an action. Fix sharing
by always putting Uris in extras, and always wrap in a chooser. Find
common MIME types when sharing multiple documents. Fix downloads
launching by following directory MIME type change.

Introduce "Durable" which is like Parcelable, but can be used for
both byte[] storage and Parcel transport. Make both DocumentInfo
and DocumentStack durable.

Disable recents until new behavior is implemented.

Bug: 10460236, 10446265, 10533674, 10456344, 10456702
Change-Id: I4eaf2b0b4cde611c69a1e7b5f1586f6b02019b27
/frameworks/base/packages/DocumentsUI/src/com/android/documentsui/DocumentsActivity.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/packages/DocumentsUI/src/com/android/documentsui/DocumentsActivity.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/packages/DocumentsUI/src/com/android/documentsui/DocumentsActivity.java
bd3b902567b09379e1b62c60b3319ad82102efad 21-Aug-2013 Jeff Sharkey <jsharkey@android.com> Add CancellationSignal support to file operations.

Since ContentProvider file operations can end up doing substantial
network I/O before returning the file, allow clients to cancel their
file requests with CancellationSignal.

Ideally this would only be needed for openFile(), but ContentResolver
heavily relies on openAssetFile() and openTypedAssetFile() for common
cases.

Also improve documentation to mention reliable ParcelFileDescriptors
and encourage developers to move away from "rw" combination modes,
since they restrict provider flexibility. Mention more about places
where pipes or socket pairs could be returned.

Improve DocumentsContract documentation.

Bug: 10329944
Change-Id: I49b2825ea433eb051624c4da3b77612fe3ffc99c
/frameworks/base/packages/DocumentsUI/src/com/android/documentsui/DocumentsActivity.java
4eb407a832b7d6a2d62a535e5cab70b00a0bc8ed 19-Aug-2013 Jeff Sharkey <jsharkey@android.com> Management actions, invalidate caches.

In manage mode, touching launches a VIEW intent for the file. Also
adds actions for sharing and deleting.

Move roots and thumbnail caches into Application object, and flush
cache when thumbnail size changes. Listen for package changes and
broadcasts that should invalidate our roots cache.

Pick default grid/list mode based on provider hint.

Bug: 10329983, 10330210, 10378834, 10330069
Change-Id: I75afb1c58ab71bb9d55852b1059da7257a376248
/frameworks/base/packages/DocumentsUI/src/com/android/documentsui/DocumentsActivity.java
a5599ef636e37cb0b6474349936999be1afe6987 16-Aug-2013 Jeff Sharkey <jsharkey@android.com> Documents management mode; API adjustment.

Create documents manage mode to support Downloads and transient
storage devices. Locks user into requested backend root, and forces
file sizes on and sorting by last modified.

Separate API constants for Documents versus Roots, and give concrete
MIME types for roots.

Treat null sizes as unknown. Documents are always enabled in list
so that divider is drawn. Mark external storage file as writable.

Bug: 10329983, 10332993, 10332952
Change-Id: I05f4fdf5b04041a38e1ba7fb30202a3b0c615bf6
/frameworks/base/packages/DocumentsUI/src/com/android/documentsui/DocumentsActivity.java
54ca29a5b94c2edf461c5433825d4ae17469fd7c 15-Aug-2013 Jeff Sharkey <jsharkey@android.com> DocumentsUI handles GET_CONTENT; hinting, errors.

Document browser now takes over all GET_CONTENT requests that request
openable Uris. It shows both storage backends and includes other apps
that respond to GET_CONTENT. Only grants transient read permissions.

Better guarding against throwing storage backends. Send sort order
and local-only hinting to backends.

Require that OPEN/CREATE_DOC users include openable category.

Bug: 10330112, 10329976, 10340741, 10331689, 10329971
Change-Id: Ieb8768a6d71201816046f4a4c48832061a313c28
/frameworks/base/packages/DocumentsUI/src/com/android/documentsui/DocumentsActivity.java
255b4a6fdb8296e95e6ee57f7155ecc0cb995650 09-Aug-2013 Jeff Sharkey <jsharkey@android.com> Always include a default DocumentStack.

Change-Id: Idbde1d832ac95c4b3c8bd5cd82b0fa695e0bcb6d
/frameworks/base/packages/DocumentsUI/src/com/android/documentsui/DocumentsActivity.java
0c2d31bfa113c2848620ac05c916802410b71da1 08-Aug-2013 Jeff Sharkey <jsharkey@android.com> Better handling of broken storage providers.

Begin throwing FNFE when storage provider doesn't know about document
or when it's having trouble. Treat all provider errors as FNFE and
avoid crashing our UI.

Change-Id: I946f1ae4125791999464dc4ce494853d5d1c0629
/frameworks/base/packages/DocumentsUI/src/com/android/documentsui/DocumentsActivity.java
9fb567b59112f99e64e0bff6f343188331bad28d 08-Aug-2013 Jeff Sharkey <jsharkey@android.com> Settings, replace files, sorting by size, tweaks.

Add settings to show file sizes and advanced storage devices, both
disabled by default. Add sorting by size when enabled in settings.

Always show all documents, but only allow selection when they match
MIME filter. When creating, select entire filename on focus. When
creating, treat selected documents as replacement targets using that
exact Uri unless display name is changed.

Show available bytes for device roots. Show empty text label in
empty directories. Split grid backend and details into two separate
lines. Fix path label ordering when rendering recent directories.

Change-Id: I44c62e8adb8ca7d4355510a13d1ba975196a2d29
/frameworks/base/packages/DocumentsUI/src/com/android/documentsui/DocumentsActivity.java
b156f4bf8cdfe475a7116b627d84a281e1a281b7 07-Aug-2013 Jeff Sharkey <jsharkey@android.com> Recents in create, uniform item layouts.

Show recent directories in a separate fragment, and save as serialized
versions of new DirectoryStack. Cleaner behavior around recents and
search, instead of treating them as pseudo-Documents.

More uniform item layouts between list and grid, including both date
and size information, and originating storage root in recents. Avoid
clashing directory loaders by assigning unique numbers. Promote
list/grid switching up into activity.

Change-Id: I9a93460b896067ca036d7e772eeabde31face2e1
/frameworks/base/packages/DocumentsUI/src/com/android/documentsui/DocumentsActivity.java
66516697a29cf00d93893a1011d3befc7c1ee37f 06-Aug-2013 Jeff Sharkey <jsharkey@android.com> Storage roots in fragment, sectioned.

Move storage roots into a fragment, since it's not a drawer on
tablets. Cluster and sort roots when displaying. SectionedListAdapter
to make clustered roots easier to manage. Add docs for root types.

Move roots cache into separate class to make it easier to share.

Change-Id: Ia0b92eade059e816324641f600c08026c0e268c9
/frameworks/base/packages/DocumentsUI/src/com/android/documentsui/DocumentsActivity.java
ef7184a1aa0be5d496a5cb495a0f9e11f342af44 06-Aug-2013 Jeff Sharkey <jsharkey@android.com> More recents work; filtering and sorting.

Update DirectoryFragment to render List<Document>, making it more
general purpose. Feed it documents either from a backend Cursor or
after resolving fields from a recents Cursor. Start in recents when
no persisted stack available. Synthesize a root for recents.

Local directory filtering and sorting using predicates and
comparators, all performed on background thread. Introduce
UriDerivativeLoader which handles ContentObserver updates while
producing a derivative work of a Cursor.

Split data model classes into separate files.

Change-Id: Idb88b4ee22c58c8e508328e678877f7e4c978533
/frameworks/base/packages/DocumentsUI/src/com/android/documentsui/DocumentsActivity.java
dc2963aecaf38bf53d6de82957412a486049c207 03-Aug-2013 Jeff Sharkey <jsharkey@android.com> Track and persist directory stacks; recents work.

Move to manual tracking of directory navigation stack so we have Uri
data to persist, instead of opaque fragment backstack. Remember
directory stacks across launches on a per-app basis.

Start recording recently opened and created files. Uniform Uri
parameter extraction utility methods in contract.

Change-Id: I79ed30ee10272bf7c53d339e797639c993f649bb
/frameworks/base/packages/DocumentsUI/src/com/android/documentsui/DocumentsActivity.java
92d7e697a864a3e18bef4ef256bb3eb339a66b4e 02-Aug-2013 Jeff Sharkey <jsharkey@android.com> Reference docs by ROOT_ID and DOC_ID; recents.

The same document may be present with different sematics under
multiple storage roots, so always reference using both ROOT_ID and
DOC_ID. This enables backends to revoke permissions for an entire
root, such as when an account is removed.

Start building provider to remember recently accessed documents.

Change-Id: I75befa2e61393dec12fcc7fd27f631fcddae46fa
/frameworks/base/packages/DocumentsUI/src/com/android/documentsui/DocumentsActivity.java
7e258b31e70464bb6d80b8b42f0cef8e4417bd6a 01-Aug-2013 Jeff Sharkey <jsharkey@android.com> XML metadata for storage backend; custom icons.

Introduce XML metadata for storage backends, used to indicate if
custom roots should be queried, and provide any custom MIME type
icons inside that backend.

Parse metadata and resolve custom icons in UI.

Change-Id: Iec026c0b10845edff7a345d9389691ddf2c87a0e
/frameworks/base/packages/DocumentsUI/src/com/android/documentsui/DocumentsActivity.java
bc2971d2499f5bf5534ced7296ece630ca902738 01-Aug-2013 Jeff Sharkey <jsharkey@android.com> Sliding drawer for roots, move sorting, search.

Move backend root exploration into sliding drawer, and adjust action
bar when moving between modes. Moves sorting into action bar spinner
instead of separate dialog. Also add initial search support.

Change-Id: I70189911ba56ae6bd93d5c503a8600acd6d6c0c5
/frameworks/base/packages/DocumentsUI/src/com/android/documentsui/DocumentsActivity.java
20d96d8aff2193d548977e23ce5158657cac94e0 31-Jul-2013 Jeff Sharkey <jsharkey@android.com> Define storage roots, external GUIDs, creation.

Allow storage backends to publish multiple roots into the UI, which
are defined by a directory GUID, type, and label details. Update
external provider to surface a primary external storage root, and
switch to burning file path into the returned GUIDs so they remain
durable.

Added insert, update, and delete support to external provider. Adds
file extensions to display names when needed to match MIME type.

Add flags for searching and deletion, and extras for Cursor
pagination. Add directory creation dialog to UI. Opening a document
always gives write access.

Change-Id: I9bea1aa0dcde909a5ab86aefeece7451ab920cf1
/frameworks/base/packages/DocumentsUI/src/com/android/documentsui/DocumentsActivity.java
1482789374fb8da3abea8f6f4f272a67205b95db 02-Jul-2013 Jeff Sharkey <jsharkey@android.com> Support sorting in storage UI.

Extract mode information into DisplayState which is now consistent
across directory traversal. Use grid mode by default when working
with images. Dialog to switch sort order.

Add testing UI to exercise until we have real clients.

Change-Id: Ic423584d4559732fb3d2aea9e0406b57d43f6e6d
/frameworks/base/packages/DocumentsUI/src/com/android/documentsui/DocumentsActivity.java
be8b12e687bd10a526b1f54c2d8a52abdad15d85 02-Jul-2013 Jeff Sharkey <jsharkey@android.com> Support multi-select in storage UI.

When caller has specified that multiple documents are okay, enable
multi-select action mode. Currently only allows document selection,
not directories. Returns multiple documents through ClipData.

Fix bug where GridView was stuck with 2 columns on tablets.

Change-Id: Id49b29a86330639b56fa116d37e7f0d874980c5b
/frameworks/base/packages/DocumentsUI/src/com/android/documentsui/DocumentsActivity.java
54e55b740fef1be654c3959aee41ef5ddfa61293 01-Jul-2013 Jeff Sharkey <jsharkey@android.com> Iterate on storage UI.

Support both grid and list view of documents. Show breadcrumb
navigation trail in action bar. Start supporting file and directory
creation.

Change-Id: I93a973da7b0d4387a57fe719e7bb20944adb0290
/frameworks/base/packages/DocumentsUI/src/com/android/documentsui/DocumentsActivity.java
9e0036ed7d3260d79cc5f9ffd8e3bbe760699924 27-Apr-2013 Jeff Sharkey <jsharkey@android.com> External storage provider, document picker UI.

Continuing to flesh out storage backends by adding an external
storage document backend. Still rough, but it can traverse files
and directories.

Early pass at OPEN/CREATE_DOC picker UI, which offers to traverse
any known storage backends. Supports opening subdirectories and
returning a picked file.

Change-Id: Idc3554036b3816a93d9b465ee8a620746859d2ae
/frameworks/base/packages/DocumentsUI/src/com/android/documentsui/DocumentsActivity.java