adb: finish switching service creation 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: If4ea92aee1c0264d946de72483f8d715d96fcfd8
diff --git a/adb/adb.cpp b/adb/adb.cpp
index c78b96b..fdf720c 100644
--- a/adb/adb.cpp
+++ b/adb/adb.cpp
@@ -357,9 +357,9 @@
case A_OPEN: /* OPEN(local-id, 0, "destination") */
if (t->online && p->msg.arg0 != 0 && p->msg.arg1 == 0) {
- // TODO: Switch to string_view.
- std::string address(p->payload.begin(), p->payload.end());
- asocket* s = create_local_service_socket(address.c_str(), t);
+ std::string_view address(p->payload.begin(), p->payload.size());
+
+ asocket* s = create_local_service_socket(address, t);
if (s == nullptr) {
send_close(0, p->msg.arg0, t);
} else {