Commit graph

6 commits

Author SHA1 Message Date
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
Elliott Hughes
579e682628 Add std::string StartsWith*/EndsWith* overloads.
We should have done this from the beginning. Thanks to Windows, we're not
going to be able to switch libbase over to std::string_view any time soon.

Bug: N/A
Test: ran tests
Change-Id: Iff2f56986e39de53f3ac484415378af17dacf26b
2017-12-20 09:42:22 -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