Add QUERY_ARG_RELATED_URI to aid media placement.
We normally have strict rules about where media can be created to help ensure that the user's content stays organized. (For example, "image/jpeg" can only be placed inside DCIM/ or Pictures/.) However, when inserting an SD card from another device, it's pretty common to find media outside of these well-defined top-level directories. Apps have been able to read and write pre-existing content in these locations, but this change now provides a way for apps to create new media "adjacent" to this pre-existing content, subject to the following rules: -- The top level MIME type must be in agreement. -- The relative path on the device must be in agreement. When a developer wants to perform an insert() which would normally be blocked, they can provide a QUERY_ARG_RELATED_URI to allow that operation to succeed, if it meets the rules above. Bug: 131643582 Test: atest --test-mapping packages/providers/MediaProvider Change-Id: I7d678ee733023f5c5b55b5d18cdcde5a20116312
Loading
Please register or sign in to comment