summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShimi Zhang <ctzsm@chromium.org>2018-11-13 03:28:56 +0000
committerCommit Bot <commit-bot@chromium.org>2018-11-13 03:28:56 +0000
commit96dd6679dfaeb18044269290d14ebcb275b72493 (patch)
treea5d72053fdebce519e6a48974bded2cf60e8c01f
parentf2ab640c32f909e680dca3c8e99ac9f6300302a5 (diff)
downloadwebview_support_interfaces-96dd6679dfaeb18044269290d14ebcb275b72493.tar.gz
aw: Move "new InvocationHandler[]" to SL util.
To avoid PRESUBMIT check for InvocationHandler annotation check. Should be no logic change. Bug: None Change-Id: I91680e54c5b0f0cc692b841a57f7f5b68f724d9b Reviewed-on: https://chromium-review.googlesource.com/c/1323624 Commit-Queue: Shimi Zhang <ctzsm@chromium.org> Reviewed-by: Nate Fischer <ntfschr@chromium.org> Cr-Original-Commit-Position: refs/heads/master@{#607472} Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src Cr-Mirrored-Commit: 5f983318b1d721930c291af3c1e4104273e7ac21
-rw-r--r--src/org/chromium/support_lib_boundary/util/BoundaryInterfaceReflectionUtil.java14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/org/chromium/support_lib_boundary/util/BoundaryInterfaceReflectionUtil.java b/src/org/chromium/support_lib_boundary/util/BoundaryInterfaceReflectionUtil.java
index dcf3b56..566535b 100644
--- a/src/org/chromium/support_lib_boundary/util/BoundaryInterfaceReflectionUtil.java
+++ b/src/org/chromium/support_lib_boundary/util/BoundaryInterfaceReflectionUtil.java
@@ -74,6 +74,20 @@ public class BoundaryInterfaceReflectionUtil {
}
/**
+ * Plural version of {@link #createInvocationHandlerFor(Object)}.
+ */
+ @TargetApi(Build.VERSION_CODES.KITKAT)
+ public static InvocationHandler[] createInvocationHandlersForArray(final Object[] delegates) {
+ if (delegates == null) return null;
+
+ InvocationHandler[] handlers = new InvocationHandler[delegates.length];
+ for (int i = 0; i < handlers.length; i++) {
+ handlers[i] = createInvocationHandlerFor(delegates[i]);
+ }
+ return handlers;
+ }
+
+ /**
* Assuming that the given InvocationHandler was created in the current classloader and is an
* InvocationHandlerWithDelegateGetter, return the object the InvocationHandler delegates its
* method calls to.