Skip to content

Commit

Permalink
publish but fails
Browse files Browse the repository at this point in the history
  • Loading branch information
regulad committed Oct 14, 2024
1 parent 72b7e9e commit 526f79b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
6 changes: 6 additions & 0 deletions .idea/deploymentTargetSelector.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import static android.bluetooth.BluetoothDevice.TRANSPORT_LE;

// shamelessly lifted from https://github.com/dariuszseweryn/RxAndroidBle/blob/7663a1ab96605dc26eba378a9e51747ad254b229/rxandroidble/src/main/java/com/polidea/rxandroidble2/internal/util/BleConnectionCompat.java
@SuppressLint({"PrivateApi", "DiscouragedPrivateApi", "MissingPermission", "Deprecated"})
@SuppressLint({"PrivateApi", "DiscouragedPrivateApi", "MissingPermission"})
public class BleConnectionCompat {
private static final String TAG = "BleConnectionCompat";

Expand All @@ -34,7 +34,7 @@ public BluetoothGatt connectGatt(BluetoothDevice remoteDevice, boolean autoConne
return null;
}

/**
/*
* Issue that caused a race condition mentioned below was fixed in 7.0.0_r1
* https://android.googlesource.com/platform/frameworks/base/+/android-7.0.0_r1/core/java/android/bluetooth/BluetoothGatt.java#649
* compared to
Expand All @@ -45,7 +45,7 @@ public BluetoothGatt connectGatt(BluetoothDevice remoteDevice, boolean autoConne
return connectGattCompat(bluetoothGattCallback, remoteDevice, autoConnect);
}

/**
/*
* Some implementations of Bluetooth Stack have a race condition where autoConnect flag
* is not properly set before calling connectGatt. That's the reason for using reflection
* to set the flag manually.
Expand Down Expand Up @@ -130,6 +130,7 @@ private Object getIBluetoothGatt(Object iBluetoothManager)
return getBluetoothGattMethod.invoke(iBluetoothManager);
}

@SuppressWarnings("deprecation")
private Object getIBluetoothManager() throws NoSuchMethodException, InvocationTargetException, IllegalAccessException {

BluetoothAdapter bluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
Expand Down

0 comments on commit 526f79b

Please sign in to comment.