From 43743035b3af2e73f4c3ad6725f72853fc9bb8b3 Mon Sep 17 00:00:00 2001 From: Matt Casey Date: Mon, 23 May 2022 17:02:02 +0000 Subject: 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 --- .../systemui/clipboardoverlay/ClipboardOverlayController.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/clipboardoverlay/ClipboardOverlayController.java b/packages/SystemUI/src/com/android/systemui/clipboardoverlay/ClipboardOverlayController.java index 1203d1a1ec97..a08f154029b3 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) { + Intent nearbyIntent = new Intent(REMOTE_COPY_ACTION); + String remoteCopyPackage = mContext.getString(R.string.config_remoteCopyPackage); - if (TextUtils.isEmpty(remoteCopyPackage)) { - return null; + if (!TextUtils.isEmpty(remoteCopyPackage)) { + nearbyIntent.setComponent(ComponentName.unflattenFromString(remoteCopyPackage)); } - Intent nearbyIntent = new Intent(REMOTE_COPY_ACTION); - 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); -- cgit v1.2.3-59-g8ed1b