History log of /frameworks/base/packages/DocumentsUI/src/com/android/documentsui/DirectoryLoader.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
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/DirectoryLoader.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/DirectoryLoader.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/DirectoryLoader.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/DirectoryLoader.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/DirectoryLoader.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/DirectoryLoader.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/DirectoryLoader.java
954be0232655d316bc5decbbd35579af902c75c2 04-Sep-2013 Jeff Sharkey <jsharkey@android.com> Show loading, error, and info messages as footers.

A provider can include extras in their Cursors to indicate that
loading is ongoing, or include an error or informational message,
which are now shown in footer views.

Fix registration to always get change notifications.

Test provider that verifies common provider behavior of holding
a reference to "cloud" resources that are released by GC when the
remote Cursor is closed. Also used to validate Recents behavior
for slow providers.

Bug: 10599268
Change-Id: I331c31058dbb80261e7d279b851197c65ac87e32
/frameworks/base/packages/DocumentsUI/src/com/android/documentsui/DirectoryLoader.java
251097b3789632000ccdaf7fb7d66a82ff37d882 03-Sep-2013 Jeff Sharkey <jsharkey@android.com> New recents behavior to match spec.

Updated behavior queries each documents root for recently modified
documents. It uses a new variant of DirectoryLoader which limits the
maximum number of parallel queries to relieve memory pressure. When
first started, it waits up to 500ms for everyone to finish, then
publishes whatever results are ready, and then refreshes results as
each straggler finishes.

New RootCursorWrapper that always blends in authority and rootId
columns, which are used for binding root details from blended cursors.

Bug: 10593596, 10329994
Change-Id: Icc0d4a2f1b6166edc72f78a4c88f444eeba6f2f0
/frameworks/base/packages/DocumentsUI/src/com/android/documentsui/DirectoryLoader.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/DirectoryLoader.java
5dfb345df7cb17b3a7e534a80a270b4afe7934da 01-Sep-2013 Jeff Sharkey <jsharkey@android.com> Use Cursors directly when binding documents.

Instead of creating a DocumentInfo for every list item, bind the
adapter against Cursor directly.

Create new SortingCursorWrapper which performs sorting at query time
and keeps a O(1) mapping from sorted to unsorted positions in the
underlying Cursor.

Suppress extra loader passes that had been kicked off. Use unstable
provider when querying to guard against broken providers.

Bug: 10567506, 10510851
Change-Id: I535814da6b17c38de04a1175e0afcc78c6b966ce
/frameworks/base/packages/DocumentsUI/src/com/android/documentsui/DirectoryLoader.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/DirectoryLoader.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/DirectoryLoader.java
b448660a227f93d7bd5c5d019a21745e67c2f54d 19-Aug-2013 Jeff Sharkey <jsharkey@android.com> Request more documents when EXTRA_HAS_MORE.

Implement EXTRA_HAS_MORE and EXTRA_REQUEST_MORE contract with
document providers. Providers can include EXTRA_HAS_MORE when
additional data is available with additional cost, such as a network
request.

Listen to content changes based on returned cursor instead of
original Uri. Include a test backend to exercise. UX still under
development.

Bug: 10350207
Change-Id: Iaa8954df55a1a1c0aa96eb8a4fd288e12c2fbb01
/frameworks/base/packages/DocumentsUI/src/com/android/documentsui/DirectoryLoader.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/DirectoryLoader.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/DirectoryLoader.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/DirectoryLoader.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/DirectoryLoader.java