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

Commit 3e9ecc8d authored by Abhijeet Kaur's avatar Abhijeet Kaur
Browse files

Allow cross profile interaction by default to_parent

Following the same trend as ACTION_GET_CONTENT and ACTION_OPEN_DOCUMENTS
intents, allow similar cross profile default behavior for
ACTION_PICK_IMAGES.
Allow ACTION_PICK_IMAGES to show personal content when launched from
work profile.

The device admin will  explicitly have to allow ACTION_PICK_IMAGES to
show work content from personal profile app. (this is the same behavior
as ACTION_GET_CONTENT).

Bug: 190733134
Test: manual
Change-Id: Icd37277091dc6f17f8337178e7485524fd6b1e50
parent 4712e82e
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -178,6 +178,16 @@ public class DefaultCrossProfileIntentFiltersUtils {
                    .addDataType("*/*")
                    .build();

    /** Pick images can be forwarded to parent user. */
    private static final DefaultCrossProfileIntentFilter ACTION_PICK_IMAGES =
            new DefaultCrossProfileIntentFilter.Builder(
                    DefaultCrossProfileIntentFilter.Direction.TO_PARENT,
                    /* flags= */ 0,
                    /* letsPersonalDataIntoProfile= */ true)
                    .addAction(MediaStore.ACTION_PICK_IMAGES)
                    .addCategory(Intent.CATEGORY_DEFAULT)
                    .build();

    /** Open document intent can be forwarded to parent user. */
    private static final DefaultCrossProfileIntentFilter OPEN_DOCUMENT =
            new DefaultCrossProfileIntentFilter.Builder(
@@ -289,6 +299,7 @@ public class DefaultCrossProfileIntentFiltersUtils {
                RECOGNIZE_SPEECH,
                ACTION_PICK_RAW,
                ACTION_PICK_DATA,
                ACTION_PICK_IMAGES,
                OPEN_DOCUMENT,
                GET_CONTENT,
                USB_DEVICE_ATTACHED,