From 9b50252a7035e26f4e61e1bc8c411c4a0d266009 Mon Sep 17 00:00:00 2001 From: Miranda Kephart Date: Wed, 9 Mar 2022 17:08:57 -0500 Subject: [PATCH] Add clipboard source to edit image intent Allows image editing apps to show different UI based on whether the image came from the clipboard overlay UI or not. Bug: 217722654 Test: manual (no change without corresponding change to the editing app; tested that with that change screenshots and clipboard edit intents are treated differently) Change-Id: I5ccb8e20de625d05ad71357330f07ef2773f3556 --- .../systemui/clipboardoverlay/ClipboardOverlayController.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/SystemUI/src/com/android/systemui/clipboardoverlay/ClipboardOverlayController.java b/packages/SystemUI/src/com/android/systemui/clipboardoverlay/ClipboardOverlayController.java index 0f937d163f5c6..4f794697d7ab4 100644 --- a/packages/SystemUI/src/com/android/systemui/clipboardoverlay/ClipboardOverlayController.java +++ b/packages/SystemUI/src/com/android/systemui/clipboardoverlay/ClipboardOverlayController.java @@ -93,6 +93,8 @@ public class ClipboardOverlayController { public static final String SELF_PERMISSION = "com.android.systemui.permission.SELF"; public static final String COPY_OVERLAY_ACTION = "com.android.systemui.COPY"; + private static final String EXTRA_EDIT_SOURCE_CLIPBOARD = "edit_source_clipboard"; + private static final int CLIPBOARD_DEFAULT_TIMEOUT_MILLIS = 6000; private static final int SWIPE_PADDING_DP = 12; // extra padding around views to allow swipe @@ -347,6 +349,7 @@ public class ClipboardOverlayController { editIntent.setDataAndType(uri, "image/*"); editIntent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION); editIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK); + editIntent.putExtra(EXTRA_EDIT_SOURCE_CLIPBOARD, true); mContext.startActivity(editIntent); animateOut(); }