Skip to content
Commit 1b5fc708 authored by Matt Casey's avatar Matt Casey
Browse files

Fix share/edit actions for work profile.

In order to be able to proxy the permissions to read/write the
screenshot when editing/sharing, the intents must be launched from a
service running *as* the work profile user (if the screenshot is work
profile). That is done with ScreenshotProxyService.

In order to untangle action execution to accomodate this, I created
ActionIntentExecutor, which does the following:
1. Dismisses the keyguard
2. Launches the intent (either directly if it's the main user, or
   delegating to the cross profile service if it's not)
3. Override some transition logic for shared element.

This flow is used whenever the work profile flag is set (it works for
either profile, but is required for work profile).

Once we switch to this model, we can drop a lot of the
SaveImageInBackgroundTask action code, drop ActionProxyReceiver entirely,
etc.

Extracted intent creation to its own class so it could be tested.

All behavior changes covered by currently-off flags.

Known issues:
1. This doesn't fix smart actions
2. If you do an action on the lock screen, the bouncer doesn't come up
   in the new implementation. I verified that the same call is being
   made and it's even getting to the bouncer's show() call but haven't
   figured out what's wrong here yet.

Bug: 231957192
Test: manual sharing and editing screenshtos of wp and non-wp apps.

Change-Id: Id2b423c22d209fc73f796ed6ba6e3d153e0f638e
parent 6cd920ce
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment