Commit Graph

249 Commits

Author SHA1 Message Date
Takamasa Kuramitsu
f5f03fc083 Hide eject icon of removable media when it's emulated volume
Hide eject icon of removable media on the root list of Files app when
primary shared storage is in adopted media due to the following reasons.

- Primary shared storage should not be easily ejected because that
causes the situation that there's no primary shared storage

- To align with the Storage settings (Settings > Storage), eject icon
is disabled in this menu when the removable media is adopted

- Eject action from Files app can only unmount primary shared storage

Bug: 117252468
Test: manual
Change-Id: Idd76229fb10db621a817afd60295787c761345b1
2018-11-29 03:08:07 +00:00
Risan
05c41e6a0a Introducing StubVolume in StorageManager
Bug: 110380403
Test: Tested in ARC++ (with Settings and vold changes in separate CLS)
- able to see the external storage under StorageSettings. Also tested
the sm command to print stubvolumes.

Change-Id: I7517260a40399bd9800424bb394512601f6af617
2018-11-08 21:48:35 +00:00
Bill Yi
ffa6905ddf Import translations. DO NOT MERGE
Change-Id: I629ba4be0e89af2cc8c760cfe8d5a3e3ac5443f8
Auto-generated-cl: translation import
2018-08-04 00:29:32 -07:00
Jeff Sharkey
1394fd25ca Merge "Return to modifying raw /mnt/media_rw paths." into pi-dev
am: f7d3e028ae

Change-Id: I61692ebdc49233923863ce773bb42a07498551b0
2018-05-02 14:29:10 -07:00
Jeff Sharkey
b00d5ea59a Return to modifying raw /mnt/media_rw paths.
We thought we could push everyone through sdcardfs, but secondary
devices mounted in a stable location don't give full write access to
apps holding WRITE_EXTERNAL_STORAGE, so system internals still need
to reach behind sdcardfs.

To keep sdcardfs in the loop about changes that we make behind its
back, we issue access(2) calls which should be enough for it to
invalidate any cached details.

Bug: 74132243
Test: manual
Change-Id: I727cd179a5a825b16ec4df6e2f41a079758d41c5
2018-05-01 10:03:18 -06:00
Bill Yi
d7c370022f Import translations. DO NOT MERGE
Auto-generated-cl: translation import

Bug: 64712476
Change-Id: Ib6847dd09539560b2c186a527a44294c86f211b2
2018-03-31 08:23:18 -07:00
Anton Hansson
ab6ec61251 frameworks/base: Set LOCAL_SDK_VERSION where possible.
This change sets LOCAL_SDK_VERSION for all packages where
this is possible without breaking the build, and
LOCAL_PRIVATE_PLATFORM_APIS := true otherwise.

Setting one of these two will be made required soon, and this
is a change in preparation for that. Not setting LOCAL_SDK_VERSION
makes the app implicitly depend on the bootclasspath, which is
often not required. This change effectively makes depending on
private apis opt-in rather than opt-out.

Test: make relevant packages
Bug: 73535841
Change-Id: I4233b9091d9066c4fa69f3d24aaf367ea500f760
2018-02-28 15:13:23 +00:00
Bill Yi
13ad8519fb Import translations. DO NOT MERGE
Change-Id: I30b4cf6c9fc5ca3f785ddb332a37311604947f8a
Auto-generated-cl: translation import
2018-02-26 14:29:07 -08:00
Bill Yi
696be5e21f Import translations. DO NOT MERGE
Change-Id: I9f7b9fb49d574b567ae8afae7ff089513ead3672
Auto-generated-cl: translation import
2018-02-22 02:27:16 -08:00
Jeff Sharkey
b78b754dc0 Enforce file transfer restrictions for shell.
If we have a policy that says DISALLOW_USB_FILE_TRANSFER, then block
file transfers for that user through common ContentProviders.

Test: builds, boots
Bug: 64672411
Change-Id: I502b10c2c229727bc6b421f9db6d2d9e2e03845c
2018-01-04 15:07:41 -07:00
Bill Yi
bd3fc330af Import translations. DO NOT MERGE
Change-Id: I37739ceeebaf645509f3a5b13d9d16af0f4cffbf
Auto-generated-cl: translation import
Exempt-From-Owner-Approval: translation import
2017-09-05 23:14:11 -07:00
Bill Yi
2aed9f432a Import translations. DO NOT MERGE
Change-Id: Ib23ebf427c10ff98a43a1565c95f8055f38fd7da
Auto-generated-cl: translation import
Exempt-From-Owner-Approval: translation import
2017-08-11 21:08:39 -07:00
Jeff Sharkey
b9b9bddabe Merge "Use "real" free space; refresh on large changes." into oc-dev am: 6428beec23
am: 1d7d72de3f

Change-Id: I337c92b3d030905ff8bea6e894558cda8e87e34e
2017-05-10 04:13:03 +00:00
Jeff Sharkey
1d7d72de3f Merge "Use "real" free space; refresh on large changes." into oc-dev
am: 6428beec23

Change-Id: Ic464de2c77983dfbb9cdcc7cc6a27062d866797a
2017-05-10 03:56:33 +00:00
Jeff Sharkey
06823d4c2e Use "real" free space; refresh on large changes.
For volumes where the OS manages cached data, use the "free space" as
reported by StorageStatsManager, which is the same value shown in
the Settings app and other UI elements.

Also, when the storage space changes significantly, invalidate anyone
who was holding a cached "free space" value.

