aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHuizi Yang <yanghuiz@google.com>2021-10-14 12:11:46 -0700
committerAleksandr Nogikh <wp32pw@gmail.com>2021-10-14 23:14:47 +0200
commitaab7690b6ed50129a4236a2b1d346b9944a478d1 (patch)
tree6f6cc13fa362a390af0427f6a8d2ff42981b854c
parent7aa5fe41bbf8f92f7e9d64244d90ea5d7db11912 (diff)
vm/adb: add localhost to ip regex of device
remote_device_proxy uses localhost for Android WFH connection.
-rw-r--r--vm/adb/adb.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/vm/adb/adb.go b/vm/adb/adb.go
index 624fd7efc..f3efb7beb 100644
--- a/vm/adb/adb.go
+++ b/vm/adb/adb.go
@@ -69,7 +69,7 @@ type instance struct {
var (
androidSerial = "^[0-9A-Z]+$"
- cuttlefishID = `^(?:[0-9]{1,3}\.){3}[0-9]{1,3}\:(?:[0-9]{1,5})$` // IP:port
+ ipAddress = `^(?:localhost|(?:[0-9]{1,3}\.){3}[0-9]{1,3})\:(?:[0-9]{1,5})$` // cuttlefish or remote_device_proxy
)
func loadDevice(data []byte) (*Device, error) {
@@ -102,7 +102,7 @@ func ctor(env *vmimpl.Env) (vmimpl.Pool, error) {
return nil, fmt.Errorf("no adb devices specified")
}
// Device should be either regular serial number, or a valid Cuttlefish ID.
- devRe := regexp.MustCompile(fmt.Sprintf("%s|%s", androidSerial, cuttlefishID))
+ devRe := regexp.MustCompile(fmt.Sprintf("%s|%s", androidSerial, ipAddress))
for _, dev := range cfg.Devices {
device, err := loadDevice(dev)
if err != nil {