169 Commits

Author SHA1 Message Date
Felipe Leme
b012f913cb Initial implementation of OPEN_EXTERNAL_DIRECTORY.
It opens a an alert dialog that tells user application X is requesting
access to folder Y on volume Z; if user accepts, it returns the proper
URI, otherwise it returns RESULT_CANCELED.

The requested path must satisfy the following requirements:

1.It's directory (getName()) must be one of the pre-definied folders on
  Environment.
2.It's root (getParent()) must be a valid external storage root.

In order to satisfy #2, DocumentsUI calls the ExternalStorageProvider,
through a custom call() implementation.

BUG:  23011462
Change-Id: I8e491e82ae320df88f7b8923286c4c1ad050ae80
2016-01-27 08:52:58 -08:00
Tomasz Mikolajewski
d46ecbcc53 Add support for multi-parents to DocumentsProvider::moveDocument.
Bug: 26481380
Change-Id: I96290268fd49072a334bde9c04c5313de8540f56
2016-01-26 17:02:22 +09:00
Tomasz Mikolajewski
7e326a867c Wire thumbnails in archives in ExternalStorageProvider.
Bug: 20176812
Change-Id: Ibf421df1c26583b4b7c3a8516eac79ea0ef31ec3
2015-12-22 13:00:04 +09:00
Tomasz Mikolajewski
68dec40633 Add support for archives to ExternalStorageProvider.
Bug: 20176812
Change-Id: If27cf7d6198d0abcd4458bfbfd27f870ad6d8f30
2015-12-21 09:22:38 +09:00
Geoff Mendal
c84c25f87c Import translations. DO NOT MERGE
Change-Id: Ieddc3162078822f693c29b9a3df2b4e9577fbca9
Auto-generated-cl: translation import
2015-12-16 05:31:09 -08:00
Geoff Mendal
5b0efb551e Import translations. DO NOT MERGE
Change-Id: I155086153a515040b16b3643b4bf40400fcbd922
Auto-generated-cl: translation import
2015-11-30 05:23:55 -08:00
Geoff Mendal
cb37f2566e Import translations. DO NOT MERGE
Change-Id: Iede8cc7c1f459d1f3506dce88dc435c7b5f85ee7
Auto-generated-cl: translation import
2015-11-25 05:18:41 -08:00
Geoff Mendal
569a7ab571 Import translations. DO NOT MERGE
Change-Id: I5eb347309ecaa015fb1486196e7600ab98d06b67
Auto-generated-cl: translation import
2015-11-23 05:33:01 -08:00
Steve McKay
c6a4cd8c0f Add "Home" directory support.
Update FilesActivityUiTests to verify Home is present
    and that clicking a root sets the title accordingly.
Guard addition of WRITABLE flag with a volume test.

Bug: 25147243
Change-Id: Ic20372737cae08a82af0aade0c0dbbd8c22d5f34
2015-11-19 15:56:05 -08:00
Tomasz Mikolajewski
2273e0f095 Implement efficient move on Internal Storage.
Bug:24884813
Change-Id: I5a8dfeb13313a3e60ba2993643eb547adca7b851
2015-11-05 13:12:32 +09:00
Jeff Sharkey
d3af58e217 am 4296209d: am 3d65dcbc: am 58843059: am e69ff2a8: Merge "Clean stale entries when deleting files." into mnc-dr-dev
* commit '4296209de579b97accfce90b3972c8df7a93a911':
  Clean stale entries when deleting files.
2015-09-30 20:36:43 +00:00
Jeff Sharkey
3d65dcbcec am 58843059: am e69ff2a8: Merge "Clean stale entries when deleting files." into mnc-dr-dev
* commit '588430591b7bb5340ff02f05f1c02eaf924326ad':
  Clean stale entries when deleting files.
2015-09-30 20:21:11 +00:00
Jeff Sharkey
588430591b am e69ff2a8: Merge "Clean stale entries when deleting files." into mnc-dr-dev
* commit 'e69ff2a878ee7635a467259995e2924fb96a3a72':
  Clean stale entries when deleting files.
2015-09-30 20:11:17 +00:00
Jeff Sharkey
307d424467 Clean stale entries when deleting files.
When deleting files directly from external storage devices, remove
any matching entries from MediaStore so we don't end up showing
stale entries to clients, such as MTP/PTP.

Also handles the case where an entire directory is deleted.

Bug: 24045921
Change-Id: I802470fa1aa03e0bec147ea113f1a49e26a0f3f9
2015-09-25 10:30:07 -07:00
Baligh Uddin
23b4cd339e Import translations. DO NOT MERGE
Change-Id: Iccdea720e2b636f99e014f195772bff4a0afc149
Auto-generated-cl: translation import
2015-09-18 13:53:19 -07:00
Geoff Mendal
78e8b362b4 Import translations. DO NOT MERGE
Change-Id: I814fdb7d0a8e4738d14f126ba410a48a299a5eb0
Auto-generated-cl: translation import
2015-08-05 05:25:11 -07:00
Jeff Sharkey
0d3ad99d0d am c2ab9313: am 1882e151: am e7477002: am 0eaadbc2: am 5db4cc8f: Merge "Handle volumes without visible paths." into mnc-dev
* commit 'c2ab9313f023741877aeffccc224b3ad7c24678e':
  Handle volumes without visible paths.
2015-07-31 02:22:02 +00:00
Jeff Sharkey
1882e151d8 am e7477002: am 0eaadbc2: am 5db4cc8f: Merge "Handle volumes without visible paths." into mnc-dev
* commit 'e7477002683a83ce3022365fe6c327bbc31055cc':
  Handle volumes without visible paths.
2015-07-31 02:07:45 +00:00
Jeff Sharkey
e747700268 am 0eaadbc2: am 5db4cc8f: Merge "Handle volumes without visible paths." into mnc-dev
* commit '0eaadbc2a9b7350ba839ad14590c34235e42e28b':
  Handle volumes without visible paths.
2015-07-31 01:57:43 +00:00
Jeff Sharkey
865ea7c800 Handle volumes without visible paths.
Transient volumes like USB drives are not mounted as visible, so we
shouldn't be kicking off media scanner for them.

Bug: 22545248
Change-Id: Ic8f2d3134f1edb8b2a12e8ff283eceeeb230f48b
2015-07-30 18:10:39 -07:00
Geoff Mendal
11ee2314d7 Import translations. DO NOT MERGE
Change-Id: I909147c2f995d55d7e8f1a5f62ececd1b311df0a
Auto-generated-cl: translation import
2015-07-22 05:22:34 -07:00
Geoff Mendal
e594671cca Import translations. DO NOT MERGE
Change-Id: I2960b24e8ab390425898ac33034b24ceae260a65
Auto-generated-cl: translation import
2015-07-15 14:02:08 -07:00
Geoff Mendal
7faf046e23 Import translations. DO NOT MERGE
Change-Id: I7ba65aa847a11b79b58d979d791ef1683c7be93b
Auto-generated-cl: translation import
2015-07-11 05:24:05 -07:00
Geoff Mendal
512d903a30 Import translations. DO NOT MERGE
Change-Id: I401f3ce0064d2b404599553678e90113107c4c76
Auto-generated-cl: translation import
2015-07-08 05:17:38 -07:00
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