This commit is contained in:
Kevin Hester
2021-03-07 09:57:14 +08:00
parent 8ace22d686
commit e82153c999
4 changed files with 8 additions and 3 deletions

View File

@@ -1660,6 +1660,9 @@ class MeshService : Service(), Logging {
info("sendData dest=${p.to}, id=${p.id} <- ${p.bytes!!.size} bytes (connectionState=$connectionState)")
if(p.dataType == 0)
throw Exception("Port numbers must be non-zero!") // we are now more strict
// Keep a record of datapackets, so GUIs can show proper chat history
rememberDataPacket(p)

View File

@@ -583,6 +583,7 @@ class SettingsFragment : ScreenFragment("Settings"), Logging {
val unsetIndex = regions.indexOf(RadioConfigProtos.RegionCode.Unset.name)
spinner.onItemSelectedListener = null
if(region != null) {
debug("current region is $region")
var regionIndex = regions.indexOf(region.name)
if(regionIndex == -1) // Not found, probably because the device has a region our app doesn't yet understand. Punt and say Unset
regionIndex = unsetIndex
@@ -593,6 +594,7 @@ class SettingsFragment : ScreenFragment("Settings"), Logging {
spinner.isEnabled = true
}
else {
warn("region is unset!")
spinner.setSelection(unsetIndex, false)
spinner.isEnabled = false // leave disabled, because we can't get our region
}