aboutsummaryrefslogtreecommitdiffstats
path: root/android/avd
diff options
context:
space:
mode:
Diffstat (limited to 'android/avd')
-rw-r--r--android/avd/info.c5
-rw-r--r--android/avd/info.h9
-rw-r--r--android/avd/util.c21
-rw-r--r--android/avd/util.h9
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 */