client (Android): for os_version, append Android version to Linux version

If the GUI reports the Android version, append it to the Linux version as
2.6.5 (Android 3.1.0)
This commit is contained in:
David Anderson 2014-11-22 15:08:47 -08:00
parent 373d345e0f
commit f37336a956
1 changed files with 13 additions and 2 deletions

View File

@ -374,7 +374,7 @@ static void handle_set_gpu_mode(GUI_RPC_CONN& grc) {
grc.mfout.printf("<success/>\n");
}
// used on Android - get product name, os name, os version, and MAC addr from GUI,
// On Android, get product name, OS name, OS version, and MAC addr from GUI,
//
static void handle_set_host_info(GUI_RPC_CONN& grc) {
while (!grc.xp.get_tag()) {
@ -388,11 +388,22 @@ static void handle_set_host_info(GUI_RPC_CONN& grc) {
if (strlen(hi.product_name)) {
safe_strcpy(gstate.host_info.product_name, hi.product_name);
}
// this will always be "Android"
//
if (strlen(hi.os_name)) {
safe_strcpy(gstate.host_info.os_name, hi.os_name);
}
// We already have the Linux kernel version;
// append the Android version.
//
if (strlen(hi.os_version)) {
safe_strcpy(gstate.host_info.os_version, hi.os_version);
if (!strstr(gstate.host_info.os_version, "Android")) {
safe_strcat(gstate.host_info.os_version, " (Android ");
safe_strcat(gstate.host_info.os_version, hi.os_version);
safe_strcat(gstate.host_info.os_version, ")");
}
}
grc.mfout.printf("<success/>\n");
gstate.set_client_state_dirty("set_host_info RPC");