Commit Graph

260 Commits

Author SHA1 Message Date
Jeff Sharkey
efd355c1c3 Merge "Hide eject icon of removable media when it's emulated volume" am: 7f656092df am: 0fe81d7320
am: 29ce4d5fda

Change-Id: I815654df758200596b949943738608cd42ecdc40
2018-12-05 08:48:12 -08:00
Jeff Sharkey
29ce4d5fda Merge "Hide eject icon of removable media when it's emulated volume" am: 7f656092df
am: 0fe81d7320

Change-Id: Ia2b865c56a92265151444b4b7310b61c51a9a952
2018-12-05 08:38:43 -08:00
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
Ivan Chiang
a972d0449a Extend DocumentsContract search to accept mime types
1. Add the key of query arguments and match method
   in DocumentsContract.
2. Implement new querySearchDocuments method in
   DocumentsProvider, ExternalStoragProvider and
   FileSystemProvider.

Bug: 111786939
Test: Manual Test
Change-Id: I04e9f2be971f10ac1e9584a3486c948aaddea0a4
2018-11-14 15:06:35 +08:00
Risan
f8771d362c Merge "Introducing StubVolume in StorageManager" am: b499af866c am: eb871cc916
am: ee32e0d473

Change-Id: I4098132df9833b7cbac0db9bdadac297d324a822
2018-11-13 12:12:23 -08:00
Risan
ee32e0d473 Merge "Introducing StubVolume in StorageManager" am: b499af866c
am: eb871cc916

Change-Id: I69240d32659b511aec0e1e029fb6c6f1ab455c9c
2018-11-13 11:57:12 -08: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
Jeff Sharkey
643e99ef06 Reroute Uri conversions though MediaProvider.
Upcoming changes will prevent apps from reading "_data" columns
directly, which is required to convert between DocumentsProvider and
MediaProvider Uris.  To solve this, delegate the call() through
MediaProvider, where it can perform the "_data" lookup on behalf
of the caller.

Also add new getMediaUri() call to offer symmetry.

Bug: 111960973, 117627072, 110961701
Test: atest android.provider.cts.MediaStoreUiTest
Change-Id: I53c640704d86047d7a4bf1702aca027873395abf
2018-10-24 19:34:09 -06:00
felkachang
593d07b991 To add the Android.bp of ExternalStorageProvider
ExternalStorageProvider doesn't have any tests yet.
1. Convert Android.mk to Android.bp
2. Add init testcase
3. formatted by bpfmt -s -w Android.bp

Fixes: 117812397
Test: atest ExternalStorageProviderTests

Change-Id: I74235832f453110742de0b15cb14fac7514ecf0e
2018-10-24 06:11:06 +00:00
Andreas Gampe
b58893078b Frameworks: Annotate trivial @GuardedBy in packages
Add @GuardedBy for simple functions that require locks and have a name in
one of the frameworks naming styles for locks ("^.*(Locked|LPw|LPr|L[a-zA-Z]|UL|AL|NL)$").

Derived by errorprone.

Bug: 73000847
Test: m
Change-Id: Id14322b0a6206152cd2933c968e0a6f470fcee09
2018-09-05 17:05:26 -07: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
Bill Yi
6d98c3e49c Import translations. DO NOT MERGE
Change-Id: I5fdad685a6bfd04b78a1ad1fb9586efc2924bb8a
Auto-generated-cl: translation import
2018-06-01 07:24:11 -07:00
Jeff Sharkey
cbfdfa90ad Merge "Return to modifying raw /mnt/media_rw paths." into pi-dev am: f7d3e028ae
am: 1394fd25ca

Change-Id: If6904b6dc431dab74e326b75f37b58ee3c99feef
2018-05-02 18:10:07 -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
Bill Yi
e89b7d01a9 Import translations. DO NOT MERGE
Change-Id: I78df3676b8f5fb027826ca835c9964446c3a1b70
Auto-generated-cl: translation import
2018-03-16 21:39:38 -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