diff --git a/app/build.gradle b/app/build.gradle index 9b7642e..843eef0 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -2,11 +2,11 @@ apply plugin: 'com.android.application' apply plugin: 'kotlin-android' android { - compileSdkVersion 29 + compileSdkVersion 30 defaultConfig { applicationId "com.welie.blessedexample" minSdkVersion 26 - targetSdkVersion 29 + targetSdkVersion 30 versionCode 1 versionName "1.0" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" @@ -30,12 +30,12 @@ android { dependencies { implementation fileTree(include: ['*.jar'], dir: 'libs') - implementation 'androidx.appcompat:appcompat:1.2.0' - implementation 'androidx.constraintlayout:constraintlayout:1.1.3' + implementation 'androidx.appcompat:appcompat:1.3.0' + implementation 'androidx.constraintlayout:constraintlayout:2.0.4' implementation 'com.jakewharton.timber:timber:4.7.1' implementation project(':blessed') testImplementation 'junit:junit:4.13.2' - implementation "androidx.core:core-ktx:+" + implementation "androidx.core:core-ktx:1.5.0" implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.4.3-native-mt" implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.4.3-native-mt" diff --git a/blessed/build.gradle b/blessed/build.gradle index 0282701..0055730 100644 --- a/blessed/build.gradle +++ b/blessed/build.gradle @@ -2,11 +2,11 @@ apply plugin: 'com.android.library' apply plugin: 'kotlin-android' android { - compileSdkVersion 29 + compileSdkVersion 30 defaultConfig { minSdkVersion 26 - targetSdkVersion 29 + targetSdkVersion 30 versionCode 1 versionName "1.0" @@ -37,7 +37,7 @@ dependencies { testImplementation "org.robolectric:robolectric:4.5.1" testImplementation "org.mockito:mockito-core:3.8.0" testImplementation 'androidx.test:core:1.3.0' - implementation "androidx.core:core-ktx:+" + implementation "androidx.core:core-ktx:1.5.0" implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.4.3-native-mt" implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.4.3-native-mt" diff --git a/blessed/src/main/java/com/welie/blessed/BluetoothCentralManager.kt b/blessed/src/main/java/com/welie/blessed/BluetoothCentralManager.kt index 15d62e2..c00db52 100644 --- a/blessed/src/main/java/com/welie/blessed/BluetoothCentralManager.kt +++ b/blessed/src/main/java/com/welie/blessed/BluetoothCentralManager.kt @@ -80,7 +80,7 @@ class BluetoothCentralManager(private val context: Context) { synchronized(this) { val deviceName = result.device.name ?: return for (name in scanPeripheralNames) { - if (deviceName.contains(name!!)) { + if (deviceName.contains(name)) { sendScanResult(result) return } @@ -534,7 +534,6 @@ class BluetoothCentralManager(private val context: Context) { stopAutoconnectScan() Timber.d("cancelling autoconnect for %s", peripheralAddress) scope.launch { resultCentralManagerCallback.onDisconnectedPeripheral(peripheral, HciStatus.SUCCESS) } - // scope.launch { connectionStateCallback.invoke(peripheral, ConnectionState.DISCONNECTED) } // If there are any devices left, restart the reconnection scan if (reconnectPeripheralAddresses.size > 0) { @@ -916,7 +915,7 @@ class BluetoothCentralManager(private val context: Context) { private const val NO_VALID_PERIPHERAL_PROVIDED = "no valid peripheral provided" private const val NO_VALID_PERIPHERAL_CALLBACK_SPECIFIED = "no valid peripheral callback specified" } - //endregion + /** * Construct a new BluetoothCentralManager object * diff --git a/build.gradle b/build.gradle index e690aa6..4e4e168 100644 --- a/build.gradle +++ b/build.gradle @@ -8,7 +8,7 @@ buildscript { } dependencies { - classpath 'com.android.tools.build:gradle:4.1.2' + classpath 'com.android.tools.build:gradle:4.2.1' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" // NOTE: Do not place your application dependencies here; they belong diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 0a328bf..0c0499c 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-bin.zip