** Function name: performUpdate ** Description: this function performs the update ***************************************************************************************/
| 415 | ** Description: this function performs the update |
| 416 | ***************************************************************************************/ |
| 417 | bool performUpdate(Stream &updateSource, size_t updateSize, int command) { |
| 418 | bool success = false; |
| 419 | tft->fillRoundRect(6, 6, tftWidth - 12, tftHeight - 12, 5, BGCOLOR); |
| 420 | progressHandler(0, 500); |
| 421 | |
| 422 | pauseSdInstallInput(); |
| 423 | LauncherUpdateTarget target; |
| 424 | if (launcherUpdateTargetFromCommand(command, target)) { |
| 425 | prog_handler = target == LAUNCHER_UPDATE_APP ? 0 : 1; |
| 426 | log_i("updateSize = %d", updateSize); |
| 427 | if (launcherUpdateStream(updateSource, updateSize, target, progressHandler) && |
| 428 | launcherUpdateIsFinished()) { |
| 429 | log_i("Update successfully completed. Rebooting."); |
| 430 | displayRedStripe("Post Install Cleanup"); |
| 431 | launcherClearCoredump(); |
| 432 | success = true; |
| 433 | } else { |
| 434 | log_i("Error Occurred. Error #: %d", launcherUpdateLastError()); |
| 435 | } |
| 436 | } else { |
| 437 | uint8_t error = launcherUpdateLastError(); |
| 438 | displayRedStripe("E:" + String(error) + "-Wrong Partition Scheme"); |
| 439 | launcherDelayMs(2500); |
| 440 | } |
| 441 | resumeSdInstallInput(); |
| 442 | return success; |
| 443 | } |
| 444 | static String installedAppNameFromPath(const String &path) { return launcherAppNameFromFile(path); } |
| 445 | |
| 446 | static bool flashRawFromSd( |
nothing calls this directly
no test coverage detected