From 60e2bac3a2c8518476fc450177f9eec9f7ef7b75 Mon Sep 17 00:00:00 2001 From: Henrique Velloso Date: Fri, 20 Feb 2026 15:23:11 -0300 Subject: [PATCH] hotfix: show installing state on install retry Retrying from Install (retry) kept the operation in InstallCancelled until native callbacks arrived. In that state, the Android handler ignores install events, so the UI could stay stuck without showing progress. Set retryInstall() to switch to Installing before invoking native install, ensuring immediate feedback and allowing retry events to be processed normally. --- lib/services/package_manager/package_manager.dart | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/lib/services/package_manager/package_manager.dart b/lib/services/package_manager/package_manager.dart index 0925a03..57f8b45 100644 --- a/lib/services/package_manager/package_manager.dart +++ b/lib/services/package_manager/package_manager.dart @@ -255,7 +255,9 @@ abstract class PackageManager extends StateNotifier { filePath: op.filePath, ), ); - if (op is Installing || op is SystemProcessing || op is ReadyToInstall) { + if (op is Installing || + op is SystemProcessing || + op is ReadyToInstall) { clearInstallSlot(appId); needsQueueProcessing = true; } @@ -595,6 +597,10 @@ abstract class PackageManager extends StateNotifier { return; } + // Exit InstallCancelled immediately so UI shows progress and native + // install events are no longer ignored by AndroidPackageManager. + setOperation(appId, Installing(target: op.target, filePath: op.filePath)); + await _performInstall(appId, op.target, op.filePath); } @@ -1577,7 +1583,8 @@ final batchProgressProvider = Provider((ref) { // Total excludes InstallCancelled — those are already resolved from the // batch's perspective and should not inflate the count. - final total = completed + downloading + verifying + installing + queued + failed; + final total = + completed + downloading + verifying + installing + queued + failed; // If only InstallCancelled operations remain, no batch to show if (total == 0) return null; @@ -1598,8 +1605,8 @@ final batchProgressProvider = Provider((ref) { final completedLabel = completedUpdates > 0 && completedInstalls == 0 ? 'updated' : completedInstalls > 0 && completedUpdates == 0 - ? 'installed' - : 'completed'; + ? 'installed' + : 'completed'; return BatchProgress( total: total,