Skip to content

Commit 349a35a

Browse files
authored
android: Fix UdsChannelBuilder with WiFi Proxy
We want to avoid "[{0}] Failed to resolve name. status={1}" I/O failures for UDS channels when WiFi Proxies are enabled, as it should be local communication. Fixes #11922
1 parent f96ce06 commit 349a35a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

android/src/main/java/io/grpc/android/UdsChannelBuilder.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import io.grpc.ExperimentalApi;
2222
import io.grpc.InsecureChannelCredentials;
2323
import io.grpc.ManagedChannelBuilder;
24+
import io.grpc.internal.GrpcUtil;
2425
import java.lang.reflect.InvocationTargetException;
2526
import javax.annotation.Nullable;
2627
import javax.net.SocketFactory;
@@ -81,7 +82,7 @@ public static ManagedChannelBuilder<?> forPath(String path, Namespace namespace)
8182
OKHTTP_CHANNEL_BUILDER_CLASS
8283
.getMethod("socketFactory", SocketFactory.class)
8384
.invoke(builder, new UdsSocketFactory(path, namespace));
84-
return builder;
85+
return builder.proxyDetector(GrpcUtil.NOOP_PROXY_DETECTOR);
8586
} catch (IllegalAccessException e) {
8687
throw new RuntimeException("Failed to create OkHttpChannelBuilder", e);
8788
} catch (NoSuchMethodException e) {

0 commit comments

Comments
 (0)