77 Commits

Author SHA1 Message Date
Jeff Sharkey
874dfd733a am 34163e82: am 55d12486: Merge "Give storage provider access to secondary devices." into klp-dev
* commit '34163e8259db8661afbb267e3b899b64f429bcb7':
  Give storage provider access to secondary devices.
2013-11-11 15:22:37 -08:00
Jeff Sharkey
7e1f5410ff Give storage provider access to secondary devices.
Bug: 11411460
Change-Id: I3827ed5b859a68c60742a27917459e8df2c276bb
2013-11-11 14:36:33 -08:00
Jeff Sharkey
66d079bf25 am f7eb3398: am 19949b9d: Merge "Guard against missing document columns." into klp-dev
* commit 'f7eb3398f16f4d76d2a342cf571040360d5a6df6':
  Guard against missing document columns.
2013-10-29 11:58:21 -07:00
Jeff Sharkey
5d321d472d Guard against missing document columns.
When filtering and sorting, guard against missing columns to avoid
crashing entire app.

Bug: 11377065
Change-Id: I04f035c918d743bcc84592f05e3ef9ad0ebfadce
2013-10-29 11:48:30 -07:00
Jeff Sharkey
e643e33736 am 99dcb2eb: am 10e509dc: Merge "Use inotify to update DocumentsUI." into klp-dev
* commit '99dcb2eb3578c3d14658b3850cb3e32608e173b1':
  Use inotify to update DocumentsUI.
2013-10-28 09:57:20 -07:00
Jeff Sharkey
de9b66fee1 am 3ac436b7: am 80f103ae: Merge "Extra to always show advanced devices." into klp-dev
* commit '3ac436b758830eb938c62d5ed91caa7808b5b63e':
  Extra to always show advanced devices.
2013-10-25 18:17:52 -07:00
Jeff Sharkey
db5ef12500 Use inotify to update DocumentsUI.
While user is actively looking at a directory, subscribe to inotify
events and notify of content changes to trigger requeries.  Reference
count the observers, since multiple cursors are regularly open during
requeries.

Fix leaking cursors on activity rotation; crazy loader ID generation
is no longer needed.

Bug: 10999396
Change-Id: Iddeb08a056fee80c93df8499874705bcd213a1e2
2013-10-25 17:51:04 -07:00
Jeff Sharkey
96c620595b 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
2013-10-25 16:30:54 -07:00
Jeff Sharkey
46106ca28e am 686fa2db: am c832ef0d: Merge "Show spinner while waiting for mutations." into klp-dev
* commit '686fa2db5b8feeb9e378aeb8e5dbac2f79ef2153':
  Show spinner while waiting for mutations.
2013-10-24 12:35:22 -07:00
Jeff Sharkey
04d45a0bdd 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
2013-10-23 15:48:05 -07:00
Jeff Sharkey
75b96875be am 3a27585d: am a9a6007c: Merge "Treat document thumbnails as preemptable." into klp-dev
* commit '3a27585df77997b5ea01a086b739ee6866000444':
  Treat document thumbnails as preemptable.
2013-10-23 11:13:01 -07:00
Jeff Sharkey
b3d42635aa Treat document thumbnails as preemptable.
When a more important request comes along, preempt all outstanding
thumbnail requests.

Bug: 11317901
Change-Id: I164fc8d804bb9c471e6da3f8127228043b3ca482
2013-10-23 09:23:13 -07:00
Jeff Sharkey
703840da8a am 1a5804d7: am 0c0f1e2e: Merge "Include external storage devices in DocumentsUI." into klp-dev
* commit '1a5804d7aa253432f37fbd5d8eb89ac363501fe9':
  Include external storage devices in DocumentsUI.
2013-10-17 18:53:26 -07:00
Jeff Sharkey
1f706c6cd1 Include external storage devices in DocumentsUI.
Include volume UUID in generated document IDs to uniquely identify
volumes over time.  Show volume label to users.  Watch for mount
changes to update available roots.

Bug: 11175082
Change-Id: Ia151bde768587468efde0c1d97a740b5353d1582
2013-10-17 10:55:32 -07:00
Jeff Sharkey
25b99efb32 am ac0cb359: am 8e656df0: Merge "Add extras to AFD, send orientation metadata." into klp-dev
* commit 'ac0cb3591a637533c1f0329fd00a621fbe1fd997':
  Add extras to AFD, send orientation metadata.
2013-10-14 19:00:51 -07:00
Jeff Sharkey
c1c8f3f97d Add extras to AFD, send orientation metadata.
AssetFileDescriptor augments a ParcelFileDescriptor with details
about how it should be interpreted, so extend it to support a Bundle
of extras.  Then use these extras to share thumbnail orientation
metadata.

The raw image data of EXIF thumbnails matches the orientation of
the enclosing image, but the thumbnail data doesn't repeat the EXIF
flags.  This meant that receivers of openDocumentThumbnail() would
get an image that needed to be transformed, but without enough
context to actually transform it.

