discovery: android ble driver

  * Prefer BR/EDR for Gatt connection for classic device

Change-Id: I4f96739971dc4542af4c11e9ff4cd170a9b9ebd5
diff --git a/android-lib/src/main/java/io/v/android/impl/google/discovery/plugins/ble/GattReader.java b/android-lib/src/main/java/io/v/android/impl/google/discovery/plugins/ble/GattReader.java
index 886f705..2f2ac35 100644
--- a/android-lib/src/main/java/io/v/android/impl/google/discovery/plugins/ble/GattReader.java
+++ b/android-lib/src/main/java/io/v/android/impl/google/discovery/plugins/ble/GattReader.java
@@ -116,7 +116,15 @@
             return;
         }
 
-        mCurrentGatt = mCurrentDevice.connectGatt(mContext, false, this);
+        if ((mCurrentDevice.getType() == BluetoothDevice.DEVICE_TYPE_CLASSIC
+                        || mCurrentDevice.getType() == BluetoothDevice.DEVICE_TYPE_DUAL)
+                && Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
+            mCurrentGatt =
+                    mCurrentDevice.connectGatt(
+                            mContext, false, this, BluetoothDevice.TRANSPORT_BREDR);
+        } else {
+            mCurrentGatt = mCurrentDevice.connectGatt(mContext, false, this);
+        }
         mCurrentGattConnectionTimeout =
                 mExecutor.schedule(
                         new Runnable() {