diff --git a/automation/src/main/AndroidManifest.xml b/automation/src/main/AndroidManifest.xml index c7b7ca4618..3396187ca4 100644 --- a/automation/src/main/AndroidManifest.xml +++ b/automation/src/main/AndroidManifest.xml @@ -4,6 +4,8 @@ + + { val s = ArrayList() - BluetoothAdapter.getDefaultAdapter()?.bondedDevices?.forEach { s.add(it.name) } + (context.getSystemService(Context.BLUETOOTH_SERVICE) as BluetoothManager).adapter?.bondedDevices?.forEach { s.add(it.name) } return s } diff --git a/build.gradle b/build.gradle index 232a54e522..5869d5181c 100644 --- a/build.gradle +++ b/build.gradle @@ -3,19 +3,19 @@ buildscript { ext { kotlin_version = '1.6.0' - coreVersion = '1.7.0' + coreVersion = '1.6.0' rxjava_version = '2.2.21' rxandroid_version = '2.1.1' rxkotlin_version = '2.4.0' room_version = '2.3.0' - lifecycle_version = '2.4.0' + lifecycle_version = '2.3.1' dagger_version = '2.40.5' coroutinesVersion = '1.4.1' activityVersion = '1.3.1' fragmentktx_version = '1.3.6' ormLiteVersion = '4.46' nav_version = '2.3.5' - appcompat_version = '1.4.0' + appcompat_version = '1.3.1' material_version = '1.4.0' constraintlayout_version = '2.1.0' preferencektx_version = '1.1.1' diff --git a/core/src/main/java/info/nightscout/androidaps/plugins/pump/common/ble/BlePreCheck.kt b/core/src/main/java/info/nightscout/androidaps/plugins/pump/common/ble/BlePreCheck.kt index 02bcec2e0b..aba42ce32f 100644 --- a/core/src/main/java/info/nightscout/androidaps/plugins/pump/common/ble/BlePreCheck.kt +++ b/core/src/main/java/info/nightscout/androidaps/plugins/pump/common/ble/BlePreCheck.kt @@ -1,7 +1,7 @@ package info.nightscout.androidaps.plugins.pump.common.ble import android.Manifest -import android.bluetooth.BluetoothAdapter +import android.bluetooth.BluetoothManager import android.content.Context import android.content.Intent import android.content.pm.PackageManager @@ -18,6 +18,7 @@ import javax.inject.Singleton @Singleton class BlePreCheck @Inject constructor( + val context: Context, val rh: ResourceHelper ) { @@ -37,7 +38,7 @@ class BlePreCheck @Inject constructor( ActivityCompat.requestPermissions(activity, arrayOf(Manifest.permission.ACCESS_COARSE_LOCATION), PERMISSION_REQUEST_COARSE_LOCATION) } - val bluetoothAdapter = BluetoothAdapter.getDefaultAdapter() + val bluetoothAdapter = (context.getSystemService(Context.BLUETOOTH_SERVICE) as BluetoothManager).adapter // Ensures Bluetooth is available on the device and it is enabled. If not, // displays a dialog requesting user permission to enable Bluetooth. if (bluetoothAdapter == null || !bluetoothAdapter.isEnabled) { diff --git a/core/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/IpAddressValidator.kt b/core/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/IpAddressValidator.kt index 9fea08e453..e026c7a59f 100644 --- a/core/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/IpAddressValidator.kt +++ b/core/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/IpAddressValidator.kt @@ -7,4 +7,5 @@ import android.util.Patterns * * @author Andrea Baccega @andreabaccega.com> */ +@Suppress("deprecation") class IpAddressValidator(_customErrorMessage: String?) : PatternValidator(_customErrorMessage, Patterns.IP_ADDRESS) \ No newline at end of file diff --git a/danars/src/main/AndroidManifest.xml b/danars/src/main/AndroidManifest.xml index b560f7f9bd..9588230a7d 100644 --- a/danars/src/main/AndroidManifest.xml +++ b/danars/src/main/AndroidManifest.xml @@ -4,6 +4,8 @@ + + diff --git a/database/build.gradle b/database/build.gradle index 6f6eddd1b2..95571ee4ae 100644 --- a/database/build.gradle +++ b/database/build.gradle @@ -18,26 +18,26 @@ android { } dependencies { - implementation "androidx.core:core-ktx:$coreVersion" - implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" + api "androidx.core:core-ktx:$coreVersion" + api "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" - implementation "io.reactivex.rxjava2:rxjava:$rxjava_version" - implementation "io.reactivex.rxjava2:rxandroid:$rxandroid_version" - implementation("io.reactivex.rxjava2:rxkotlin:$rxkotlin_version") + api "io.reactivex.rxjava2:rxjava:$rxjava_version" + api "io.reactivex.rxjava2:rxandroid:$rxandroid_version" + api("io.reactivex.rxjava2:rxkotlin:$rxkotlin_version") - implementation "com.google.code.gson:gson:2.8.9" + api "com.google.code.gson:gson:2.8.9" api "androidx.room:room-runtime:$room_version" kapt "androidx.room:room-compiler:$room_version" /* Database schema export */ kapt "androidx.room:room-compiler:$room_version" - implementation "androidx.room:room-ktx:$room_version" - implementation "androidx.room:room-rxjava2:$room_version" + api "androidx.room:room-ktx:$room_version" + api "androidx.room:room-rxjava2:$room_version" - implementation "androidx.lifecycle:lifecycle-livedata-ktx:$lifecycle_version" + api "androidx.lifecycle:lifecycle-livedata-ktx:$lifecycle_version" - implementation "com.google.dagger:dagger-android:$dagger_version" - implementation "com.google.dagger:dagger-android-support:$dagger_version" + api "com.google.dagger:dagger-android:$dagger_version" + api "com.google.dagger:dagger-android-support:$dagger_version" api "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version" } diff --git a/gradle/android_dependencies.gradle b/gradle/android_dependencies.gradle index 7e07211845..eb031288c2 100644 --- a/gradle/android_dependencies.gradle +++ b/gradle/android_dependencies.gradle @@ -1,5 +1,5 @@ android { - compileSdkVersion 31 + compileSdkVersion 30 defaultConfig { minSdkVersion 28 targetSdkVersion 28