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

Commit 7575baad authored by Zak Cohen's avatar Zak Cohen
Browse files

Overview - make drag share targets work with Work Profile

Start the destination as the correct user, and fix the uris as
its leaving.

Bug: 179162353
Test: flash with WP and regular, test both targets
Change-Id: I49c980c5d08843ad221a9b92816351a22ea58990
parent 57e41f9f
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -99,8 +99,15 @@ public class ImageActionUtils {
            .putExtra(Intent.EXTRA_STREAM, uri)
            .putExtra(Intent.EXTRA_SHORTCUT_ID, shortcutInfo.getId())
            .setClipData(clipdata);

        if (context.getUserId() != appTarget.getUser().getIdentifier()) {
            intent.prepareToLeaveUser(context.getUserId());
            intent.fixUris(context.getUserId());
            context.startActivityAsUser(intent, appTarget.getUser());
        } else {
            context.startActivity(intent);
        }
    }

    /**
     * Launch the activity to share image.