Commit graph

7 commits

Author SHA1 Message Date
Jason Jeremy Iman
8bde191202 Enable "localfilesystem" UNIX domain socket for ADB.
This patch introduce "service.adb.listen_addrs", a new
string type property, while keeping the old properties.
The new property added in this patch is used to listen
on UNIX domain socket "localfilesystem".

"service.adb.listen_addrs" can be used to listen on
multiple addresses, such as tcp:5555 and tcp:5556.
It is separated by ',' (comma) character.

In the process of introducing the new socket type, the
method tcp_connect is removed and combined into
socket_spec_connect.

Without specifying using the new property, adb will
try to listen on both tcp and vsock (following the
previous implementation).

Some examples of the new property value are:
  - "tcp:5555"
  - "vsock:5555"
  - "localfilesystem:/tmp/test"
  - "tcp:5555,vsock:5555"

Bug: 133378083
Test: On master-arc-dev:
        adb root;
        setprop service.adb.listen_addrs localfilesystem:
	    <path_to_socket>;
        adb connect localfilesystem:<path_to_socket>;
        adb -s localfilesystem:<path_to_socket> shell;
	    inside Chrome OS.
Test: On aosp_bluefin:
        setprop service.adb.listen_addr tcp:5555;
        adb connect <IP>:5555; adb shell;
Test: On aosp_bluefin:
        setprop service.adb.tcp.port 5555;
        adb connect <IP>:5555; adb shell;
Test: On aosp_bluefin:
        setprop service.adb.listen_addrs tcp:5555,tcp:6666;
        adb connect <IP>:5555; adb shell;
        adb connect <IP>:6666; adb shell;
Test: On aosp_bluefin:
        ./adb_test;
Test: On cuttlefish:
        launch_cvd;
        adb -s 127.0.0.1:6520 shell;
Test: Ran host tests:
        ./adb_test;
        ./adb_integration_test_adb;
        ./adb_integration_test_device;

Change-Id: I8289bf0ab3305cf23ce5695ffba46845d58ef6bb
2019-12-04 10:05:05 +09:00
Josh Gao
d10b7c4e02 adb: attempt to exec newer adb servers on Linux.
Test: manual
Change-Id: Iebdfa292f21b2871e6010ab6cc964134fec447e9
2019-03-14 15:41:41 -07:00
Cody Schuffelen
af0e220fb1 Combine tcp_connect and socket_spec_connect.
This will make it easier to add new types of transports by combining the
logic the adb server and adb daemon use to connect to things.

Bug:121166534
Test: adb connect against a cuttlefish instance over the shm proxy.
Change-Id: Ic7fc848c60a85eef968c3735838c87cb7fdaf38b
2019-01-17 15:58:41 -08:00
Josh Gao
9dd1f5c0b7 adb: switch socket spec to string_view.
Test: test_adb.py
Test: test_device.py
Test: $ANDROID_HOST_OUT/nativetest64/adb_test/adb_test
Test: adb shell /data/nativetest64/adbd_test/adbd_test
Change-Id: I92c057215e041b98abb026628ea4acfba8a8132d
2018-12-21 11:53:27 -08:00
Josh Gao
1099215e30 adb: parse tcp socket specs with base::ParseNetAddress.
libbase already has IPv6-aware address parsing, so use it instead of
adb's handrolled IPv4-only parsing.

Bug: http://b/31537253
Change-Id: I4e9ce56b55d7d02787c0fa67b724490bf49ce479
Test: mma && adb start-server && \
      adb -L 'tcp:[::ffff:127.0.0.1]:5037' devices && \
      adb -L 'tcp:localhost:5037' devices && \
      adb -L 'tcp:127.0.0.1:5037' devices && \
      adb -L 'tcp:5037' devices && \
      $ANDROID_HOST_OUT/nativetest64/adb_test/adb_test
2016-09-20 13:55:43 -07:00
Josh Gao
9c869b58a8 adb: allow use of arbitrary socket specs for command socket.
Bug: http://b/30445394
Change-Id: I474ede35ec3c56ad86da503c9703f83ef5e80862
2016-09-01 15:49:06 -07:00
Josh Gao
cfb21412e5 adb: factor out socket specification.
Move the logic for string socket specification out to separate
functions to facilitate using arbitrary sockets for the adb command
socket.

Bug: http://b/30445394
Change-Id: Icd8fdb853272edc029fb3a0f5b18e941dc8ef52c
Test: adb_test, adbd_test, test_device.py
2016-08-25 17:12:26 -07:00