Instead of transforming and recompressing the image on the fly on
the provider side, send a transformation hint that the receiver
side can interpret.

Bug: 11205688
Change-Id: Ibc5a7ad002377a55e6ffcb5ac5c8829841002e06
2013-10-14 15:28:19 -07:00
Jeff Sharkey
416165f431 am ce05cbc5: am 6e19feb4: Merge "Treat dates near epoch as unknown." into klp-dev
* commit 'ce05cbc5ec52417f1f927be2b3d9b93e0881a4d9':
  Treat dates near epoch as unknown.
2013-10-11 12:50:12 -07:00
Jeff Sharkey
d5a4658cea Treat dates near epoch as unknown.
Also document that rootIds need to be stable, so removable media
roots should use the media serial number.

Bug: 11151557
Change-Id: I1f3dcabcd0474f1bf92d2cafb0f37e82abe34e05
2013-10-11 09:49:05 -07:00
Jeff Sharkey
9d1383c61c am 5e02e0a9: am bcc77b50: Merge "Add <intent-filter> support to <provider>." into klp-dev
* commit '5e02e0a9e1e075e3d451d929b0a67bf280c432ed':
  Add <intent-filter> support to <provider>.
2013-10-07 15:12:16 -07:00
Jeff Sharkey
85f5f81320 Add <intent-filter> support to <provider>.
For the new documents work, we're only interested in the subset of
ContentProviders that actually implement DocumentsContract.  Instead
of returning all providers, add <intent-filter> support to make it
easier to limit the set of returned ProviderInfo.

Define a well-known action for DocumentsProviders, and start using it
when querying for roots.  Continue supporting the old <meta-data>
approach until all apps have been updated.

Bug: 8599233
Change-Id: I05f049bba21311f5421738002f99ee214447c909
2013-10-07 14:19:13 -07:00
Jeff Sharkey
21d8e96d84 am ef4c3790: am 27d3c0fe: Merge "Isolate calls to each remote DocumentsProvider." into klp-dev
* commit 'ef4c3790e52beab467359f6b5125b66fbe1993ef':
  Isolate calls to each remote DocumentsProvider.
2013-10-02 10:11:18 -07:00
Jeff Sharkey
7f60e70e81 am 666b998b: am 364fc14f: Merge "Detect wedged ContentProviders, treat as ANR." into klp-dev
* commit '666b998b67fe7bb6fc11dd6d683a18b5690afd39':
  Detect wedged ContentProviders, treat as ANR.
2013-10-02 09:35:14 -07:00
Jeff Sharkey
d01571e6d4 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
2013-10-02 08:54:02 -07:00
Jeff Sharkey
7aa7601c09 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
2013-10-01 09:50:41 -07:00
Jeff Sharkey
a2c42861a1 am cc637d9a: Merge "New roots UX, async, performance, docs." into klp-dev
* commit 'cc637d9ae5920ac2f685090f595dc1e1643d71cc':
  New roots UX, async, performance, docs.
2013-09-30 17:09:48 -07:00
Jeff Sharkey
6efba22ce5 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
2013-09-27 17:13:13 -07:00
Jeff Sharkey
cd30bb6c71 am bb77d99c: Merge "Directories are always enabled; update assets." into klp-dev
* commit 'bb77d99c257bc4a3371548c4bc8ba7088fa76005':
  Directories are always enabled; update assets.
2013-09-26 11:00:48 -07:00
Jeff Sharkey
2a030b05a9 Directories are always enabled; update assets.
Fix bug where item enabled state depended on FLAG_SUPPORTS_WRITE;
directories are now always enabled.  Also unifies enabled testing.

Bug: 10903210, 10946731
Change-Id: I241533d273dfe4a2146bb322a8bd93066bf4ef55
2013-09-26 10:54:19 -07:00
Jeff Sharkey
b8a48da2a7 am 5e1a5e5b: Merge "Create unique files, root ordering, UI bugs." into klp-dev
* commit '5e1a5e5bad475696e842addceb7dd6a519879f98':
  Create unique files, root ordering, UI bugs.
2013-09-22 12:57:20 -07:00
Jeff Sharkey
5e1a5e5bad Merge "Create unique files, root ordering, UI bugs." into klp-dev 2013-09-22 19:55:19 +00:00
Jeff Sharkey
5545f56f75 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
2013-09-21 14:07:16 -07:00
Adam Lesinski
a35ff66127 am d473ebb7: Merge "Surfaces ParcelFileDescriptor#parseMode() as API" into klp-dev
* commit 'd473ebb7c4f212cb9f74fe748bb8b95d7d126417':
  Surfaces ParcelFileDescriptor#parseMode() as API
2013-09-20 16:01:34 -07:00
Adam Lesinski
d473ebb7c4 Merge "Surfaces ParcelFileDescriptor#parseMode() as API" into klp-dev 2013-09-20 22:59:12 +00:00
Adam Lesinski
eb8c3f93ed Surfaces ParcelFileDescriptor#parseMode() as API
Moves ContentResolver#modeToMode() to ParcelFileDescriptor#parseMode()

