Loading core/api/current.txt +0 −1 Original line number Diff line number Diff line Loading @@ -46295,7 +46295,6 @@ package android.view { method public int getFlags(); method @Nullable public android.net.Uri getLinkUri(); method public int getSource(); method @NonNull public android.util.Pair<android.view.ContentInfo,android.view.ContentInfo> partition(@NonNull java.util.function.Predicate<android.content.ClipData.Item>); field public static final int FLAG_CONVERT_TO_PLAIN_TEXT = 1; // 0x1 field public static final int SOURCE_APP = 0; // 0x0 field public static final int SOURCE_AUTOFILL = 4; // 0x4 core/api/test-current.txt +4 −0 Original line number Diff line number Diff line Loading @@ -2016,6 +2016,10 @@ package android.view { field public static final int CALLBACK_ANIMATION = 1; // 0x1 } public final class ContentInfo { method @NonNull public android.util.Pair<android.view.ContentInfo,android.view.ContentInfo> partition(@NonNull java.util.function.Predicate<android.content.ClipData.Item>); } public final class Display { method @NonNull public android.graphics.ColorSpace[] getSupportedWideColorGamut(); method public int getType(); Loading core/java/android/view/ContentInfo.java +4 −0 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ package android.view; import android.annotation.IntDef; import android.annotation.NonNull; import android.annotation.Nullable; import android.annotation.TestApi; import android.content.ClipData; import android.content.ClipDescription; import android.net.Uri; Loading Loading @@ -222,7 +223,10 @@ public final class ContentInfo { * content that matched the predicate, or null if none of the items matched. The pair's * second object will have the content that didn't match the predicate, or null if all of * the items matched. * * @hide */ @TestApi @NonNull public Pair<ContentInfo, ContentInfo> partition( @NonNull Predicate<ClipData.Item> itemPredicate) { Loading core/java/android/view/OnReceiveContentListener.java +2 −3 Original line number Diff line number Diff line Loading @@ -36,7 +36,7 @@ import android.annotation.Nullable; * @Override * public ContentInfo onReceiveContent(View view, ContentInfo payload) { * Pair<ContentInfo, ContentInfo> split = * payload.partition(item -> item.getUri() != null); * ContentInfoCompat.partition(payload, item -> item.getUri() != null); * ContentInfo uriContent = split.first; * ContentInfo remaining = split.second; * if (uriContent != null) { Loading Loading @@ -72,8 +72,7 @@ public interface OnReceiveContentListener { * handling. For example, an implementation may provide handling for content URIs (to provide * support for inserting images, etc) and delegate the processing of text to the platform to * preserve the common behavior for inserting text. See the class javadoc for a sample * implementation and see {@link ContentInfo#partition} for a convenient way to split the * passed-in content. * implementation. * * <p>If implementing handling for text: if the view has a selection, the selection should * be overwritten by the passed-in content; if there's no selection, the passed-in content Loading core/java/android/widget/TextView.java +6 −2 Original line number Diff line number Diff line Loading @@ -13743,8 +13743,12 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener * custom behavior should configure a listener via {@link #setOnReceiveContentListener}. * * <p>For non-editable TextViews the default behavior is a no-op (returns the passed-in * content without acting on it). For editable TextViews the default behavior coerces all * content to text and inserts into the view. * content without acting on it). * * <p>For editable TextViews the default behavior is to insert text into the view, coercing * non-text content to text as needed. The MIME types "text/plain" and "text/html" have * well-defined behavior for this, while other MIME types have reasonable fallback behavior * (see {@link ClipData.Item#coerceToStyledText}). * * @param payload The content to insert and related metadata. * Loading
core/api/current.txt +0 −1 Original line number Diff line number Diff line Loading @@ -46295,7 +46295,6 @@ package android.view { method public int getFlags(); method @Nullable public android.net.Uri getLinkUri(); method public int getSource(); method @NonNull public android.util.Pair<android.view.ContentInfo,android.view.ContentInfo> partition(@NonNull java.util.function.Predicate<android.content.ClipData.Item>); field public static final int FLAG_CONVERT_TO_PLAIN_TEXT = 1; // 0x1 field public static final int SOURCE_APP = 0; // 0x0 field public static final int SOURCE_AUTOFILL = 4; // 0x4
core/api/test-current.txt +4 −0 Original line number Diff line number Diff line Loading @@ -2016,6 +2016,10 @@ package android.view { field public static final int CALLBACK_ANIMATION = 1; // 0x1 } public final class ContentInfo { method @NonNull public android.util.Pair<android.view.ContentInfo,android.view.ContentInfo> partition(@NonNull java.util.function.Predicate<android.content.ClipData.Item>); } public final class Display { method @NonNull public android.graphics.ColorSpace[] getSupportedWideColorGamut(); method public int getType(); Loading
core/java/android/view/ContentInfo.java +4 −0 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ package android.view; import android.annotation.IntDef; import android.annotation.NonNull; import android.annotation.Nullable; import android.annotation.TestApi; import android.content.ClipData; import android.content.ClipDescription; import android.net.Uri; Loading Loading @@ -222,7 +223,10 @@ public final class ContentInfo { * content that matched the predicate, or null if none of the items matched. The pair's * second object will have the content that didn't match the predicate, or null if all of * the items matched. * * @hide */ @TestApi @NonNull public Pair<ContentInfo, ContentInfo> partition( @NonNull Predicate<ClipData.Item> itemPredicate) { Loading
core/java/android/view/OnReceiveContentListener.java +2 −3 Original line number Diff line number Diff line Loading @@ -36,7 +36,7 @@ import android.annotation.Nullable; * @Override * public ContentInfo onReceiveContent(View view, ContentInfo payload) { * Pair<ContentInfo, ContentInfo> split = * payload.partition(item -> item.getUri() != null); * ContentInfoCompat.partition(payload, item -> item.getUri() != null); * ContentInfo uriContent = split.first; * ContentInfo remaining = split.second; * if (uriContent != null) { Loading Loading @@ -72,8 +72,7 @@ public interface OnReceiveContentListener { * handling. For example, an implementation may provide handling for content URIs (to provide * support for inserting images, etc) and delegate the processing of text to the platform to * preserve the common behavior for inserting text. See the class javadoc for a sample * implementation and see {@link ContentInfo#partition} for a convenient way to split the * passed-in content. * implementation. * * <p>If implementing handling for text: if the view has a selection, the selection should * be overwritten by the passed-in content; if there's no selection, the passed-in content Loading
core/java/android/widget/TextView.java +6 −2 Original line number Diff line number Diff line Loading @@ -13743,8 +13743,12 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener * custom behavior should configure a listener via {@link #setOnReceiveContentListener}. * * <p>For non-editable TextViews the default behavior is a no-op (returns the passed-in * content without acting on it). For editable TextViews the default behavior coerces all * content to text and inserts into the view. * content without acting on it). * * <p>For editable TextViews the default behavior is to insert text into the view, coercing * non-text content to text as needed. The MIME types "text/plain" and "text/html" have * well-defined behavior for this, while other MIME types have reasonable fallback behavior * (see {@link ClipData.Item#coerceToStyledText}). * * @param payload The content to insert and related metadata. *