213 Commits

Author SHA1 Message Date
Garfield Tan
92b96ba8fc Add internal support to convert a file system path to document URI.
Test: Manual tested with a new sample app in development/samples.

Bug: 30261615
Change-Id: I498a22b248fbc55b33d3efb4aa3183207cfb7bab
2016-11-10 15:51:39 -08:00
Garfield Tan
3f6b68a697 Iteration on findDocumentPath() API.
Rename findPath() to findDocumentPath() per comment in ag/1588156.

Bug: 30948740
Change-Id: I84ef4d9c0ed1f854e0e33f3552a1805b944c2791
2016-11-01 22:07:45 +00:00
Jeff Sharkey
3b699d7841 Public volumes belong to a single user.
When a public (vfat) device is inserted, it's strongly associated
with the current foreground user, and no other users should be able
to access it, since otherwise that would be a cross-user data leak.

To use the device under a different user, switch users and then
eject/remount the device.

Test: verified user isolation of USB drive
Bug: 32523490
Change-Id: I590c791996f1fea8d78f625dc942d149f1f41614
2016-10-31 14:34:24 -06:00
Garfield Tan
06940e1246 Iteration on findPath API.
* Extend this API to take tree URI
* Add toString(), equals() and hashCode() to Path
* Address Jeff's comments in ag/1513538
* Add unit tests for findPath

Bug: 30948740
Change-Id: Iaf852d0e40fae37623e9bb9ffa1c6fbe334c1b21
(cherry picked from commit d4ab7ade7171a4382ef4f61f2a5f078a17800e83)
2016-10-14 19:18:46 +00:00
Garfield Tan
aba97f3c37 Add findPath API to SAF.
Implement it in ExternalStorageProvider.

Bug: 30948740
Change-Id: I1b7717a794ae3892cd1be5ed90ca155adf9a64f4
(cherry picked from commit 51efc73f3f341393cf93f71604be791205021b69)
2016-10-06 17:34:19 +00:00
Garfield Tan
ab52ea0194 Revert "DO NOT MERGE ANYWHERE: Add findPath API to SAF."
This reverts commit 2f6d0d6db3af4451ae209a07c7dd7ee089cc5653.

Change-Id: I0b8581c6d5edb2a47ddfb75afaaa52c43964087b
2016-10-06 17:26:05 +00:00
Garfield Tan
2f6d0d6db3 DO NOT MERGE ANYWHERE: Add findPath API to SAF.
Implement it in ExternalStorageProvider.

Bug: 30948740
Change-Id: I03241cdfa561ef2fc0a0b829c9a59ad845e8f844
(cherry picked from commit 51efc73f3f341393cf93f71604be791205021b69)
2016-10-05 23:28:34 +00:00
Tomasz Mikolajewski
219fa882d1 Remove support for archives from External and Bugreport providers.
Change-Id: Ia281fe05a0a6a5dd6ff1b66d7197312cf4391793
Test: Compiles.
Bug: 31783726
2016-09-28 11:32:59 +09:00
Jeff Sharkey
aa44476f64 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 16:59:24 -06:00
Ben Lin
715ded37a6 Lowercasing search query in ExternalStorageProvider#querySearchDocs. am: b56e9213ce am: 661948b8f0
am: e786712eb6

Change-Id: If3e93245d2c25c68b09a042e1b1b9a8e79a42575
2016-08-19 23:10:17 +00:00
Ben Lin
e786712eb6 Lowercasing search query in ExternalStorageProvider#querySearchDocs. am: b56e9213ce
am: 661948b8f0

Change-Id: Ia5887e196852187c0fc628beb1ba1b5353850694
2016-08-19 23:01:20 +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
8dd615fd07 Merge \"Merge \\"Build both filename views before deleting.\\" into nyc-mr1-dev am: fff6a11438\" into nyc-mr1-dev-plus-aosp
am: 40a4bf7dc1

Change-Id: Iabb5ffbc0ef161bb67d373fd13385e05d88b4179
2016-07-15 23:37:29 +00:00
Jeff Sharkey
ab062fc81f Merge \"Build both filename views before deleting.\" into nyc-mr1-dev
am: fff6a11438

Change-Id: Ie97bade1f8396c3c08f622f2533d42d115568e08
2016-07-15 23:16:35 +00: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
0df84b24e1 Merge \\"Use visible paths when cleaning up MediaStore.\\" into nyc-mr1-dev am: 8ee0a67ba7
am: a637f17150

Change-Id: I0433fd57cb7da13d163eab1fde944cccec9c67bf
2016-07-08 19:21:30 +00:00
Jeff Sharkey
a637f17150 Merge \"Use visible paths when cleaning up MediaStore.\" into nyc-mr1-dev
am: 8ee0a67ba7

Change-Id: I387c13b1208ebdf05d03b4d172d538015dc3c6a5
2016-07-08 19:11:48 +00: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
Ben Lin
e7822fb767 Provider-level changes for implementing direct eject of a root in Files app.
Several changes at different levels:
1. Introduction of ejectRoot(String) for DocumentsProvider
2. Introduction of ejectRoot(ContentResolver, Uri, String) for
DocumentsContract
4. Additional permission for MOUNT_UNMOUNT for ExternalStorageProvider
5. Implementation of ejectRoot(String) for External StorageProvider

