From 611f0c8ab709beb43e7d02b0e4246ecaab218f0a Mon Sep 17 00:00:00 2001 From: Joanne Chung Date: Mon, 6 Jul 2020 20:50:10 +0800 Subject: [PATCH] Fix AutofillValueTest#autofillEmptyTextValue. The new added API for rich content(ag/9884022) denies to autofill empty text. However, Autofill allows us to fill an empty text. We should not cause a compatibility issue. Bug: 159035197 Test: atest android.autofillservice.cts.AutofillValueTest#\ autofillEmptyTextValue Test: atest FrameworksCoreTests:AutofillValueTest Change-Id: Ieb5b82bfe4bf77abd151c61ea4cf9125b8fe61f5 --- core/java/android/widget/TextViewRichContentReceiver.java | 3 --- 1 file changed, 3 deletions(-) diff --git a/core/java/android/widget/TextViewRichContentReceiver.java b/core/java/android/widget/TextViewRichContentReceiver.java index 5678a1e177d84..4f2d95466997f 100644 --- a/core/java/android/widget/TextViewRichContentReceiver.java +++ b/core/java/android/widget/TextViewRichContentReceiver.java @@ -116,9 +116,6 @@ final class TextViewRichContentReceiver implements RichContentReceiver private static boolean onReceiveForAutofill(@NonNull TextView textView, @NonNull ClipData clip, @Flags int flags) { final CharSequence text = coerceToText(clip, textView.getContext(), flags); - if (text.length() == 0) { - return false; - } // First autofill it... textView.setText(text); // ...then move cursor to the end.