summaryrefslogtreecommitdiff
path: root/java
diff options
context:
space:
mode:
author 1 <mrcasey@google.com> 2023-06-16 14:56:17 +0000
committer 1 <mrcasey@google.com> 2023-06-20 20:12:41 +0000
commitf609ae4c5d04918b328ba12e4aa99ca8fecfde88 (patch)
treec53e7b2d8a6be792e93b8d5e74debbe0b20093ce /java
parentfe745609cab8a852513df2b9008e0b666b2134b8 (diff)
Add an extra to sharesheet's image edit intent
To allow the editor to customize the behavior for the sharesheet flow if desired. Test: Validate that EXTRA is received by editor. Bug: 287621918 Change-Id: Ia70cc645e85054fd73f77f989cb4267cdc524cd4
Diffstat (limited to 'java')
-rw-r--r--java/src/com/android/intentresolver/ChooserActionFactory.java6
1 files changed, 6 insertions, 0 deletions
diff --git a/java/src/com/android/intentresolver/ChooserActionFactory.java b/java/src/com/android/intentresolver/ChooserActionFactory.java
index 6ec62753..4e595c96 100644
--- a/java/src/com/android/intentresolver/ChooserActionFactory.java
+++ b/java/src/com/android/intentresolver/ChooserActionFactory.java
@@ -78,6 +78,11 @@ public final class ChooserActionFactory implements ChooserContentPreviewUi.Actio
| Intent.FLAG_GRANT_PERSISTABLE_URI_PERMISSION
| Intent.FLAG_GRANT_PREFIX_URI_PERMISSION;
+ // Boolean extra used to inform the editor that it may want to customize the editing experience
+ // for the sharesheet editing flow.
+ private static final String EDIT_SOURCE = "edit_source";
+ private static final String EDIT_SOURCE_SHARESHEET = "sharesheet";
+
private static final String CHIP_LABEL_METADATA_KEY = "android.service.chooser.chip_label";
private static final String CHIP_ICON_METADATA_KEY = "android.service.chooser.chip_icon";
@@ -284,6 +289,7 @@ public final class ChooserActionFactory implements ChooserContentPreviewUi.Actio
resolveIntent.setFlags(originalIntent.getFlags() & URI_PERMISSION_INTENT_FLAGS);
resolveIntent.setComponent(editorComponent);
resolveIntent.setAction(Intent.ACTION_EDIT);
+ resolveIntent.putExtra(EDIT_SOURCE, EDIT_SOURCE_SHARESHEET);
String originalAction = originalIntent.getAction();
if (Intent.ACTION_SEND.equals(originalAction)) {
if (resolveIntent.getData() == null) {