This works for target R+ apps, but need to come up with a better story
for target <R. The enforcement in DocumentsUI is target SDK based
and those apps bypass the block_tree flag.
Bug: 157320644
Test: atest DocumentsTest
Change-Id: I93aea7cd5d3b7befea1f78e1cf3f31f8250f1d33
(cherry picked from commit 9d508579ae)
Merged-In: I93aea7cd5d3b7befea1f78e1cf3f31f8250f1d33
When the file is deleted, renamed or moved, revoke all uri
permissions with the file
Bug: 157474195
Test: manual test with DocumentsUI
Test: atest DocumentsTest#testAfterMoveDocumentInStorage_revokeUriPermission
Change-Id: I4ffb183630aadb2d87b0965e8cecf88af15f4534
Merged-In: I4ffb183630aadb2d87b0965e8cecf88af15f4534
(cherry picked from commit 9efd606f43)
This change fastens the first call to DocumentsUI after reboot.
Bug: 155819706
Test: builds (fastens the first call to DocumentsUI by 600-800ms)
Change-Id: Id8396e36ed8aa1ded79d93a2f1ed140bf903184b
In Scoped Storage world, access to "Android/data" style directories are
hidden for privacy reasons. Allow ExternalStorageProvider to show these
hidden files when in manage mode.
Bug: 150366834
Test: Android/data and Android/obb is visible from Files App, but are
hidden in Picker view from StorageTestApp and Gmail (GMAIL > Compose >
Attach > Go to Pixel > Android)
Change-Id: I58b4fc23d9b479df4fc0480ae55f1f2070d0cb7c
We were listening to volume state changes in the
ExternalStorageProvider with the VOLUME_STATE_CHANGED broadcast in the
MountReceiver.
This broadcast can be severly delayed especially on user startup so we
also listen with the StorageEventListener which is more performant.
Test: Manual
Bug: 154332660
Change-Id: I93c43f3b53c0a71cd6aa7cf594fe6988f4bc3f6e
We add new Documents root in MediaDocumentsProvider.
Remove unused Documents root in ExternalStorageProvider.
Bug: 148043686
Test: manual with DocumentsUI
Change-Id: I4278aa79cb1a9e22007b2946f8196d2a070be2c8
This permission will allow it access unreliable USB OTG volumes and
also service other SAF requests on the external storage.
Test: m
Bug: 144914977
Change-Id: I92f046a06852d5ba842764d8348a498b2b6ad0b7
Now that emulated volumes are per user, ESP should not register
any volume that does not match it's running user.
Bug: 144936488
Test: On device with secondary user, Files > Show internal storage
displays "internal storage"
Change-Id: If4820c684a0a8ef52cc97ae9087b1a0884f9cee7
Recent work has paved the way to get MediaStore.java building against
"core_platform", and this change is actually shifting MediaStore.java
inside the MediaProvider APEX boundary.
This involves defining a new "updatable-mediaprovider" library JAR
and ensuring that it's spliced into classpaths where needed to keep
everything building and working.
Note that the MediaProvider APK itself is still bundled, so we're
manually including the MediaStore.java when building that APK so that
we can continue referencing @hide symbols, but there's a STOPSHIP
comment to remove that once we get the APK building against
"system_current".
Bug: 144247087
Test: atest --test-mapping packages/providers/MediaProvider
Change-Id: I27ed3fde40751d9ac136a31710c62004b1b8962f
Remove the logic of using file path directly.
Parse the docId to get the relative path.
Test: atest ExternalStorageProviderTest
Change-Id: Ic218813acc73e247ee5593ed9e8e7688760e6780
Fix: 144467519
Up until now, the FUSE mount logic has made two assumptions:
1. The primary external volume is an emulated volume on /data/media
2. Only the primary user is running, as user zero
With this change, we are able to handle the following cases:
1. Mount new external storage volumes as as portable storage
(PublicVolume) managed by FUSE. The PublicVolume originally mounted on
/mnt/media_rw/<uuid> is availabe on /storage/<uuid> as a FUSE mount
2. Mount new external storage volumes as adoptable storage
(PrivateVolume) with a stacked EmulatedVolume managed by FUSE. The
EmulatedVolume orignally mounted on /mnt/expand/<uuid>/media will be
available on /storage/emulated if set as the primary storage
3. Run the MediaProvider as a secondary user handling requests on
/mnt/user/<userid>/<volid>
Test: atest AdoptableHostTest
Bug: 135341433
Bug: 140120303
Change-Id: I5fb48616b4143277ea14c6846037e2fd176e16db
This takes the Context#getFeatureId from the calling context and pipes
it all way through to the noteOp calls done by the content provider.
Bug: 136595429
Test: atest CtsAppOpsTestCases (new test added to capture this case)
TelecomUnitTests:CallLogManagerTest
ContentProviderClientTest
TelecomUnitTests:MissedCallNotifierImplTest
TelecomUnitTests:BasicCallTests
MediaInserterTest
PreferencesHelperTest
RankingHelperTest
PinnedSliceStateTest
FrameworksCoreTests:ContentResolverTest
Change-Id: I53b1035626229c920b353509a5bece157b52fb51
DocumentsContract
- Add new flag FLAG_DIR_BLOCKS_TREE in Document
ExternalStorageProvider
- Add flag into DocumentInfo for blocking folder
Change-Id: Ib557fe99d330788a3bd968bffd43b6658761514f
Bug: 32370759
Test: atest DocumentsTest
We need to return visible paths for MediaProvider to work with,
instead of internal paths.
Bug: 133730441
Test: atest android.providerui.cts.MediaStoreUiTest
Change-Id: If06dc635b22032761626cf54b37b7bc15ace7b2e
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
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
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
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
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
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
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
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