binder: Updates to support migrations to this API from internal versions. (#8299)

This commit is contained in:
markb74 2021-07-02 12:53:47 +02:00 committed by GitHub
parent f86dc6c89f
commit 06d34925f9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 2 deletions

View File

@ -41,7 +41,7 @@ import java.net.SocketAddress;
* type and data URI. * type and data URI.
*/ */
@ExperimentalApi("https://github.com/grpc/grpc-java/issues/8022") @ExperimentalApi("https://github.com/grpc/grpc-java/issues/8022")
public final class AndroidComponentAddress extends SocketAddress { public class AndroidComponentAddress extends SocketAddress { // NOTE: Only temporarily non-final.
private static final long serialVersionUID = 0L; private static final long serialVersionUID = 0L;
private final Intent bindIntent; // An "explicit" Intent. In other words, getComponent() != null. private final Intent bindIntent; // An "explicit" Intent. In other words, getComponent() != null.

View File

@ -17,6 +17,7 @@
package io.grpc.binder.internal; package io.grpc.binder.internal;
import io.grpc.Attributes; import io.grpc.Attributes;
import io.grpc.Internal;
import io.grpc.Metadata; import io.grpc.Metadata;
import io.grpc.MethodDescriptor; import io.grpc.MethodDescriptor;
import io.grpc.SecurityLevel; import io.grpc.SecurityLevel;
@ -48,6 +49,7 @@ public final class BinderTransportSecurity {
* *
* @param serverBuilder The ServerBuilder being used to create the server. * @param serverBuilder The ServerBuilder being used to create the server.
*/ */
@Internal
public static void installAuthInterceptor(ServerBuilder<?> serverBuilder) { public static void installAuthInterceptor(ServerBuilder<?> serverBuilder) {
serverBuilder.intercept(new ServerAuthInterceptor()); serverBuilder.intercept(new ServerAuthInterceptor());
} }
@ -60,7 +62,8 @@ public final class BinderTransportSecurity {
* @param remoteUid The remote UID of the transport. * @param remoteUid The remote UID of the transport.
* @param securityPolicy The policy to enforce on this transport. * @param securityPolicy The policy to enforce on this transport.
*/ */
static void attachAuthAttrs( @Internal
public static void attachAuthAttrs(
Attributes.Builder builder, int remoteUid, ServerSecurityPolicy securityPolicy) { Attributes.Builder builder, int remoteUid, ServerSecurityPolicy securityPolicy) {
builder builder
.set( .set(