pull/242/head
Kevin Hester 2021-02-12 13:50:39 +08:00
rodzic 11bc8ef5f0
commit 221738603b
3 zmienionych plików z 14 dodań i 9 usunięć

Wyświetl plik

@ -31,8 +31,8 @@ android {
applicationId "com.geeksville.mesh"
minSdkVersion 21 // The oldest emulator image I have tried is 22 (though 21 probably works)
targetSdkVersion 29
versionCode 20144 // format is Mmmss (where M is 1+the numeric major number
versionName "1.1.44"
versionCode 20146 // format is Mmmss (where M is 1+the numeric major number
versionName "1.1.46"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
// per https://developer.android.com/studio/write/vector-asset-studio

Wyświetl plik

@ -6,7 +6,6 @@ import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent
import android.content.IntentFilter
import android.os.Build
import android.os.IBinder
import android.os.RemoteException
import android.widget.Toast
@ -735,7 +734,7 @@ class MeshService : Service(), Logging {
val packet = toMeshPacket(p)
p.status = MessageStatus.ENROUTE
p.time = System.currentTimeMillis() // update time to the actual time we started sending
if(BuildConfig.DEBUG)
if (BuildConfig.DEBUG)
debug("Sending to radio: $packet") // IMPORTANT: we only log this info for debug builds, because it might leak PII
sendToRadio(packet)
}
@ -1308,6 +1307,9 @@ class MeshService : Service(), Logging {
it.wantResponse = wantResponse
}.build()
// Assume our position packets are not critical
packet.priority = MeshProtos.MeshPacket.Priority.BACKGROUND
// Also update our own map for our nodenum, by handling the packet just like packets from other users
handleReceivedPosition(myNodeInfo!!.myNodeNum, position)
@ -1401,7 +1403,7 @@ class MeshService : Service(), Logging {
// We now always pick a random initial packet id (odds of collision with the device is insanely low with 32 bit ids)
val random = Random(System.currentTimeMillis())
val devicePacketId = random.nextLong().absoluteValue
// Not inited - pick a number on the opposite side of what the device is using
currentPacketId = devicePacketId + numPacketIds / 2
} else {
@ -1449,13 +1451,16 @@ class MeshService : Service(), Logging {
BluetoothInterface.safe
?: throw Exception("Can't update - no bluetooth connected")
if (updateJob?.isActive == true)
if (updateJob?.isActive == true) {
errormsg("A firmware update is already running")
throw Exception("Firmware update already running")
else
} else {
debug("Creating firmware update coroutine")
updateJob = serviceScope.handledLaunch {
info("Starting firmware update coroutine")
debug("Starting firmware update coroutine")
SoftwareUpdateService.doUpdate(this@MeshService, safe, filename)
}
}
}
/**

@ -1 +1 @@
Subproject commit 8492e4030ad928ee5fc97f8ead95325dba7f9492
Subproject commit b1aed06442025624841b2288fac273d9bc41c438