From ca9376cc4bae2b3d5ecb09083e9949c7ff4e2db4 Mon Sep 17 00:00:00 2001 From: Yohei Yukawa Date: Fri, 1 Feb 2019 23:38:30 -0800 Subject: Make Editor.SuggestionsPopupWindow private again Editor.SuggestionsPopupWindow was originally introduced as a private class [1], then we made it public [2] so that a test class can access it, but that test was later updated [3] and now doesn't have any direct dependency on Editor.SuggestionsPopupWindow. In short, we can make Editor.SuggestionsPopupWindow a private class again without losing anything. This actually addresses the following warning from doclava. Public class android.widget.Editor.SuggestionsPopupWindow extends private class android.widget.Editor.PinnedPopupWindow There should be no behavior change. [1]: If863107681ce82a1639f21315878f830c2991fb7 6934044fd7d2de12c21e3cc9b7da589ec3b71e8e [2]: Idf166cbecb3e33be213e4104cf1afd827906f2ad a60160b30bf1b6aa27cdaf03cf9b6c245f338d84 [3]: I12e522436a83fa264cd22176d054877eec411708 31eb74fb2bc33aea6a8054c861a6e7aac7c41f4b Fix: 117519592 Test: No doclava warning regarding SuggestionsPopupWindow during full build Change-Id: Ie722156d3819d05d3cd479527abb8b4750b332f7 --- core/java/android/widget/Editor.java | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/core/java/android/widget/Editor.java b/core/java/android/widget/Editor.java index bb9bd5297b52..c82177407b61 100644 --- a/core/java/android/widget/Editor.java +++ b/core/java/android/widget/Editor.java @@ -3531,8 +3531,8 @@ public class Editor { } } - @VisibleForTesting - public class SuggestionsPopupWindow extends PinnedPopupWindow implements OnItemClickListener { + private final class SuggestionsPopupWindow extends PinnedPopupWindow + implements OnItemClickListener { private static final int MAX_NUMBER_SUGGESTIONS = SuggestionSpan.SUGGESTIONS_MAX_SIZE; // Key of intent extras for inserting new word into user dictionary. @@ -3734,11 +3734,6 @@ public class Editor { } } - @VisibleForTesting - public ViewGroup getContentViewForTesting() { - return mContentView; - } - @Override public void show() { if (!(mTextView.getText() instanceof Editable)) return; @@ -6460,11 +6455,6 @@ public class Editor { return 0 <= start && start <= end && end <= text.length(); } - @VisibleForTesting - public SuggestionsPopupWindow getSuggestionsPopupWindowForTesting() { - return mSuggestionsPopupWindow; - } - /** * An InputFilter that monitors text input to maintain undo history. It does not modify the * text being typed (and hence always returns null from the filter() method). -- cgit v1.2.3-59-g8ed1b