Test: builds, boots
Bug: 38146029
Change-Id: I4b3a484a8bf32cd137a83f1ea441beca6dc6719a
2017-05-09 16:55:31 -06:00
Bill Yi
7b329f6c9d Import translations. DO NOT MERGE
Change-Id: I20af9c4b4177a5a36496e76c70870b4792944f2c
Auto-generated-cl: translation import
2017-04-11 11:28:05 -07:00
Bill Yi
8e7ad54464 Import translations. DO NOT MERGE
Change-Id: I71ee4b0792217988e13df03f2ced891e83cf038e
Auto-generated-cl: translation import
2017-04-07 17:48:48 -07:00
Bill Yi
808bdf5bce Import translations. DO NOT MERGE
Change-Id: I0276e7c9fb791dcdaf604ed87abe58677abcc3af
Auto-generated-cl: translation import
2017-04-07 17:45:13 -07:00
Jeff Sharkey
c0a60682e2 Merge "We really want f_frsize and f_bavail." into oc-dev am: fd463121c6
am: f9f7d71cc5

Change-Id: Ifa28cb4515d6e9e74380fe70d73aec292d126ac9
2017-04-03 17:43:10 +00:00
Jeff Sharkey
f9f7d71cc5 Merge "We really want f_frsize and f_bavail." into oc-dev
am: fd463121c6

Change-Id: I55aebb3b452f4d41af7e5f54d0dff27e9bc6cca6
2017-04-03 17:27:48 +00:00
Jeff Sharkey
dafb17e7eb We really want f_frsize and f_bavail.
It's confusing, but f_bsize is not the value you're looking for; the
real block size is f_frsize.  Fix all those bugs.

Also, the vast majority of clients are interested in the usable
disk space, not including reserved space.

Test: builds, boots
Bug: 36840579
Change-Id: Ib1470389afd49c14cab62282ec1e978ebb2c4791
2017-04-02 23:33:38 -06:00
Bill Yi
8e79b3a9a0 Import translations. DO NOT MERGE
Change-Id: I789e7f6f9910fb2bfceec085555a42335853f1dd
Auto-generated-cl: translation import
2017-03-31 00:39:13 -07:00
Bill Yi
cebf64124c Import translations. DO NOT MERGE
Change-Id: I53e36942b22959b652d97804e339d85683c0a31b
Auto-generated-cl: translation import
2017-03-31 00:36:03 -07:00
TreeHugger Robot
0e74c95c0c Merge "Unhide FLAG_SUPPORT_EJECT and related methods." 2017-03-24 01:23:53 +00:00
Garfield Tan
8787703ae0 Unhide FLAG_SUPPORT_EJECT and related methods.
Test: Builds and CTS tests pass. Some manual tests as well.
Bug: 36483910
Change-Id: Idd9b1c9d9573222ee12127044ff11b9ab2487f0a
2017-03-23 16:41:24 -07:00
Bill Yi
97da16f1a7 Import translations. DO NOT MERGE
Change-Id: I78f94f36822ec6c8e01bd1ee3e49d75aa9fe65ac
Auto-generated-cl: translation import
2017-03-23 00:41:07 -07:00
Ben Lin
0df63e9080 Add android:label to ExternalStorageProvider.
Test: Builds.
Bug: 30138665
Change-Id: I6ac028f97c1451f9d78f7f5a0960f1a3f8bde5b7
2017-03-20 10:20:41 -07:00
Garfield Tan
b690b4de06 Address comments from API council.
Test: Code builds and tests pass. Also some manual tests around ESP.
Bug: 35813037
Bug: 35812990
Change-Id: Ia9d3a3964e9a83d0c1c08e5db4c2e231504aa99a
2017-03-02 12:48:13 -08:00
Garfield Tan
75379db42d Strip out some logics from ESP to FSP that DSP can use.
Also notify MediaStore when move happens.

Test: build & smoke tested.
Change-Id: I01576765c0b25089a81b77ce0904abea8b24d485
2017-02-24 18:30:03 -08:00
TreeHugger Robot
07323a9824 Merge "Add structured sort data to ContentResolver.query." 2017-01-12 22:21:53 +00:00
Roozbeh Pournader
153071c70a Merge "Rename language+country resources to just language" 2017-01-12 04:58:45 +00:00
Steve McKay
29c3f68cfa Add structured sort data to ContentResolver.query.
Update DocumentsProvider to override
    ContentProvider#query(Uri, String[], Bundle, CancellationSignal);
Added an otherwise unneeded import to pass doc check
    on DocumentsProvider.

Bug: 30927484
Change-Id: I295c21f53901d567455286f22439f21d22a8a25a
Test: Build and run. Test from DocsUi.
2017-01-11 15:01:50 -08:00
Roozbeh Pournader
b84a505b62 Rename language+country resources to just language
Bug: 26496609
Test: none
Change-Id: I40b99a8728f1f324f4c1f8066a61c3d5f92b1ac6
2017-01-10 23:51:26 -08:00
Garfield Tan
dc9593e791 Check visible paths as well when generate docId from file system path.
getDocumentUri(String, List<UriPermission>) needs it because MediaStore
can only provide path under visible paths for external SD cards.

Test: Manual test w/ SD card. Relative CTS tests pass. Happy to add
automated tests for SD card cases if somebody shows me how.

Bug: 33819522
Change-Id: I15cdd60a2d2c94275dd661f20b5b0deb0d80d258
2017-01-09 18:11:34 -08:00
Bill Yi
0c0c21ca76 Revert "Import translations. DO NOT MERGE"
This reverts commit ca0b5fd5a6.

Change-Id: Iec420cb2e5482911062acdf973d12e8a3f2a5432
2016-12-05 18:57:22 +00:00
Bill Yi
ca0b5fd5a6 Import translations. DO NOT MERGE
Change-Id: I10c0bb28036af20f55efa7a71b0fb6db363fef12
Auto-generated-cl: translation import
2016-12-02 20:39:30 -08:00
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 2f6d0d6db3.

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