From 43743035b3af2e73f4c3ad6725f72853fc9bb8b3 Mon Sep 17 00:00:00 2001 From: Matt Casey Date: Mon, 23 May 2022 17:02:02 +0000 Subject: [PATCH] Change remote copy intent behavior. Send to the configured component if one is set, otherwise send to anything supporting that action. This matches the screnshot editor behavior. Test: Manual test with and without the config value set, with single or multiple apps supporting the action. Bug: 233252260 Change-Id: I9df93e1268250ff27759802598c2b71014df375e --- .../clipboardoverlay/ClipboardOverlayController.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/clipboardoverlay/ClipboardOverlayController.java b/packages/SystemUI/src/com/android/systemui/clipboardoverlay/ClipboardOverlayController.java index 1203d1a1ec97d..a08f154029b34 100644 --- a/packages/SystemUI/src/com/android/systemui/clipboardoverlay/ClipboardOverlayController.java +++ b/packages/SystemUI/src/com/android/systemui/clipboardoverlay/ClipboardOverlayController.java @@ -570,12 +570,13 @@ public class ClipboardOverlayController { } private Intent getRemoteCopyIntent(ClipData clipData) { - String remoteCopyPackage = mContext.getString(R.string.config_remoteCopyPackage); - if (TextUtils.isEmpty(remoteCopyPackage)) { - return null; - } Intent nearbyIntent = new Intent(REMOTE_COPY_ACTION); - nearbyIntent.setComponent(ComponentName.unflattenFromString(remoteCopyPackage)); + + String remoteCopyPackage = mContext.getString(R.string.config_remoteCopyPackage); + if (!TextUtils.isEmpty(remoteCopyPackage)) { + nearbyIntent.setComponent(ComponentName.unflattenFromString(remoteCopyPackage)); + } + nearbyIntent.setClipData(clipData); nearbyIntent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION); nearbyIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);