mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-10-03 17:14:33 -04:00
feat(connections): handle hardware without Bluetooth for Android XR (#7318)
This commit is contained in:
1 parent
8038a19e95
commit
f62885df2b
27 files changed
+183
-43
No files matched your search
@@ -35,6 +35,9 @@ fun Context.hasGps(): Boolean {
|
||||
return lm?.allProviders?.contains(LocationManager.GPS_PROVIDER) == true
|
||||
}
|
||||
|
||||
/** Checks if the device has Bluetooth LE hardware at all, as distinct from Bluetooth being switched off. */
|
||||
fun Context.hasBluetoothLe(): Boolean = packageManager.hasSystemFeature(PackageManager.FEATURE_BLUETOOTH_LE)
|
||||
|
||||
/** Checks if the device has a GPS receiver and it is currently disabled. */
|
||||
fun Context.gpsDisabled(): Boolean {
|
||||
val lm = getSystemService(Context.LOCATION_SERVICE) as? LocationManager ?: return false
|
||||
|
||||
Reference in new issue
Block a user