kopia lustrzana https://github.com/meshtastic/Meshtastic-Android
remove support for the old address prefs key (deprecated pre 1.0)
rodzic
8b70bf1a14
commit
2ec15bf7b1
|
@ -50,7 +50,6 @@ class RadioInterfaceService : Service(), Logging {
|
||||||
*/
|
*/
|
||||||
const val RADIO_CONNECTED_ACTION = "$prefix.CONNECT_CHANGED"
|
const val RADIO_CONNECTED_ACTION = "$prefix.CONNECT_CHANGED"
|
||||||
|
|
||||||
const val DEVADDR_KEY_OLD = "devAddr"
|
|
||||||
const val DEVADDR_KEY = "devAddr2" // the new name for devaddr
|
const val DEVADDR_KEY = "devAddr2" // the new name for devaddr
|
||||||
|
|
||||||
/// This is public only so that SimRadio can bootstrap our message flow
|
/// This is public only so that SimRadio can bootstrap our message flow
|
||||||
|
@ -77,15 +76,6 @@ class RadioInterfaceService : Service(), Logging {
|
||||||
val prefs = getPrefs(context)
|
val prefs = getPrefs(context)
|
||||||
var address = prefs.getString(DEVADDR_KEY, null)
|
var address = prefs.getString(DEVADDR_KEY, null)
|
||||||
|
|
||||||
if (address == null) { /// Check for the old preferences name we used to use
|
|
||||||
var rest = prefs.getString(DEVADDR_KEY_OLD, null)
|
|
||||||
if(rest == "null")
|
|
||||||
rest = null
|
|
||||||
|
|
||||||
if (rest != null)
|
|
||||||
address = BluetoothInterface.toInterfaceName(rest) // Add the bluetooth prefix
|
|
||||||
}
|
|
||||||
|
|
||||||
// If we are running on the emulator we default to the mock interface, so we can have some data to show to the user
|
// If we are running on the emulator we default to the mock interface, so we can have some data to show to the user
|
||||||
if(address == null && isMockInterfaceAvailable(context))
|
if(address == null && isMockInterfaceAvailable(context))
|
||||||
address = MockInterface.interfaceName
|
address = MockInterface.interfaceName
|
||||||
|
@ -307,8 +297,6 @@ class RadioInterfaceService : Service(), Logging {
|
||||||
debug("Setting bonded device to ${address.anonymize}")
|
debug("Setting bonded device to ${address.anonymize}")
|
||||||
|
|
||||||
getPrefs(this).edit(commit = true) {
|
getPrefs(this).edit(commit = true) {
|
||||||
this.remove(DEVADDR_KEY_OLD) // remove any old version of the key
|
|
||||||
|
|
||||||
if (address == null)
|
if (address == null)
|
||||||
this.remove(DEVADDR_KEY)
|
this.remove(DEVADDR_KEY)
|
||||||
else
|
else
|
||||||
|
|
Ładowanie…
Reference in New Issue