122 Commits

Author SHA1 Message Date
Baligh Uddin
e20c6704b3 Import translations. DO NOT MERGE
Change-Id: Id3da3bdc18533f885bd34e4afa40c6479a6a0413
Auto-generated-cl: translation import
2014-07-05 14:12:45 -07:00
Baligh Uddin
a5e3d25fd8 Import translations. DO NOT MERGE
Change-Id: Ia29fa1cb6cdd0135a0120ca2f5c2e14432a4b158
Auto-generated-cl: translation import
2014-06-30 14:36:10 +00:00
Jeff Sharkey
b9fbb7290b 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
2014-06-09 17:07:58 -07:00
Jeff Sharkey
9f561c367b Merge "Support for renaming documents." 2014-05-22 05:45:29 +00:00
Jeff Sharkey
b7e1255d5c 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
2014-05-21 22:24:45 -07:00
Baligh Uddin
6343e4da7c Import translations. DO NOT MERGE
Change-Id: Icef6a475d648a2970d5918e9ab7abe98cf676117
Auto-generated-cl: translation import
2014-05-20 09:03:51 -07:00
Jeff Sharkey
3e5991c1eb am 21de56a9: Add directory selection to DocumentsProvider.
* commit '21de56a94668e0fda1b8bb4ee4f99a09b40d28fd':
  Add directory selection to DocumentsProvider.
2014-04-23 07:15:32 +00:00
Jeff Sharkey
21de56a946 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
2014-04-22 22:18:21 -07:00
Baligh Uddin
2b2eadd0f8 Import translations. DO NOT MERGE
Change-Id: Ic7a9bdd8f8da2462638e3abf361ef938d1fb2a9e
Auto-generated-cl: translation import
2014-03-19 10:24:06 -07:00
Baligh Uddin
38bae539f8 Remove deprecated locales
Bug:11340849
Change-Id: Ib99486303927a6bce308b113d70f8e5b5bce4a13
2013-12-09 22:41:12 +00:00
Jeff Sharkey
d5a9fb067c am 874dfd73: am 34163e82: am 55d12486: Merge "Give storage provider access to secondary devices." into klp-dev
* commit '874dfd733a2fd2224f155ee2c4cf5e3065676402':
  Give storage provider access to secondary devices.
2013-11-11 20:51:48 -08:00
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
9186827629 am 66d079bf: am f7eb3398: am 19949b9d: Merge "Guard against missing document columns." into klp-dev
* commit '66d079bf25ff3f99dbba91e02d392c936238170b':
  Guard against missing document columns.
2013-10-29 12:01:44 -07: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
2e05b6777a am e643e337: am 99dcb2eb: am 10e509dc: Merge "Use inotify to update DocumentsUI." into klp-dev
* commit 'e643e33736e14a59f1f9a8acb4d630b2ea671a31':
  Use inotify to update DocumentsUI.
2013-10-28 10:00:09 -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
8b5f453a82 am de9b66fe: am 3ac436b7: am 80f103ae: Merge "Extra to always show advanced devices." into klp-dev
* commit 'de9b66fee1bdbc914c287fb9a2aa832dc2d3e6f9':
  Extra to always show advanced devices.
2013-10-25 18:22:22 -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
8e0164c566 am 46106ca2: am 686fa2db: am c832ef0d: Merge "Show spinner while waiting for mutations." into klp-dev
* commit '46106ca28e8a679ce2f0609d03ae6ba4b95d7f30':
  Show spinner while waiting for mutations.
2013-10-24 12:40:07 -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
ae25a1a89b am 05f92b7c: am 6599c128: am 871cb5d5: Merge "Update roots when data cleared, refresh UI." into klp-dev
* commit '05f92b7c5810dfc4e96cd5dddff1f7f380739136':
  Update roots when data cleared, refresh UI.
  Treat document thumbnails as preemptable.
2013-10-23 11:18:35 -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
eeb58c79c0 am 703840da: am 1a5804d7: am 0c0f1e2e: Merge "Include external storage devices in DocumentsUI." into klp-dev
* commit '703840da8a33c703f2d787526438c650b0318845':
  Include external storage devices in DocumentsUI.
2013-10-17 18:55:22 -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
d70d2d8ee3 am 25b99efb: am ac0cb359: am 8e656df0: Merge "Add extras to AFD, send orientation metadata." into klp-dev
* commit '25b99efb3259c9f6d7bcdacd3cb2bafd6b1a0e63':
  Add extras to AFD, send orientation metadata.
2013-10-15 04:02:48 -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
c69cf32252 am 416165f4: am ce05cbc5: am 6e19feb4: Merge "Treat dates near epoch as unknown." into klp-dev
* commit '416165f4313ac2deea430030ff44d9da0388b8bc':
  Treat dates near epoch as unknown.
2013-10-11 12:55:26 -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
5b6372171c am 9d1383c6: am 5e02e0a9: am bcc77b50: Merge "Add <intent-filter> support to <provider>." into klp-dev
* commit '9d1383c61ca0932cb36b104a89c32db15de6a10e':
  Add <intent-filter> support to <provider>.
2013-10-07 15:16:14 -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
ba0591c9e3 am 21d8e96d: am ef4c3790: am 27d3c0fe: Merge "Isolate calls to each remote DocumentsProvider." into klp-dev
* commit '21d8e96d840be42fae56483a2e291fc10677b2d9':
  Isolate calls to each remote DocumentsProvider.
2013-10-02 10:15:14 -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
b6ab3b982b am 7f60e70e: am 666b998b: am 364fc14f: Merge "Detect wedged ContentProviders, treat as ANR." into klp-dev
* commit '7f60e70e815d381035b141843395830407c198d9':
  Detect wedged ContentProviders, treat as ANR.
2013-10-02 09:43:21 -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
b8e2f178e9 am cc637d9a: Merge "New roots UX, async, performance, docs." into klp-dev
* commit 'cc637d9ae5920ac2f685090f595dc1e1643d71cc':
  New roots UX, async, performance, docs.
2013-09-30 14:17:44 -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
8aa0c34483 am cd30bb6c: am bb77d99c: Merge "Directories are always enabled; update assets." into klp-dev
* commit 'cd30bb6c710d40839bc8b4d6edcb866f13342b5a':
  Directories are always enabled; update assets.
2013-09-26 11:05:44 -07:00