Specify a eth interface for grpc connection.
When enabling wifi on seahawk, the main network interface changes
so we need to explicitly specify the eth interface we want to
use for our grpc connection.
Note that using setsockopt requires NET_RAW permission which is
only granted to limited apps. As a result, selinux permissive
mode is required for this CL to work.
Test: Manual test on seahawk, verify grpc is connected okay.
Bug: 261108682
Change-Id: I95c9f796bf40226b612edf284188ffc6d095086f
diff --git a/automotive/remoteaccess/hal/default/Android.bp b/automotive/remoteaccess/hal/default/Android.bp
index f27b8f8..bfab1ed 100644
--- a/automotive/remoteaccess/hal/default/Android.bp
+++ b/automotive/remoteaccess/hal/default/Android.bp
@@ -22,10 +22,17 @@
name: "remote-access-hal-defaults",
vendor: true,
relative_install_path: "hw",
- srcs: ["src/RemoteAccessImpl.cpp"],
+ srcs: [
+ "src/RemoteAccessImpl.cpp",
+ "src/BindToDeviceSocketMutator.cpp",
+ ],
whole_static_libs: [
"RemoteAccessService",
],
+ static_libs: [
+ "android.hardware.automotive.can@libnetdevice",
+ "libnl++",
+ ],
shared_libs: [
"libbase",
"libbinder_ndk",
@@ -59,6 +66,7 @@
init_rc: ["remoteaccess-tcu-test-service.rc"],
cflags: [
"-DGRPC_SERVICE_ADDRESS=\"10.10.10.1:50051\"",
+ "-DGRPC_SERVICE_IFNAME=\"eth1\"",
],
}