Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5fceb157 authored by Jeff Sharkey's avatar Jeff Sharkey
Browse files

Structure MediaProvider as an APEX.

Based on guidance from the Mainline team, we're placing the
MediaProvider APK inside a new APEX, as this will allow us to
move MediaStore.java inside the module boundary in a future CL.

As part of this restructuring, we need the pre-Mainline APK to
remain intact to preserve the user's media database.  There is
already logic in place from previous CLs that will migrate data
from the pre-Mainline to the post-Mainline world, including tests
to verify that the migration works.

Bug: 144247087
Test: atest --test-mapping packages/providers/MediaProvider
Change-Id: I4c45dcf019442013da8fce0223ed0be896dedef4
parent 7c738c6a
Loading
Loading
Loading
Loading
+12 −0
Original line number Original line Diff line number Diff line
@@ -154,6 +154,8 @@ public final class MediaStore {
    public static final String SCAN_FILE_CALL = "scan_file";
    public static final String SCAN_FILE_CALL = "scan_file";
    /** {@hide} */
    /** {@hide} */
    public static final String SCAN_VOLUME_CALL = "scan_volume";
    public static final String SCAN_VOLUME_CALL = "scan_volume";
    /** {@hide} */
    public static final String SUICIDE_CALL = "suicide";


    /**
    /**
     * Extra used with {@link #SCAN_FILE_CALL} or {@link #SCAN_VOLUME_CALL} to indicate that
     * Extra used with {@link #SCAN_FILE_CALL} or {@link #SCAN_VOLUME_CALL} to indicate that
@@ -3815,6 +3817,16 @@ public final class MediaStore {
        }
        }
    }
    }


    /** @hide */
    public static void suicide(Context context) {
        final ContentResolver resolver = context.getContentResolver();
        try (ContentProviderClient client = resolver
                .acquireUnstableContentProviderClient(AUTHORITY)) {
            client.call(SUICIDE_CALL, null, null);
        } catch (Exception ignored) {
        }
    }

    /** @hide */
    /** @hide */
    @TestApi
    @TestApi
    public static Uri scanFile(Context context, File file) {
    public static Uri scanFile(Context context, File file) {
+1 −1
Original line number Original line Diff line number Diff line
@@ -204,7 +204,7 @@ applications that come with the platform
        <permission name="android.permission.UPDATE_DEVICE_STATS"/>
        <permission name="android.permission.UPDATE_DEVICE_STATS"/>
    </privapp-permissions>
    </privapp-permissions>


    <privapp-permissions package="com.android.providers.media">
    <privapp-permissions package="com.android.providers.media.module">
        <permission name="android.permission.INTERACT_ACROSS_USERS"/>
        <permission name="android.permission.INTERACT_ACROSS_USERS"/>
        <permission name="android.permission.MANAGE_USERS"/>
        <permission name="android.permission.MANAGE_USERS"/>
        <permission name="android.permission.USE_RESERVED_DISK"/>
        <permission name="android.permission.USE_RESERVED_DISK"/>