Move MediaStore.java inside APEX boundary.
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
This commit is contained in:
committed by
Jeff Sharkey
parent
8cb0e1cfb7
commit
40182833f7
@@ -102,6 +102,9 @@ public class ExternalStorageProvider extends FileSystemProvider {
|
||||
DocumentsContract.EXTERNAL_STORAGE_PRIMARY_EMULATED_ROOT_ID;
|
||||
private static final String ROOT_ID_HOME = "home";
|
||||
|
||||
private static final String GET_DOCUMENT_URI_CALL = "get_document_uri";
|
||||
private static final String GET_MEDIA_URI_CALL = "get_media_uri";
|
||||
|
||||
private StorageManager mStorageManager;
|
||||
private UserManager mUserManager;
|
||||
|
||||
@@ -665,7 +668,7 @@ public class ExternalStorageProvider extends FileSystemProvider {
|
||||
}
|
||||
break;
|
||||
}
|
||||
case MediaStore.GET_DOCUMENT_URI_CALL: {
|
||||
case GET_DOCUMENT_URI_CALL: {
|
||||
// All callers must go through MediaProvider
|
||||
getContext().enforceCallingPermission(
|
||||
android.Manifest.permission.WRITE_MEDIA_STORAGE, TAG);
|
||||
@@ -684,7 +687,7 @@ public class ExternalStorageProvider extends FileSystemProvider {
|
||||
throw new IllegalStateException("File in " + path + " is not found.", e);
|
||||
}
|
||||
}
|
||||
case MediaStore.GET_MEDIA_URI_CALL: {
|
||||
case GET_MEDIA_URI_CALL: {
|
||||
// All callers must go through MediaProvider
|
||||
getContext().enforceCallingPermission(
|
||||
android.Manifest.permission.WRITE_MEDIA_STORAGE, TAG);
|
||||
|
||||
Reference in New Issue
Block a user