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

46 lines
2.0 KiB
XML

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.android.externalstorage">
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_MEDIA_STORAGE" />
<uses-permission android:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS" />
<application android:label="@string/app_label">
<provider
android:name=".ExternalStorageProvider"
android:label="@string/storage_description"
android:authorities="com.android.externalstorage.documents"
android:grantUriPermissions="true"
android:exported="true"
android:permission="android.permission.MANAGE_DOCUMENTS">
<intent-filter>
<action android:name="android.content.action.DOCUMENTS_PROVIDER" />
</intent-filter>
<!-- Stub that allows MediaProvider to make incoming calls -->
<path-permission
android:path="/media_internal"
android:permission="android.permission.WRITE_MEDIA_STORAGE" />
</provider>
<receiver android:name=".MountReceiver">
<intent-filter>
<action android:name="android.os.storage.action.VOLUME_STATE_CHANGED" />
</intent-filter>
</receiver>
<!-- TODO: find a better place for tests to live -->
<provider
android:name=".TestDocumentsProvider"
android:authorities="com.example.documents"
android:grantUriPermissions="true"
android:exported="true"
android:permission="android.permission.MANAGE_DOCUMENTS"
android:enabled="false">
<intent-filter>
<action android:name="android.content.action.DOCUMENTS_PROVIDER" />
</intent-filter>
</provider>
</application>
</manifest>