From 818444f5c610852a11fd3c03e5c01f703dae60b0 Mon Sep 17 00:00:00 2001 From: Peter Wen Date: Wed, 13 May 2020 21:15:37 +0000 Subject: Android: Add webview boundaries apk for lint Lint no longer runs per-library so we need an apk to ensure these interface boundaries remain at minSdkVersion 14. Switch @TargetApi to @RequiresApi for lint. Add this apk to android_compile_dbg so that it is verified by the CQ. Bug: 1017190,1082319 Fixes: 1082319 Change-Id: I94064c781bd39b046fbfe9a1f03eb38292eeb24d Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2199579 Commit-Queue: Peter Wen Reviewed-by: Nate Fischer Reviewed-by: Ben Pastene Reviewed-by: Richard Coles Auto-Submit: Peter Wen Cr-Original-Commit-Position: refs/heads/master@{#768455} Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src Cr-Mirrored-Commit: 41c7be9fc741bd26f8eeb2cea57d1069d26283d4 --- .../util/BoundaryInterfaceReflectionUtil.java | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'src/org/chromium/support_lib_boundary/util') diff --git a/src/org/chromium/support_lib_boundary/util/BoundaryInterfaceReflectionUtil.java b/src/org/chromium/support_lib_boundary/util/BoundaryInterfaceReflectionUtil.java index 1c5f369..c2dc613 100644 --- a/src/org/chromium/support_lib_boundary/util/BoundaryInterfaceReflectionUtil.java +++ b/src/org/chromium/support_lib_boundary/util/BoundaryInterfaceReflectionUtil.java @@ -3,12 +3,11 @@ // found in the LICENSE file. package org.chromium.support_lib_boundary.util; -import android.annotation.SuppressLint; -import android.annotation.TargetApi; import android.os.Build; import androidx.annotation.NonNull; import androidx.annotation.Nullable; +import androidx.annotation.RequiresApi; import java.lang.reflect.InvocationHandler; import java.lang.reflect.InvocationTargetException; @@ -22,7 +21,6 @@ import java.util.Collection; */ // Although this is not enforced in chromium, this is a requirement enforced when this file is // mirrored into AndroidX. See http://b/120770118 for details. -@SuppressLint("BanTargetApiAnnotation") public class BoundaryInterfaceReflectionUtil { /** * Check if an object is an instance of {@code className}, resolving {@code className} in @@ -91,7 +89,7 @@ public class BoundaryInterfaceReflectionUtil { * method calls to. * @return an InvocationHandlerWithDelegateGetter wrapping {@code delegate} */ - @TargetApi(Build.VERSION_CODES.KITKAT) + @RequiresApi(Build.VERSION_CODES.KITKAT) @Nullable public static InvocationHandler createInvocationHandlerFor(@Nullable final Object delegate) { if (delegate == null) return null; @@ -111,7 +109,7 @@ public class BoundaryInterfaceReflectionUtil { * @return an array of InvocationHandlerWithDelegateGetter instances, each delegating to * the corresponding member of {@code delegates}. */ - @TargetApi(Build.VERSION_CODES.KITKAT) + @RequiresApi(Build.VERSION_CODES.KITKAT) @Nullable public static InvocationHandler[] createInvocationHandlersForArray( @Nullable final Object[] delegates) { @@ -148,7 +146,7 @@ public class BoundaryInterfaceReflectionUtil { * This allows us to pass InvocationHandlers across the support library boundary and later * unwrap the objects used as delegates within those InvocationHandlers. */ - @TargetApi(Build.VERSION_CODES.KITKAT) + @RequiresApi(Build.VERSION_CODES.KITKAT) private static class InvocationHandlerWithDelegateGetter implements InvocationHandler { private final Object mDelegate; -- cgit v1.2.3