Skip to content

Commit 79d0501

Browse files
Merge branch 'rc/4.4'
2 parents 0ef56f2 + ddde456 commit 79d0501

4 files changed

Lines changed: 22 additions & 9 deletions

File tree

ActiveLookSDK/src/main/java/com/activelook/activelooksdk/core/ble/GlassesGattCallbackImpl.java

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -88,13 +88,21 @@ void reconnect(final BluetoothDevice device) {
8888
this.gatt = this.gattDelegate;
8989
}
9090

91-
private void optimizeMtu(final int optimalMtu) {
92-
if (optimalMtu > this.mtu) {
93-
if (!this.gatt.requestMtu(optimalMtu)) {
94-
this.optimizeMtu(optimalMtu - 1);
91+
private void optimizeMtu(int optimalMtu) {
92+
while (optimalMtu > this.mtu) {
93+
if (this.gatt.requestMtu(optimalMtu)) {
94+
return;
95+
}
96+
optimalMtu = optimalMtu - 1;
97+
}
98+
int errorCount = 0;
99+
while (!this.gatt.discoverServices()) {
100+
errorCount = errorCount + 1;
101+
if (errorCount > 10) {
102+
this.unlockConnection();
103+
this.disconnect();
104+
return;
95105
}
96-
} else if (!this.gatt.discoverServices()) {
97-
this.optimizeMtu(optimalMtu);
98106
}
99107
}
100108

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# CHANGELOG
22

3+
## Version 4.4.1
4+
5+
### Fixes
6+
- Remove recursive call to avoid stackoverflow
7+
38
## Version 4.4.0
49

510
### Breaking changes

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ You can add the dependency in your application by modifying the application `bui
6565
and add:
6666
```
6767
dependencies {
68-
implementation 'com.github.activelook:android-sdk:v4.4.0'
68+
implementation 'com.github.activelook:android-sdk:v4.4.1'
6969
}
7070
```
7171

build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// Top-level build file where you can add configuration options common to all sub-projects/modules.
22
buildscript {
33
ext.sdkGroupId = "com.activelook"
4-
ext.sdkVersionCode = 440
5-
ext.sdkVersionName = '4.4.0'
4+
ext.sdkVersionCode = 441
5+
ext.sdkVersionName = '4.4.1'
66
ext.kotlin_version = '1.6.21'
77
repositories {
88
google()

0 commit comments

Comments
 (0)