From c4d43ae94a1ae737e0f95a50ecbca76ba4a88f95 Mon Sep 17 00:00:00 2001 From: Mateus Azis Date: Thu, 18 Jan 2024 14:47:05 -0800 Subject: [PATCH] Make AsyncSecurityPolicy.checkAuthorizationAsync public. I initially omitted the visibility modifier because this class began as an interface. Since it moved to an abstract class, we must make it public so it can be overriden by subclasses in the integrator's packages. Part of #10566. --- .../androidTest/java/io/grpc/binder/BinderSecurityTest.java | 6 +++--- .../src/main/java/io/grpc/binder/AsyncSecurityPolicy.java | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/binder/src/androidTest/java/io/grpc/binder/BinderSecurityTest.java b/binder/src/androidTest/java/io/grpc/binder/BinderSecurityTest.java index 42796e2caed..1c770110fb6 100644 --- a/binder/src/androidTest/java/io/grpc/binder/BinderSecurityTest.java +++ b/binder/src/androidTest/java/io/grpc/binder/BinderSecurityTest.java @@ -188,7 +188,7 @@ public void testFailedFuturesPropagateOriginalException() throws Exception { ServerSecurityPolicy.newBuilder() .servicePolicy("foo", new AsyncSecurityPolicy() { @Override - ListenableFuture checkAuthorizationAsync(int uid) { + public ListenableFuture checkAuthorizationAsync(int uid) { return Futures.immediateFailedFuture(originalException); } }) @@ -207,7 +207,7 @@ public void testFailedFuturesAreNotCachedPermanently() throws Exception { ServerSecurityPolicy.newBuilder() .servicePolicy("foo", new AsyncSecurityPolicy() { @Override - ListenableFuture checkAuthorizationAsync(int uid) { + public ListenableFuture checkAuthorizationAsync(int uid) { if (firstAttempt.getAndSet(false)) { return Futures.immediateFailedFuture(new IllegalStateException()); } @@ -229,7 +229,7 @@ public void testCancelledFuturesAreNotCachedPermanently() throws Exception { ServerSecurityPolicy.newBuilder() .servicePolicy("foo", new AsyncSecurityPolicy() { @Override - ListenableFuture checkAuthorizationAsync(int uid) { + public ListenableFuture checkAuthorizationAsync(int uid) { if (firstAttempt.getAndSet(false)) { return Futures.immediateCancelledFuture(); } diff --git a/binder/src/main/java/io/grpc/binder/AsyncSecurityPolicy.java b/binder/src/main/java/io/grpc/binder/AsyncSecurityPolicy.java index f6516aae2f7..11952a21f9b 100644 --- a/binder/src/main/java/io/grpc/binder/AsyncSecurityPolicy.java +++ b/binder/src/main/java/io/grpc/binder/AsyncSecurityPolicy.java @@ -67,5 +67,5 @@ public final Status checkAuthorization(int uid) { * @return A {@link ListenableFuture} for a gRPC {@link Status} object, with OK indicating * authorized. */ - abstract ListenableFuture checkAuthorizationAsync(int uid); + public abstract ListenableFuture checkAuthorizationAsync(int uid); }