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

Commit 9b78af42 authored by Jay Thomas Sullivan's avatar Jay Thomas Sullivan Committed by Jay Sullivan
Browse files

Add split perms from W_E_S to media

Add split permissions from WRITE_EXTERNAL_STORAGE to media permissions.

The reason for doing this is that the split-permission handling code
doesn't handle recursive split-permission mappings, but only direct
mappings.

This resulted in a problem with WRITE_EXTERNAL_STORAGE because:

1) WRITE_EXTERNAL_STORAGE splits into READ_EXTERNAL_STORAGE, and
2) Recently, we added split permissions from READ_EXTERNAL_STORAGE
to READ_MEDIA_AUDIO, READ_MEDIA_IMAGES, READ_MEDIA_VIDEO, and
ACCESS_MEDIA_LOCATION

The effect is that apps which request WRITE_EXTERNAL_STORAGE are not
being granted media storage permissions properly.

(Note that, for now, we've not yet added the split to
ACCESS_MEDIA_LOCATION, because this scenario has not yet been
thoroughly tested.)

Bug: 222238273
Test: atest CtsPermissionTestCases CtsPermission3TestCases SplitPermissionsSystemTest
Change-Id: I94694b37189ea8ad89edc4f478391ccfe1ccd5b8
parent 6a1b6bc9
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -243,6 +243,18 @@
                      targetSdk="33">
        <new-permission name="android.permission.READ_MEDIA_IMAGES" />
    </split-permission>
    <split-permission name="android.permission.WRITE_EXTERNAL_STORAGE"
                      targetSdk="33">
        <new-permission name="android.permission.READ_MEDIA_AUDIO" />
    </split-permission>
    <split-permission name="android.permission.WRITE_EXTERNAL_STORAGE"
                      targetSdk="33">
        <new-permission name="android.permission.READ_MEDIA_VIDEO" />
    </split-permission>
    <split-permission name="android.permission.WRITE_EXTERNAL_STORAGE"
                      targetSdk="33">
        <new-permission name="android.permission.READ_MEDIA_IMAGES" />
    </split-permission>
    <split-permission name="android.permission.BLUETOOTH"
                      targetSdk="31">
        <new-permission name="android.permission.BLUETOOTH_SCAN" />