refactor: implement CompatExtensions (#641)

updates deprecated methods, classes, and flags introduced in Android SDK 33, while ensuring compatibility with previous Android versions
This commit is contained in:
Andre K 2023-05-30 18:30:46 -03:00 committed by GitHub
parent f7a895e62e
commit 271124dc9c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 100 additions and 45 deletions

View file

@ -320,7 +320,12 @@ class BTScanModel @Inject constructor(
associationRequest(),
@SuppressLint("NewApi")
object : CompanionDeviceManager.Callback() {
override fun onDeviceFound(chooserLauncher: IntentSender) {
@Deprecated("Deprecated in Java", ReplaceWith("onAssociationPending(intentSender)"))
override fun onDeviceFound(intentSender: IntentSender) {
onAssociationPending(intentSender)
}
override fun onAssociationPending(chooserLauncher: IntentSender) {
debug("CompanionDeviceManager - device found")
_spinner.value = false
chooserLauncher.let {