183 Commits

Author SHA1 Message Date
Jeff Sharkey
2c89a4c170 Rename should behave like create: avoid conflict.
When we create a file that already exists, we try attaching a suffix
like "(1)" to the filename to avoid the conflict.  The newly added
rename method should do the same, since developers may not have
access to delete the conflicting file.

Test: boots, rename via UI, new unit tests
Bug: 31545404
Change-Id: Ie397eebb0fbf98cf079eee3bbbb6c6b7ca627d91
2016-09-21 23:01:25 +00:00
Ben Lin
b56e9213ce Lowercasing search query in ExternalStorageProvider#querySearchDocs.
Bug: 30620314
Change-Id: I4203eda72c94fde11d3973274138ad88edb51e5f
2016-08-03 10:50:31 -07:00
Jeff Sharkey
c50875e42e Build both filename views before deleting.
Otherwise we'll throw when trying to create the second (visible)
filename because we just deleted it.

Bug: 30087518
Change-Id: I940a8f81c264fc17d477fadf46fd48eae29f2f6f
2016-07-15 15:34:44 -06:00
Jeff Sharkey
813f9e8323 Use visible paths when cleaning up MediaStore.
The media scanner always records visible paths, so we need to use
visible paths when cleaning up deleted records.

Bug: 28581384
Change-Id: I8a2c65001216e4a96b2375579363a771de782bcc
2016-07-08 11:18:06 -06:00
Aga Wronska
1719b3555d Add config flag to show/hide internal storage.
Hide internal storage by default.

Revert "Always show intern storage."

This reverts commit 7c4395804e450533afb553ab992c47f737da8a9b.

Bug: 27683276

Change-Id: I04ea8b9a307babcea003f9bec200d41265a42c7f
2016-03-21 17:33:27 -07:00
Geoff Mendal
9f74064a89 Import translations. DO NOT MERGE
Change-Id: Ib91d8ab0bfe8fea69318fd8761ea78851440afc0
Auto-generated-cl: translation import
2016-03-19 13:42:48 +05:30
Steve McKay
ba23e54d26 Show proper icons for SD and USB attached storage.
Use USB icon for MTP devices.

Bug: 26883880
Change-Id: I8ce85ffc915a012dca79a5de1cc7c74361776792
2016-03-03 10:58:36 -08:00
Steve McKay
ecec7cb062 Use device model and name for internal storage.
Bug: 27157923
Change-Id: I1d723e33fa871565fbd187509ffb05f691f030ac
2016-03-02 14:57:12 -08:00
Steve McKay
7c4395804e Always show intern storage.
Only show debug root when devel mode is enabled.
Remove all traces of "advanced".

Bug: 27297398

Change-Id: Ie7e8be282531bd245351d56ababa8ca625c10fd2
2016-03-02 10:47:59 -08:00
Tomasz Mikolajewski
e192cb71d6 Fix crash in isChildDocument when parent is in zip, and child not.
There is no regular file representation for archive documents, so
the call to getFileForDocId(archivedDocId) was throwing an exception.

Bug: 27383423
Change-Id: Icbc1e8ecdddc7698cfdb79b41da6e1d3cecf11ae
2016-03-01 10:23:59 +00:00
Geoff Mendal
0f6ffd807c Import translations. DO NOT MERGE
Change-Id: I6e5ad383334c184105b8eca9baf79db8b0943f66
Auto-generated-cl: translation import
2016-02-22 07:15:15 -08:00
Steve McKay
ab3b8936dc Remove "HOME" directory. Use "Documents" instead.
Use "Folder" as home icon for now.

Bug:27148009
Change-Id: I9f57bba1c8e51ae7887861923f5baa8f69ec2e6e
2016-02-16 14:52:35 -08:00
Steve McKay
efa1761776 Decouple SD card from ADVANCED storage toggle.
A variety of related fixes:
- don't force size enable when browsing from device mounted notifications.
- don't show settings menu item as action (put in overflow).
- add sd card icon (not quite yet used, need to suss that out).

Bug:26880985,26883578,26771127
Change-Id: I36f153c42217f8092f157ded2a756c02525593ab
2016-02-02 09:28:30 -08:00
Steve McKay
5c462a0e31 Create "Home" dir instead of "home" to match other default dirs.
Add DIRECTORY_HOME to android.os.Environment...use that for dir name,
    so we don't use a localized name when creating directory.
Mark all of the DIRECTORY_* fields final.

Bug: 26814341
Change-Id: I5a11bcb180674c619de2f5ce9ed598521e60cc25
2016-02-01 14:46:34 -08:00
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