bug:10711271
Change-Id: I28a5de4ca70adfbec4caf739863b77f0fd7fd9a4
2013-09-20 14:59:34 -07:00
Jeff Sharkey
89dec7e6e9 am a9ce049d: Load RootInfo in background, invalidation.
* commit 'a9ce049db87259e302e2368d2a4a1c11a94fd831':
  Load RootInfo in background, invalidation.
2013-09-19 19:59:22 -07:00
Jeff Sharkey
a9ce049db8 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
2013-09-19 19:53:32 -07:00
Baligh Uddin
59db60e498 Import translations. DO NOT MERGE
Change-Id: I0da9befa56ba6e4a599b5796182898cc7093043d
Auto-generated-cl: translation import
2013-09-18 23:42:59 -07:00
Baligh Uddin
72e8643fdd Import translations. DO NOT MERGE
Change-Id: Icd16c449ff68a89ecd4a36856764d24f5894c9e5
Auto-generated-cl: translation import
2013-09-16 09:47:04 -07:00
Baligh Uddin
31ceae5629 Import translations. DO NOT MERGE
Change-Id: I68895c16a26ecc9554bfc53e9d9346fe29412fec
Auto-generated-cl: translation import
2013-09-14 20:27:22 -07:00
Baligh Uddin
162e88759c Import translations. DO NOT MERGE
Change-Id: Idfb9ef96c1c4ea6fc1ca836114a8eb09be18f8f4
Auto-generated-cl: translation import
2013-09-13 21:47:27 -07:00
Jeff Sharkey
f5513f41fe am 0bf2ed90: Merge "Move search to roots; Documents root; hide empty." into klp-dev
* commit '0bf2ed90c42d3a1f1d4be4b70c337f9eaec9cd14':
  Move search to roots; Documents root; hide empty.
2013-09-13 17:13:56 -07:00
Jeff Sharkey
3e1189b359 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
2013-09-13 11:35:04 -07:00
Jeff Sharkey
c3414dc4ba am 357f9e34: Merge "Handle pipe thumbnails, acquire unstable refs." into klp-dev
* commit '357f9e34ca4f0336e406044db35834530379db47':
  Handle pipe thumbnails, acquire unstable refs.
2013-09-12 09:17:02 -07:00
Jeff Sharkey
de2b22fbc6 Handle pipe thumbnails, acquire unstable refs.
Support decoding thumbnails delivered over pipes by wrapping in a
buffered stream.  Also switch to using unstable provider references
to avoid crashing DocumentsUI.

Bug: 10516148, 10510851
Change-Id: I85f6eeaca70c97742bf79656d1d0c6da381fdd47
2013-09-11 17:33:52 -07:00
Jeff Sharkey
bd56a17df2 am af4d039f: Merge "More UX work for thumbnails, search, management." into klp-dev
* commit 'af4d039fb3a45d4a74683a69ee48071b8338a13d':
  More UX work for thumbnails, search, management.
2013-09-10 17:02:11 -07:00
Jeff Sharkey
4ec973925f 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
2013-09-10 16:40:36 -07:00
Jeff Sharkey
78bb372fb7 am af927234: Merge changes I7b3f4c68,I9f022a08 into klp-dev
* commit 'af9272349fb9eed1653d5af0768c9517e36070a6':
  Rename offer() to add(), remove/hide some APIs.
  Sort order is sticky for session, back leaves.
2013-09-09 21:42:50 -07:00
Jeff Sharkey
b7757a6b32 Rename offer() to add(), remove/hide some APIs.
Change MatrixCursor offer() to add() based on review feedback.  Remove
some now-unused XML metadata.  Hide document creation, since it's not
supported in initial version.

Bug: 10577809, 10461706, 10678563
Change-Id: I7b3f4c6899c28f633471ef816bee22bf032aa0d2
2013-09-09 17:55:10 -07:00
Jeff Sharkey
6874b17d79 am ff44ed58: Merge "Disabled states, more UX work, bug fixes." into klp-dev
* commit 'ff44ed58a1e38ff830e74b0d73549ff01725852d':
  Disabled states, more UX work, bug fixes.
2013-09-09 17:10:24 -07:00
Jeff Sharkey
3f4c205fd3 Disabled states, more UX work, bug fixes.
Fix drawable state to correctly show dimmed disabled state.  Update
disabled state for all children to grey out text.

Block multi-selection of documents not matching MIME filter.  Load
thumbnails in parallel.  Show thumbnails in list mode based on MIME
type to match spec.

Give each footer a unique view type to avoid recycler crashes.

Show breadcrumb icons in recent create paths.  Fix timestamp bug when
querying/updating recent paths.

Make ContentProviderClient.closeQuietly() really be quiet.

Bug: 10668364, 10510022, 10668701, 10534224, 10667726
Change-Id: I3c705412fb211519f15ad41a273a7533b878e9e5
2013-09-09 16:55:35 -07:00