1.1.35 fix nasty progress related bug in firmware update

This commit is contained in:
Kevin Hester
2021-01-08 15:19:59 +08:00
parent a20fffcc2c
commit 3835a85b8e
2 changed files with 9 additions and 4 deletions

View File

@@ -194,16 +194,21 @@ class SoftwareUpdateService : JobIntentService(), Logging {
}
/**
* true if we are busy with an update right now
*/
val isUpdating get() = progress >= 0
/**
* Update our progress indication for GUIs
*
* @param isAppload if false, we don't report failure indications (because we consider spiffs non critical for now). But do report to analytics
*/
fun sendProgress(context: Context, p: Int, isAppload: Boolean) {
if(!isAppload && progress < 0)
if(!isAppload && p < 0)
reportError("Error while writing spiffs $progress") // See if this is happening in the wild
if(progress != p && (progress >= 0 || isAppload)) {
if(progress != p && (p >= 0 || isAppload)) {
progress = p
val intent = Intent(ACTION_UPDATE_PROGRESS).putExtra(