145 Commits

Author SHA1 Message Date
Makoto Onuki
3b31613088 resolved conflicts for merge of 57db559d to master
Change-Id: I645993fe69116f05e2275771b51a36402ba05472
2015-07-06 13:00:51 -07:00
Makoto Onuki
0e301ffa0f am 650a193e: am 164d229a: am dfd6301f: Merge "If user ejects a storage from details, take user to... ... the storage list view" into mnc-dev
* commit '650a193e8b1610938954851e6d855338b44e239d':
  If user ejects a storage from details, take user to... ... the storage list view
2015-07-06 19:00:38 +00:00
Makoto Onuki
14a6df7d76 If user ejects a storage from details, take user to...
... the storage list view

1. Change to ExternalStorageProvider
When available volumes have changed, it now notifies on
"content://com.android.externalstorage.documents" rather than on
"content://com.android.externalstorage.documents/root/", because it'll also
affect "content://com.android.externalstorage.documents/document/*/children".

2. Change to DocumentUI
- DirectoryLoader now won't crash when a provider returns null.
- DirectoryFragment now closes itself (i.e. emulate a back press) when a load
failed.
- It now correctly reloads contents when a volume is ejected thanks to 1.

Bug 21472170

Change-Id: Icf4bbc2ebb9067313dbbb67083cd4115b0a75c58
2015-07-01 15:11:46 -07:00
Geoff Mendal
e7c449e96d Import translations. DO NOT MERGE
Change-Id: If858ee3f281a37d3d371d19ae7af1cfb51b89104
Auto-generated-cl: translation import
2015-07-01 07:20:20 -05:00
Jeff Sharkey
ec9da72a7a am 835a40aa: am 7f39beb2: am a65a1582: Merge "Update file size formatting." into mnc-dev
* commit '835a40aac0600b0ba0e2615a80ba000fedb585e2':
  Update file size formatting.
2015-06-16 05:22:00 +00:00
Jeff Sharkey
7f39beb28e am a65a1582: Merge "Update file size formatting." into mnc-dev
* commit 'a65a1582f5a04b15b53ebdec337ac611ccb78a07':
  Update file size formatting.
2015-06-16 05:01:43 +00:00
Jeff Sharkey
b521feaed4 Update file size formatting.
Per UX, default strings should have space between value and units
resulting in "12.3 GB".  Add a formatting variant that returns the
various components for callers who want to build their own strings.

For now there is only one mounted emulated volume at a time, and
it's always the primary storage, so give it the default rootId to
keep old Uris working.

Change-Id: Ifcc72a91a6b397ee65dc92642153286186eb64ac
2015-06-15 21:39:28 -07:00
Geoff Mendal
70f09b4ef9 Import translations. DO NOT MERGE
Change-Id: I6c36a192af260cddb4e659825037b5727a9c8fcd
Auto-generated-cl: translation import
2015-05-30 19:39:34 -07:00
Geoff Mendal
bcd4a0625e Import translations. DO NOT MERGE
Change-Id: I7b2425050dd88c3e70affc7fed27b57ed1959ddc
Auto-generated-cl: translation import
2015-05-29 20:52:37 -07:00
Ben Kwa
62539a220c Move extension checking code into FileUtils.
Move code for checking file extensions and MIME types from
ExternalStorageProvider into android.os.FileUtils, so it can be used by
other clients (e.g. DownloadsProvider).

BUG=20157955

Change-Id: Ib16a16af723c21fb8d2912c8917dfd68653ea6fa
2015-04-23 16:14:20 -07:00
Geoff Mendal
4614991d85 Import translations. DO NOT MERGE
Change-Id: Ib1c155c8eedd0773a5d973813665792e749dd458
Auto-generated-cl: translation import
2015-04-22 05:24:05 -07:00
Jeff Sharkey
e6c04f9417 Broadcast hidden volumes, notification polish.
Send limited broadcast intent when certain volume state changes
occur; the only customer for now is ExternalStorageProvider.

Change notification flow to be less bumpy.  Pick USB icon based on
disk type, and avoid using "generic" disk labels.

