mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
#14: WIP we now show the new GUI properly
This commit is contained in:
parent
840dbd491e
commit
b4bf682df0
6 changed files with 177 additions and 19 deletions
|
|
@ -6,6 +6,8 @@ import android.bluetooth.BluetoothGattCharacteristic
|
|||
import android.bluetooth.BluetoothManager
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.content.pm.PackageManager
|
||||
import android.os.Build
|
||||
import android.os.IBinder
|
||||
import android.os.RemoteException
|
||||
import androidx.core.content.edit
|
||||
|
|
@ -197,6 +199,18 @@ class RadioInterfaceService : Service(), Logging {
|
|||
MeshService.startService(context)
|
||||
}
|
||||
}
|
||||
|
||||
/// Can we use the modern BLE scan API?
|
||||
fun hasCompanionDeviceApi(context: Context): Boolean =
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
val res =
|
||||
context.packageManager.hasSystemFeature(PackageManager.FEATURE_COMPANION_DEVICE_SETUP)
|
||||
debug("CompanionDevice API available=$res")
|
||||
res
|
||||
} else {
|
||||
warn("CompanionDevice API not available, falling back to classic scan")
|
||||
false
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue