From 40e9950ddd890b8d1a3d923367283675b993affa Mon Sep 17 00:00:00 2001 From: Miranda Kephart Date: Thu, 20 Apr 2023 12:28:49 -0400 Subject: [PATCH] Remove text spans from clipboard EditTextActivity display Casts text from clipboard to a string before displaying it in the clipboard text editor. Some apps use colored text spans to adjust the color of text, which is retained in the clipboard. This will cause us to show text in the wrong color (e.g. black-on-black); in general we don't expect users to want to retain this metadata, so just remove it for editing. Bug: 278826009 Fix: 278826009 Test: manual (visual change) Change-Id: I792f3116d3e0719874132ccb848262fa7c2d62af --- .../com/android/systemui/clipboardoverlay/EditTextActivity.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/SystemUI/src/com/android/systemui/clipboardoverlay/EditTextActivity.java b/packages/SystemUI/src/com/android/systemui/clipboardoverlay/EditTextActivity.java index 1fa9ac574c7e1..1ffbe3230bdaa 100644 --- a/packages/SystemUI/src/com/android/systemui/clipboardoverlay/EditTextActivity.java +++ b/packages/SystemUI/src/com/android/systemui/clipboardoverlay/EditTextActivity.java @@ -72,7 +72,7 @@ public class EditTextActivity extends Activity } catch (PackageManager.NameNotFoundException e) { Log.w(TAG, "Package not found: " + mClipboardManager.getPrimaryClipSource(), e); } - mEditText.setText(clip.getItemAt(0).getText()); + mEditText.setText(clip.getItemAt(0).getText().toString()); mEditText.requestFocus(); mEditText.setSelection(0); mSensitive = clip.getDescription().getExtras() != null