Bug: 19993667
Change-Id: I263bc9e9aae2ae57eb4d1afe76da686aee5475fb
2015-04-18 23:11:00 -07:00
Jeff Sharkey
27de30d31c Wire up non-visible volumes, more states.
Adds logic to ExternalStorageProvider to scan non-visible volumes,
such as USB OTG devices.  We use internal paths when surfacing these
volumes, which also optimizes around the FUSE daemon for public
devices.  Also dumps internal state when requested.

VolumeInfo now directly contains DiskInfo, which means it's
snapshotted when sending events, avoiding teardown races.  Switch
notifications to use this DiskInfo directly.

Finish wiring up new volume state, including helper methods to make
it readable/writable state clearer.  Handle disks and volumes with
spaces in their labels.

Bug: 19993667
Change-Id: I5c75e5658a6415976811477aebafee7694bde0f4
2015-04-18 16:20:30 -07:00
Jeff Sharkey
1407d4c777 DocumentsUI roots can have settings.
Roots use a flag to indicate they have settings, and DocumentsUI
offers to launch towards someone who handles a new Settings intent.

Slight rename of browse intent for clarity.

Bug: 19993667
Change-Id: I86302ec1cfac5e435d8bc5701bdb85fb9b0dcbae
2015-04-12 22:02:44 -07:00
Geoff Mendal
b91a3309b6 Import translations. DO NOT MERGE
Change-Id: I5d8cc25c94f71a9f3f14307fbb2f09e0779f4d6e
Auto-generated-cl: translation import
2015-03-20 23:23:01 -07:00
Jeff Sharkey
2a3ca185bf am 45207128: am 05d455ca: am b9ccc047: Merge "Sanitize display names, keep extensions intact." into lmp-mr1-dev
* commit '45207128c5c4f0d1f106af8561bdd156546b0aad':
  Sanitize display names, keep extensions intact.
2014-12-01 20:07:19 +00:00
Jeff Sharkey
0cce5355b4 Sanitize display names, keep extensions intact.
When creating or renaming files on external storage, sanitize the
requested display names to be valid FAT filenames.  This also fixes
a handful of directory traversal bugs.

Also relax logic around generating display names to allow any
extension which maps to the requested MIME type.  Tests to verify.

Bug: 18512473, 18504132
Change-Id: I89e632019ee145f53d9d9d2050932f8939a756af
2014-12-01 09:38:49 -08:00
Jeff Sharkey
ecee90d989 am 1b632db2: am ea1841a3: Merge "Use default volume description when missing label." into lmp-mr1-dev automerge: cc66a23
* commit '1b632db2074365a7094177f655a4f750807f61f0':
  Use default volume description when missing label.
2014-10-25 02:36:13 +00:00
Jeff Sharkey
c99d00be67 Use default volume description when missing label.
Some mounted storage volumes may not have a user-defined label.  In
those cases, use the default description for the volume.

Bug: 17781505
Change-Id: I8558ba2615c2ff2647a5d44afaec83249df466ab
2014-10-24 13:57:47 -07:00
Baligh Uddin
0c8e8bcb65 Import translations. DO NOT MERGE
Change-Id: I1e4ac2d534b14eac10dd3169981dd6ad668aeaee
Auto-generated-cl: translation import
2014-09-16 13:35:34 -07:00
Baligh Uddin
6e5003da07 Import translations. DO NOT MERGE
Change-Id: I0c6e80b85a255f32a7298c1caf4cde9b41cb8732
Auto-generated-cl: translation import
2014-09-08 15:45:33 -07:00
Jeff Sharkey
ab1e9bddd8 Scan after writing external storage files.
Kicks off media scanner after files are written.

Bug: 13557203
Change-Id: I61613f28e07b068573079cc1e362fd3fe135684e
2014-08-05 18:34:37 +00:00
Baligh Uddin
50af6d7ae6 Remove deprecated locales - DO NOT MERGE
Change-Id: Iac5489639edae2373ed0ce92f7d0fe22629a249a
2014-07-19 13:05:12 -07:00
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