rollback compileSdkVersion
This commit is contained in:
parent
031e1c3650
commit
be07867502
8 changed files with 27 additions and 20 deletions
|
@ -4,6 +4,8 @@
|
|||
|
||||
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
|
||||
<uses-permission android:name="android.permission.BLUETOOTH" />
|
||||
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />
|
||||
|
||||
<application>
|
||||
<service
|
||||
android:name="info.nightscout.androidaps.services.LocationService"
|
||||
|
|
|
@ -1,24 +1,25 @@
|
|||
package info.nightscout.androidaps.plugins.general.automation.triggers
|
||||
|
||||
import android.bluetooth.BluetoothAdapter
|
||||
import android.bluetooth.BluetoothManager
|
||||
import android.content.Context
|
||||
import android.widget.LinearLayout
|
||||
import com.google.common.base.Optional
|
||||
import dagger.android.HasAndroidInjector
|
||||
import info.nightscout.androidaps.automation.R
|
||||
import info.nightscout.androidaps.events.EventBTChange
|
||||
import info.nightscout.shared.logging.LTag
|
||||
import info.nightscout.androidaps.plugins.general.automation.AutomationPlugin
|
||||
import info.nightscout.androidaps.plugins.general.automation.elements.ComparatorConnect
|
||||
import info.nightscout.androidaps.plugins.general.automation.elements.InputDropdownMenu
|
||||
import info.nightscout.androidaps.plugins.general.automation.elements.LayoutBuilder
|
||||
import info.nightscout.androidaps.plugins.general.automation.elements.StaticLabel
|
||||
import info.nightscout.androidaps.utils.JsonHelper
|
||||
import info.nightscout.shared.logging.LTag
|
||||
import org.json.JSONObject
|
||||
import java.util.*
|
||||
import javax.inject.Inject
|
||||
|
||||
class TriggerBTDevice(injector: HasAndroidInjector) : Trigger(injector) {
|
||||
|
||||
@Inject lateinit var context: Context
|
||||
@Inject lateinit var automationPlugin: AutomationPlugin
|
||||
|
||||
|
@ -73,7 +74,7 @@ class TriggerBTDevice(injector: HasAndroidInjector) : Trigger(injector) {
|
|||
// Get the list of paired BT devices to use in dropdown menu
|
||||
private fun devicesPaired(): ArrayList<CharSequence> {
|
||||
val s = ArrayList<CharSequence>()
|
||||
BluetoothAdapter.getDefaultAdapter()?.bondedDevices?.forEach { s.add(it.name) }
|
||||
(context.getSystemService(Context.BLUETOOTH_SERVICE) as BluetoothManager).adapter?.bondedDevices?.forEach { s.add(it.name) }
|
||||
return s
|
||||
}
|
||||
|
||||
|
|
|
@ -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'
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -7,4 +7,5 @@ import android.util.Patterns
|
|||
*
|
||||
* @author Andrea Baccega <me></me>@andreabaccega.com>
|
||||
*/
|
||||
@Suppress("deprecation")
|
||||
class IpAddressValidator(_customErrorMessage: String?) : PatternValidator(_customErrorMessage, Patterns.IP_ADDRESS)
|
|
@ -4,6 +4,8 @@
|
|||
<uses-permission android:name="android.permission.BLUETOOTH" />
|
||||
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
|
||||
|
||||
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />
|
||||
|
||||
<application>
|
||||
<activity android:name="info.nightscout.androidaps.danars.activities.BLEScanActivity">
|
||||
<intent-filter>
|
||||
|
|
|
@ -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"
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
android {
|
||||
compileSdkVersion 31
|
||||
compileSdkVersion 30
|
||||
defaultConfig {
|
||||
minSdkVersion 28
|
||||
targetSdkVersion 28
|
||||
|
|
Loading…
Reference in a new issue