androiddump: Add Bluetooth support for Android M
authorMichal Labedzki <michal.labedzki@tieto.com>
Mon, 19 Oct 2015 12:03:43 +0000 (14:03 +0200)
committerMichal Labedzki <michal.labedzki@tieto.com>
Fri, 20 Nov 2015 12:14:33 +0000 (12:14 +0000)
In real it is a fix, because the only change is new name of
process of the same application on Android.

Change-Id: I69d1362e9f11967ec1127ff89c7b45299d291fe8
Reviewed-on: https://code.wireshark.org/review/11984
Petri-Dish: Michal Labedzki <michal.labedzki@tieto.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michal Labedzki <michal.labedzki@tieto.com>
extcap/androiddump.c

index 0aa8df65a41078f674e5d46da70c297ee1df379a..6c1359b691796efb34225ffef62190eb39d05e0e 100644 (file)
@@ -566,6 +566,7 @@ static int add_android_interfaces(struct interface_t **interface_list,
     const char            *adb_api_level          = "0022""shell:getprop ro.build.version.sdk";
     const char            *adb_hcidump_version    = "0017""shell:hcidump --version";
     const char            *adb_ps_droid_bluetooth = "0018""shell:ps droid.bluetooth";
+    const char            *adb_ps_bluetooth_app   = "001E""shell:ps com.android.bluetooth";
     const char            *adb_tcpdump_help       = "0010""shell:tcpdump -h";
     char                   serial_number[512];
     int                    result;
@@ -833,7 +834,6 @@ static int add_android_interfaces(struct interface_t **interface_list,
                 return 1;
             }
 
-
             response = adb_send_and_read(sock, adb_ps_droid_bluetooth, helpful_packet, sizeof(helpful_packet), &data_length);
             closesocket(sock);
             if (!response || data_length < 1) {
@@ -913,8 +913,10 @@ static int add_android_interfaces(struct interface_t **interface_list,
                 return 1;
             }
 
-
-            response = adb_send_and_read(sock, adb_ps_droid_bluetooth, helpful_packet, sizeof(helpful_packet), &data_length);
+            if (api_level >= 23) {
+                response = adb_send_and_read(sock, adb_ps_bluetooth_app, helpful_packet, sizeof(helpful_packet), &data_length);
+            }  else
+                response = adb_send_and_read(sock, adb_ps_droid_bluetooth, helpful_packet, sizeof(helpful_packet), &data_length);
             closesocket(sock);
             if (!response || data_length < 1) {
                 if (verbose) {