Centralize creation and error handling for VsockServerInfo
Provide helper functions that create VsockServerInfo objects
from either the command line or the property storage, and
have them return optional instead of relying on default values.
Also, avoid atoi() since it has the potential for undefined behavior.
Test: build
Change-Id: I0aab6b7d84e5084580e25217ac5ba4f5a1db6e2a
diff --git a/automotive/vehicle/2.0/default/android.hardware.automotive.vehicle@2.0-virtualization-grpc-server.rc b/automotive/vehicle/2.0/default/android.hardware.automotive.vehicle@2.0-virtualization-grpc-server.rc
index 29147ad..1101b08 100644
--- a/automotive/vehicle/2.0/default/android.hardware.automotive.vehicle@2.0-virtualization-grpc-server.rc
+++ b/automotive/vehicle/2.0/default/android.hardware.automotive.vehicle@2.0-virtualization-grpc-server.rc
@@ -3,8 +3,8 @@
# so the command line arguments are expected, though not conventionally used in Android
service vendor.vehicle-hal-2.0-server \
/vendor/bin/hw/android.hardware.automotive.vehicle@2.0-virtualization-grpc-server \
- -server_cid ${ro.vendor.vehiclehal.server.cid:-0} \
- -server_port ${ro.vendor.vehiclehal.server.port:-0}
+ -server_cid ${ro.vendor.vehiclehal.server.cid:-pleaseconfigurethis} \
+ -server_port ${ro.vendor.vehiclehal.server.port:-pleaseconfigurethis}
class hal
user vehicle_network
group system inet