diff options
author | Vladimir Chtchetkine <vchtchetkine@google.com> | 2011-12-09 15:45:46 -0800 |
---|---|---|
committer | Vladimir Chtchetkine <vchtchetkine@google.com> | 2011-12-13 11:37:19 -0800 |
commit | d86c724b74e6c04a89219d87559d0b580e100445 (patch) | |
tree | 8a12ffaa8445fd55f9683321b623c2ab085096dd /android/avd | |
parent | a743be75c49f94811e6c8960ee0d6a2d0a65c700 (diff) | |
download | external_qemu-d86c724b74e6c04a89219d87559d0b580e100445.zip external_qemu-d86c724b74e6c04a89219d87559d0b580e100445.tar.gz external_qemu-d86c724b74e6c04a89219d87559d0b580e100445.tar.bz2 |
Implement ADB communication over QEMU pipe
Change-Id: I62ff5898c7a955aaaa8af8f7ee7ed018af860f80
Diffstat (limited to 'android/avd')
-rw-r--r-- | android/avd/info.c | 5 | ||||
-rw-r--r-- | android/avd/info.h | 9 | ||||
-rw-r--r-- | android/avd/util.c | 21 | ||||
-rw-r--r-- | android/avd/util.h | 9 |
4 files changed, 44 insertions, 0 deletions
diff --git a/android/avd/info.c b/android/avd/info.c index 7e4f93e..815b0b4 100644 --- a/android/avd/info.c +++ b/android/avd/info.c @@ -1202,3 +1202,8 @@ avdInfo_getCharmapFile( AvdInfo* i, const char* charmapName ) return _avdInfo_getContentOrSdkFilePath(i, fileName); } + +int avdInfo_getAdbdCommunicationMode( AvdInfo* i ) +{ + return path_getAdbdCommunicationMode(i->androidOut); +} diff --git a/android/avd/info.h b/android/avd/info.h index 34997b4..74a9b01 100644 --- a/android/avd/info.h +++ b/android/avd/info.h @@ -243,6 +243,15 @@ char* avdInfo_getTracePath( AvdInfo* i, const char* traceName ); */ const char* avdInfo_getCoreHwIniPath( AvdInfo* i ); +/* Returns mode in which ADB daemon running in the guest communicates with the + * emulator + * Return: + * 0 - ADBD communicates with the emulator via forwarded TCP port 5555 (a + * "legacy" mode). + * 1 - ADBD communicates with the emulator via 'adb' QEMUD service. + */ +int avdInfo_getAdbdCommunicationMode( AvdInfo* i ); + /* */ #endif /* ANDROID_AVD_INFO_H */ diff --git a/android/avd/util.c b/android/avd/util.c index 304b98f..82145b5 100644 --- a/android/avd/util.c +++ b/android/avd/util.c @@ -313,3 +313,24 @@ path_getBuildTargetApiLevel( const char* androidOut ) return level; } +int +path_getAdbdCommunicationMode( const char* androidOut ) +{ + char* prop = _getBuildProperty(androidOut, "ro.adb.qemud"); + if (prop != NULL) { + long val = 0; + char* end; + val = strtol(prop, &end, 10); + if (end == NULL || *end != '\0' || val != (int)val) { + D("Invalid ro.adb.qemud build property: '%s'", prop); + val = 0; + } else { + D("Found ro.adb.qemud build property: %d", val); + } + AFREE(prop); + return (int)val; + } else { + /* Missing ro.adb.qemud means "legacy" ADBD. */ + return 0; + } +} diff --git a/android/avd/util.h b/android/avd/util.h index 877d5aa..edef6a0 100644 --- a/android/avd/util.h +++ b/android/avd/util.h @@ -64,4 +64,13 @@ char* path_getBuildTargetAbi( const char* androidOut ); */ int path_getBuildTargetApiLevel( const char* androidOut ); +/* Returns mode in which ADB daemon running in the guest communicates with the + * emulator + * Return: + * 0 - ADBD communicates with the emulator via forwarded TCP port 5555 (a + * "legacy" mode). + * 1 - ADBD communicates with the emulator via 'adb' QEMUD service. + */ +int path_getAdbdCommunicationMode( const char* androidOut ); + #endif /* _ANDROID_AVD_UTIL_H */ |