feat(connections): handle hardware without Bluetooth for Android XR (#7318)

This commit is contained in:
James Rich authored and GitHub committed 2026-09-23 18:10:05 +00:00
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