From d72176296d74a1a949c9b2edb3709132f7640118 Mon Sep 17 00:00:00 2001 From: Felipe Leme Date: Mon, 13 May 2019 10:11:36 -0700 Subject: [PATCH] Revert "Temporarily hide some APIs." This reverts commit 4e574efe28ba0e6c59e82641ee26c5cd910f96b1. Test: m update-api ds-docs Test: atest CtsContentCaptureServiceTestCases Fixes: 130726495 Change-Id: I65e04d454afe552a34fa15ca8ce30f33db566770 --- api/current.txt | 10 +++++ api/test-current.txt | 9 ---- core/java/android/view/View.java | 45 ++++--------------- .../contentcapture/ContentCaptureManager.java | 2 +- .../contentcapture/ContentCaptureSession.java | 2 +- core/java/android/webkit/WebView.java | 1 - core/res/res/values/attrs.xml | 5 +-- core/res/res/values/public.xml | 1 + 8 files changed, 23 insertions(+), 52 deletions(-) diff --git a/api/current.txt b/api/current.txt index a3af2ba0f4278..d0b57d404dac1 100644 --- a/api/current.txt +++ b/api/current.txt @@ -745,6 +745,7 @@ package android { field public static final int immersive = 16843456; // 0x10102c0 field public static final int importantForAccessibility = 16843690; // 0x10103aa field public static final int importantForAutofill = 16844120; // 0x1010558 + field public static final int importantForContentCapture = 16844295; // 0x1010607 field public static final int inAnimation = 16843127; // 0x1010177 field public static final int includeFontPadding = 16843103; // 0x101015f field public static final int includeInGlobalSearch = 16843374; // 0x101026e @@ -50221,6 +50222,7 @@ package android.view { method @android.view.ViewDebug.CapturedViewProperty @IdRes public int getId(); method @android.view.ViewDebug.ExportedProperty(category="accessibility", mapping={@android.view.ViewDebug.IntToString(from=android.view.View.IMPORTANT_FOR_ACCESSIBILITY_AUTO, to="auto"), @android.view.ViewDebug.IntToString(from=android.view.View.IMPORTANT_FOR_ACCESSIBILITY_YES, to="yes"), @android.view.ViewDebug.IntToString(from=android.view.View.IMPORTANT_FOR_ACCESSIBILITY_NO, to="no"), @android.view.ViewDebug.IntToString(from=android.view.View.IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS, to="noHideDescendants")}) public int getImportantForAccessibility(); method @android.view.ViewDebug.ExportedProperty(mapping={@android.view.ViewDebug.IntToString(from=android.view.View.IMPORTANT_FOR_AUTOFILL_AUTO, to="auto"), @android.view.ViewDebug.IntToString(from=android.view.View.IMPORTANT_FOR_AUTOFILL_YES, to="yes"), @android.view.ViewDebug.IntToString(from=android.view.View.IMPORTANT_FOR_AUTOFILL_NO, to="no"), @android.view.ViewDebug.IntToString(from=android.view.View.IMPORTANT_FOR_AUTOFILL_YES_EXCLUDE_DESCENDANTS, to="yesExcludeDescendants"), @android.view.ViewDebug.IntToString(from=android.view.View.IMPORTANT_FOR_AUTOFILL_NO_EXCLUDE_DESCENDANTS, to="noExcludeDescendants")}) public int getImportantForAutofill(); + method @android.view.ViewDebug.ExportedProperty(mapping={@android.view.ViewDebug.IntToString(from=android.view.View.IMPORTANT_FOR_CONTENT_CAPTURE_AUTO, to="auto"), @android.view.ViewDebug.IntToString(from=android.view.View.IMPORTANT_FOR_CONTENT_CAPTURE_YES, to="yes"), @android.view.ViewDebug.IntToString(from=android.view.View.IMPORTANT_FOR_CONTENT_CAPTURE_NO, to="no"), @android.view.ViewDebug.IntToString(from=android.view.View.IMPORTANT_FOR_CONTENT_CAPTURE_YES_EXCLUDE_DESCENDANTS, to="yesExcludeDescendants"), @android.view.ViewDebug.IntToString(from=android.view.View.IMPORTANT_FOR_CONTENT_CAPTURE_NO_EXCLUDE_DESCENDANTS, to="noExcludeDescendants")}) public int getImportantForContentCapture(); method public boolean getKeepScreenOn(); method public android.view.KeyEvent.DispatcherState getKeyDispatcherState(); method @android.view.ViewDebug.ExportedProperty(category="accessibility") @IdRes public int getLabelFor(); @@ -50361,6 +50363,7 @@ package android.view { method @android.view.ViewDebug.ExportedProperty public boolean isHovered(); method public boolean isImportantForAccessibility(); method public final boolean isImportantForAutofill(); + method public final boolean isImportantForContentCapture(); method public boolean isInEditMode(); method public boolean isInLayout(); method @android.view.ViewDebug.ExportedProperty public boolean isInTouchMode(); @@ -50435,6 +50438,7 @@ package android.view { method @CallSuper public void onPopulateAccessibilityEvent(android.view.accessibility.AccessibilityEvent); method public void onProvideAutofillStructure(android.view.ViewStructure, int); method public void onProvideAutofillVirtualStructure(android.view.ViewStructure, int); + method public void onProvideContentCaptureStructure(@NonNull android.view.ViewStructure, int); method public void onProvideStructure(android.view.ViewStructure); method public void onProvideVirtualStructure(android.view.ViewStructure); method public android.view.PointerIcon onResolvePointerIcon(android.view.MotionEvent, int); @@ -50560,6 +50564,7 @@ package android.view { method public void setId(@IdRes int); method public void setImportantForAccessibility(int); method public void setImportantForAutofill(int); + method public void setImportantForContentCapture(int); method public void setKeepScreenOn(boolean); method public void setKeyboardNavigationCluster(boolean); method public void setLabelFor(@IdRes int); @@ -50738,6 +50743,11 @@ package android.view { field public static final int IMPORTANT_FOR_AUTOFILL_NO_EXCLUDE_DESCENDANTS = 8; // 0x8 field public static final int IMPORTANT_FOR_AUTOFILL_YES = 1; // 0x1 field public static final int IMPORTANT_FOR_AUTOFILL_YES_EXCLUDE_DESCENDANTS = 4; // 0x4 + field public static final int IMPORTANT_FOR_CONTENT_CAPTURE_AUTO = 0; // 0x0 + field public static final int IMPORTANT_FOR_CONTENT_CAPTURE_NO = 2; // 0x2 + field public static final int IMPORTANT_FOR_CONTENT_CAPTURE_NO_EXCLUDE_DESCENDANTS = 8; // 0x8 + field public static final int IMPORTANT_FOR_CONTENT_CAPTURE_YES = 1; // 0x1 + field public static final int IMPORTANT_FOR_CONTENT_CAPTURE_YES_EXCLUDE_DESCENDANTS = 4; // 0x4 field public static final int INVISIBLE = 4; // 0x4 field public static final int KEEP_SCREEN_ON = 67108864; // 0x4000000 field public static final int LAYER_TYPE_HARDWARE = 2; // 0x2 diff --git a/api/test-current.txt b/api/test-current.txt index 842024ca5ac1f..6bf0629b36624 100644 --- a/api/test-current.txt +++ b/api/test-current.txt @@ -3171,12 +3171,9 @@ package android.view { } @UiThread public class View implements android.view.accessibility.AccessibilityEventSource android.graphics.drawable.Drawable.Callback android.view.KeyEvent.Callback { - method @android.view.ViewDebug.ExportedProperty(mapping={@android.view.ViewDebug.IntToString(from=android.view.View.IMPORTANT_FOR_CONTENT_CAPTURE_AUTO, to="auto"), @android.view.ViewDebug.IntToString(from=android.view.View.IMPORTANT_FOR_CONTENT_CAPTURE_YES, to="yes"), @android.view.ViewDebug.IntToString(from=android.view.View.IMPORTANT_FOR_CONTENT_CAPTURE_NO, to="no"), @android.view.ViewDebug.IntToString(from=android.view.View.IMPORTANT_FOR_CONTENT_CAPTURE_YES_EXCLUDE_DESCENDANTS, to="yesExcludeDescendants"), @android.view.ViewDebug.IntToString(from=android.view.View.IMPORTANT_FOR_CONTENT_CAPTURE_NO_EXCLUDE_DESCENDANTS, to="noExcludeDescendants")}) public int getImportantForContentCapture(); method public android.view.View getTooltipView(); method public static boolean isDefaultFocusHighlightEnabled(); method public boolean isDefaultFocusHighlightNeeded(android.graphics.drawable.Drawable, android.graphics.drawable.Drawable); - method public final boolean isImportantForContentCapture(); - method public void onProvideContentCaptureStructure(@NonNull android.view.ViewStructure, int); method protected void resetResolvedDrawables(); method public void resetResolvedLayoutDirection(); method public void resetResolvedPadding(); @@ -3187,13 +3184,7 @@ package android.view { method public boolean restoreFocusNotInCluster(); method public void setAutofilled(boolean); method public final void setFocusedInCluster(); - method public void setImportantForContentCapture(int); method public void setIsRootNamespace(boolean); - field public static final int IMPORTANT_FOR_CONTENT_CAPTURE_AUTO = 0; // 0x0 - field public static final int IMPORTANT_FOR_CONTENT_CAPTURE_NO = 2; // 0x2 - field public static final int IMPORTANT_FOR_CONTENT_CAPTURE_NO_EXCLUDE_DESCENDANTS = 8; // 0x8 - field public static final int IMPORTANT_FOR_CONTENT_CAPTURE_YES = 1; // 0x1 - field public static final int IMPORTANT_FOR_CONTENT_CAPTURE_YES_EXCLUDE_DESCENDANTS = 4; // 0x4 } public class ViewConfiguration { diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java index 3590c3422d467..4d827b6dcf270 100644 --- a/core/java/android/view/View.java +++ b/core/java/android/view/View.java @@ -1393,10 +1393,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, * * @see #isImportantForContentCapture() * @see #setImportantForContentCapture(int) - * - * @hide */ - @TestApi public static final int IMPORTANT_FOR_CONTENT_CAPTURE_AUTO = 0x0; /** @@ -1404,10 +1401,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, * * @see #isImportantForContentCapture() * @see #setImportantForContentCapture(int) - * - * @hide */ - @TestApi public static final int IMPORTANT_FOR_CONTENT_CAPTURE_YES = 0x1; /** @@ -1415,10 +1409,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, * * @see #isImportantForContentCapture() * @see #setImportantForContentCapture(int) - * - * @hide */ - @TestApi public static final int IMPORTANT_FOR_CONTENT_CAPTURE_NO = 0x2; /** @@ -1426,10 +1417,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, * * @see #isImportantForContentCapture() * @see #setImportantForContentCapture(int) - * - * @hide */ - @TestApi public static final int IMPORTANT_FOR_CONTENT_CAPTURE_YES_EXCLUDE_DESCENDANTS = 0x4; /** @@ -1438,10 +1426,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, * * @see #isImportantForContentCapture() * @see #setImportantForContentCapture(int) - * - * @hide */ - @TestApi public static final int IMPORTANT_FOR_CONTENT_CAPTURE_NO_EXCLUDE_DESCENDANTS = 0x8; @@ -8602,10 +8587,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, *
  • {@link ViewStructure#setTransformation(Matrix)} * * - * - * @hide */ - @TestApi public void onProvideContentCaptureStructure(@NonNull ViewStructure structure, int flags) { onProvideStructure(structure, VIEW_STRUCTURE_FOR_CONTENT_CAPTURE, flags); } @@ -9256,8 +9238,6 @@ public class View implements Drawable.Callback, KeyEvent.Callback, * {@link #setImportantForContentCapture(int)}. * * @attr ref android.R.styleable#View_importantForContentCapture - * - * @hide */ @ViewDebug.ExportedProperty(mapping = { @ViewDebug.IntToString(from = IMPORTANT_FOR_CONTENT_CAPTURE_AUTO, to = "auto"), @@ -9267,16 +9247,15 @@ public class View implements Drawable.Callback, KeyEvent.Callback, to = "yesExcludeDescendants"), @ViewDebug.IntToString(from = IMPORTANT_FOR_CONTENT_CAPTURE_NO_EXCLUDE_DESCENDANTS, to = "noExcludeDescendants")}) -// @InspectableProperty(enumMapping = { -// @EnumEntry(value = IMPORTANT_FOR_CONTENT_CAPTURE_AUTO, name = "auto"), -// @EnumEntry(value = IMPORTANT_FOR_CONTENT_CAPTURE_YES, name = "yes"), -// @EnumEntry(value = IMPORTANT_FOR_CONTENT_CAPTURE_NO, name = "no"), -// @EnumEntry(value = IMPORTANT_FOR_CONTENT_CAPTURE_YES_EXCLUDE_DESCENDANTS, -// name = "yesExcludeDescendants"), -// @EnumEntry(value = IMPORTANT_FOR_CONTENT_CAPTURE_NO_EXCLUDE_DESCENDANTS, -// name = "noExcludeDescendants"), -// }) - @TestApi + @InspectableProperty(enumMapping = { + @EnumEntry(value = IMPORTANT_FOR_CONTENT_CAPTURE_AUTO, name = "auto"), + @EnumEntry(value = IMPORTANT_FOR_CONTENT_CAPTURE_YES, name = "yes"), + @EnumEntry(value = IMPORTANT_FOR_CONTENT_CAPTURE_NO, name = "no"), + @EnumEntry(value = IMPORTANT_FOR_CONTENT_CAPTURE_YES_EXCLUDE_DESCENDANTS, + name = "yesExcludeDescendants"), + @EnumEntry(value = IMPORTANT_FOR_CONTENT_CAPTURE_NO_EXCLUDE_DESCENDANTS, + name = "noExcludeDescendants"), + }) public @ContentCaptureImportance int getImportantForContentCapture() { // NOTE: the important for content capture values were the first flags added and are set in // the rightmost position, so we don't need to shift them @@ -9296,10 +9275,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, * or {@link #IMPORTANT_FOR_CONTENT_CAPTURE_NO_EXCLUDE_DESCENDANTS}. * * @attr ref android.R.styleable#View_importantForContentCapture - * - * @hide */ - @TestApi public void setImportantForContentCapture(@ContentCaptureImportance int mode) { // Reset first mPrivateFlags4 &= ~PFLAG4_IMPORTANT_FOR_CONTENT_CAPTURE_MASK; @@ -9324,10 +9300,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, * @see #IMPORTANT_FOR_CONTENT_CAPTURE_NO * @see #IMPORTANT_FOR_CONTENT_CAPTURE_YES_EXCLUDE_DESCENDANTS * @see #IMPORTANT_FOR_CONTENT_CAPTURE_NO_EXCLUDE_DESCENDANTS - * - * @hide */ - @TestApi public final boolean isImportantForContentCapture() { boolean isImportant; if ((mPrivateFlags4 & PFLAG4_CONTENT_CAPTURE_IMPORTANCE_IS_CACHED) != 0) { diff --git a/core/java/android/view/contentcapture/ContentCaptureManager.java b/core/java/android/view/contentcapture/ContentCaptureManager.java index edd4b6485c7d5..d22fac996dbb4 100644 --- a/core/java/android/view/contentcapture/ContentCaptureManager.java +++ b/core/java/android/view/contentcapture/ContentCaptureManager.java @@ -193,7 +193,7 @@ import java.util.Set; *

    If your view provides its own virtual hierarchy (for example, if it's a browser that draws * the HTML using {@link Canvas} or native libraries in a different render process), then the view * is also responsible to notify the session when the virtual elements appear and disappear - see - * {@code View#onProvideContentCaptureStructure(ViewStructure, int)} for more info. + * {@link View#onProvideContentCaptureStructure(ViewStructure, int)} for more info. */ @SystemService(Context.CONTENT_CAPTURE_MANAGER_SERVICE) public final class ContentCaptureManager { diff --git a/core/java/android/view/contentcapture/ContentCaptureSession.java b/core/java/android/view/contentcapture/ContentCaptureSession.java index 975d481ef8c2b..625fcda76563f 100644 --- a/core/java/android/view/contentcapture/ContentCaptureSession.java +++ b/core/java/android/view/contentcapture/ContentCaptureSession.java @@ -358,7 +358,7 @@ public abstract class ContentCaptureSession implements AutoCloseable { * *

    Typically called "manually" by views that handle their own virtual view hierarchy, or * automatically by the Android System for views that return {@code true} on - * {@code View#onProvideContentCaptureStructure(ViewStructure, int)}. + * {@link View#onProvideContentCaptureStructure(ViewStructure, int)}. * * @param node node that has been added. */ diff --git a/core/java/android/webkit/WebView.java b/core/java/android/webkit/WebView.java index 9dc66d77ea44c..26dba45666fc0 100644 --- a/core/java/android/webkit/WebView.java +++ b/core/java/android/webkit/WebView.java @@ -2798,7 +2798,6 @@ public class WebView extends AbsoluteLayout mProvider.getViewDelegate().onProvideAutofillVirtualStructure(structure, flags); } - /** @hide */ @Override public void onProvideContentCaptureStructure(ViewStructure structure, int flags) { mProvider.getViewDelegate().onProvideContentCaptureStructure(structure, flags); diff --git a/core/res/res/values/attrs.xml b/core/res/res/values/attrs.xml index f2d2c2eb67337..2e810851887ce 100644 --- a/core/res/res/values/attrs.xml +++ b/core/res/res/values/attrs.xml @@ -2492,11 +2492,8 @@ - - + use for content capture purposes. --> diff --git a/core/res/res/values/public.xml b/core/res/res/values/public.xml index fb54566fc9593..036d9594058f5 100644 --- a/core/res/res/values/public.xml +++ b/core/res/res/values/public.xml @@ -2998,6 +2998,7 @@ +