mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-03-17 05:17:04 -04:00
0.7.2 hotfixes for autobugs
This commit is contained in:
@@ -17,8 +17,8 @@ android {
|
||||
applicationId "com.geeksville.mesh"
|
||||
minSdkVersion 22 // The oldest emulator image I have tried is 22 (though 21 probably works)
|
||||
targetSdkVersion 29
|
||||
versionCode 171
|
||||
versionName "0.7.1"
|
||||
versionCode 172
|
||||
versionName "0.7.2"
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
buildTypes {
|
||||
|
||||
@@ -443,9 +443,11 @@ class MeshService : Service(), Logging {
|
||||
val wantForeground = RadioInterfaceService.getBondedDeviceAddress(this) != null
|
||||
|
||||
info("Requesting foreground service=$wantForeground")
|
||||
if (wantForeground)
|
||||
startForeground(notifyId, createNotification())
|
||||
else
|
||||
|
||||
// We always start foreground because that's how our service is always started (if we didn't then android would kill us)
|
||||
// but if we don't really need forground we immediately stop it.
|
||||
startForeground(notifyId, createNotification())
|
||||
if (!wantForeground)
|
||||
stopForeground(true)
|
||||
}
|
||||
|
||||
|
||||
@@ -100,11 +100,18 @@ class BTScanModel(app: Application) : AndroidViewModel(app), Logging {
|
||||
}
|
||||
|
||||
data class DeviceListEntry(val name: String, val address: String, val bonded: Boolean) {
|
||||
// val isSelected get() = macAddress == selectedMacAddr
|
||||
val bluetoothAddress
|
||||
get() =
|
||||
if (address[0] == 'x')
|
||||
address.substring(1)
|
||||
else
|
||||
null
|
||||
|
||||
|
||||
override fun toString(): String {
|
||||
return "DeviceListEntry(name=${name.anonymize}, addr=${address.anonymize})"
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
override fun onCleared() {
|
||||
@@ -281,7 +288,7 @@ class BTScanModel(app: Application) : AndroidViewModel(app), Logging {
|
||||
} else {
|
||||
// We ignore missing BT adapters, because it lets us run on the emulator
|
||||
bluetoothAdapter
|
||||
?.getRemoteDevice(it.address)?.let { device ->
|
||||
?.getRemoteDevice(it.bluetoothAddress)?.let { device ->
|
||||
requestBonding(activity, device) { state ->
|
||||
if (state == BOND_BONDED) {
|
||||
errorText.value = activity.getString(R.string.pairing_completed)
|
||||
|
||||
Reference in New Issue
Block a user