Bug: 29584653
Change-Id: I28557af63259548784cf24d5b051eb06ad5193ca
(cherry picked from commit 2ccc18357d6741dde56edc4d5a2608f15f4b9078)
2016-06-29 23:06:51 +00:00
Aga Wronska
92b77f13f1 Merge "Add config flag to show/hide internal storage. Hide internal storage by default." into nyc-dev am: 5f7d673
am: c9f5b17

* commit 'c9f5b17df45fe9ee3952c4d0e6d067fc0aa43a82':
  Add config flag to show/hide internal storage. Hide internal storage by default.
2016-03-22 17:11:42 +00:00
Aga Wronska
c9f5b17df4 Merge "Add config flag to show/hide internal storage. Hide internal storage by default." into nyc-dev
am: 5f7d673

* commit '5f7d673f3b69019288adcf11325f71aeb2b8af49':
  Add config flag to show/hide internal storage. Hide internal storage by default.
2016-03-22 17:09:10 +00: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
Geoff Mendal
67f317e3ab Import translations. DO NOT MERGE
Change-Id: Ic896483aa7c447c570c1fd5578aacea0bf19ada3
Auto-generated-cl: translation import
2016-03-18 20:05:40 -07:00
Steve McKay
b245d109b2 Merge "Show proper icons for SD and USB attached storage." into nyc-dev am: eef85e0c02
am: f3322fccfa

* commit 'f3322fccfa21ce251055b1051788a5b411c28f26':
  Show proper icons for SD and USB attached storage.
2016-03-03 20:38:07 +00:00
Steve McKay
f3322fccfa Merge "Show proper icons for SD and USB attached storage." into nyc-dev
am: eef85e0c02

* commit 'eef85e0c02a28b610b4611071749baf48ba67e2f':
  Show proper icons for SD and USB attached storage.
2016-03-03 19:43:27 +00:00
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
aab0194119 Merge "Use device model and name for internal storage." into nyc-dev am: d53f0df7df
am: 8020fecc40

* commit '8020fecc40b7bed8cd28d45985c9d45d725cedf9':
  Use device model and name for internal storage.
2016-03-03 01:50:14 +00:00
Steve McKay
8020fecc40 Merge "Use device model and name for internal storage." into nyc-dev
am: d53f0df7df

* commit 'd53f0df7dfb1eee22f7953870ed9d24688596712':
  Use device model and name for internal storage.
2016-03-03 01:19:13 +00: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
24dd9ad0c0 Merge "Always show intern storage." into nyc-dev am: b4672ef6df
am: 1788dfd223

* commit '1788dfd223c7c62005b8c1e98cd25737f685a912':
  Always show intern storage.
2016-03-02 20:32:39 +00:00
Steve McKay
1788dfd223 Merge "Always show intern storage." into nyc-dev
am: b4672ef6df

* commit 'b4672ef6dfbaf416981539d515ad1489d7d0bc87':
  Always show intern storage.
2016-03-02 19:02:19 +00: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
bf12176229 Merge "Fix crash in isChildDocument when parent is in zip, and child not." into nyc-dev am: 1f67c8740c
am: aa34d6c17d

* commit 'aa34d6c17dde17b4ace65719dcf3c9388d704893':
  Fix crash in isChildDocument when parent is in zip, and child not.
2016-03-01 10:32:09 +00:00
Tomasz Mikolajewski
aa34d6c17d Merge "Fix crash in isChildDocument when parent is in zip, and child not." into nyc-dev
am: 1f67c8740c

* commit '1f67c8740cf9d3e2852b9685500271779d5e09cb':
  Fix crash in isChildDocument when parent is in zip, and child not.
2016-03-01 10:29:54 +00: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
Geoff Mendal
d9c573af86 Import translations. DO NOT MERGE
Change-Id: Ifda11deee3b2678d55076257294b4a7da8d4bedb
Auto-generated-cl: translation import
2016-02-22 05:21:54 -08:00
Steve McKay
2d9344d5d9 Merge "Remove "HOME" directory. Use "Documents" instead." into nyc-dev am: 25a7ee08f6
am: 40cc8409e1

* commit '40cc8409e1c0255e44ce3ca2818dae9f636f9c7a':
  Remove "HOME" directory. Use "Documents" instead.
2016-02-17 18:00:54 +00:00
Geoff Mendal
1988362767 Import translations. DO NOT MERGE
Change-Id: Ic9d60a93843ae5ce592e59dd9b7be1fd26c1c508
Auto-generated-cl: translation import
2016-02-17 05:22:45 -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
Geoff Mendal
64e9367dc1 Import translations. DO NOT MERGE
Change-Id: Ic4654a8012755d1262787852e795500f7c249520
Auto-generated-cl: translation import
2016-02-15 05:23:07 -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