Skip to content

Commit e363b9a

Browse files
authored
Update compileSdk and targetSdk to 37 to support Android Studio Quail and the upcoming Compose release (#891)
* Update compileSdk and targetSdk to 37 to support Android Studio Quail and the upcoming Compose release * Fix ble snippets after migration to sdk 37
1 parent 308c211 commit e363b9a

3 files changed

Lines changed: 8 additions & 9 deletions

File tree

bluetoothle/src/main/java/com/sample/android/bluetoothle/kotlin/DeviceScanActivity.kt

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ package com.sample.android.bluetoothle.kotlin
1919
import android.Manifest
2020
import android.app.ListActivity
2121
import android.bluetooth.BluetoothAdapter
22+
import android.bluetooth.le.BluetoothLeScanner
2223
import android.bluetooth.le.ScanCallback
2324
import android.bluetooth.le.ScanResult
2425
import android.os.Handler
@@ -42,7 +43,7 @@ class DeviceScanActivity : ListActivity() {
4243
// [END process_scan_result]
4344

4445
// [START start_and_stop_scan]
45-
private val bluetoothLeScanner = BluetoothAdapter.getDefaultAdapter().bluetoothLeScanner
46+
private val bluetoothLeScanner: BluetoothLeScanner? = BluetoothAdapter.getDefaultAdapter().bluetoothLeScanner
4647
private var mScanning = false
4748
private val handler = Handler()
4849

@@ -54,13 +55,13 @@ class DeviceScanActivity : ListActivity() {
5455
if (!mScanning) { // Stops scanning after a pre-defined scan period.
5556
handler.postDelayed({
5657
mScanning = false
57-
bluetoothLeScanner.stopScan(leScanCallback)
58+
bluetoothLeScanner?.stopScan(leScanCallback)
5859
}, SCAN_PERIOD)
5960
mScanning = true
60-
bluetoothLeScanner.startScan(leScanCallback)
61+
bluetoothLeScanner?.startScan(leScanCallback)
6162
} else {
6263
mScanning = false
63-
bluetoothLeScanner.stopScan(leScanCallback)
64+
bluetoothLeScanner?.stopScan(leScanCallback)
6465
}
6566
}
6667
// [END start_and_stop_scan]

compose/snippets/build.gradle.kts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,7 @@ plugins {
2424
}
2525

2626
android {
27-
compileSdk {
28-
version = release(libs.versions.compileSdk.get().toInt())
29-
{minorApiLevel = 1}} // Android 16 QPR 2
27+
compileSdk = libs.versions.compileSdk.get().toInt()
3028
namespace = "com.example.compose.snippets"
3129

3230
defaultConfig {

gradle/libs.versions.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ androidxHiltNavigationCompose = "1.3.0"
4545
appcompat = "1.7.1"
4646
coil = "2.7.0"
4747
# @keep
48-
compileSdk = "36"
48+
compileSdk = "37"
4949
compose-latest = "1.10.5"
5050
composeUiTooling = "1.5.6"
5151
coreSplashscreen = "1.2.0"
@@ -95,7 +95,7 @@ registryDigitalCredentials = "1.0.0-alpha04"
9595
robolectric = "4.16.1"
9696
roborazzi = "1.59.0"
9797
spotless = "8.3.0"
98-
targetSdk = "36"
98+
targetSdk = "37"
9999
tiles = "1.5.0"
100100
tracing = "1.3.0"
101101
truth = "1.4.4"

0 commit comments

Comments
 (0)