From 9e1e807c3ee57bb68ca8eedcb3cf9d705e81248c Mon Sep 17 00:00:00 2001 From: Jason Simmons Date: Mon, 22 Jan 2018 13:55:48 -0800 Subject: [PATCH] Convert other Android clipboard formats into text (flutter/engine#4578) Fixes https://github.com/flutter/flutter/issues/14093 --- .../android/io/flutter/plugin/platform/PlatformPlugin.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/engine/src/flutter/shell/platform/android/io/flutter/plugin/platform/PlatformPlugin.java b/engine/src/flutter/shell/platform/android/io/flutter/plugin/platform/PlatformPlugin.java index 2e02e85acf1..43dd9c1cc4f 100644 --- a/engine/src/flutter/shell/platform/android/io/flutter/plugin/platform/PlatformPlugin.java +++ b/engine/src/flutter/shell/platform/android/io/flutter/plugin/platform/PlatformPlugin.java @@ -227,10 +227,9 @@ public class PlatformPlugin implements MethodCallHandler, ActivityLifecycleListe if (clip == null) return null; - if ((format == null || format.equals(kTextPlainFormat)) && - clip.getDescription().hasMimeType(ClipDescription.MIMETYPE_TEXT_PLAIN)) { + if (format == null || format.equals(kTextPlainFormat)) { JSONObject result = new JSONObject(); - result.put("text", clip.getItemAt(0).getText().toString()); + result.put("text", clip.getItemAt(0).coerceToText(mActivity)); return result; }