fix: open system installer when OTA session fails
This commit is contained in:
@@ -117,10 +117,12 @@ final class UpdateHook {
|
||||
if (apk == null) return "İndirme veya SHA-256 doğrulaması başarısız ("
|
||||
+ update.versionName + ")";
|
||||
|
||||
// The cached APK is cleared whichever way install goes: a rejected archive must not
|
||||
// linger, and an accepted one has already been streamed into the installer session.
|
||||
OtaUpdater.InstallResult result = OtaUpdater.install(app, apk);
|
||||
if (!apk.delete()) Log.w(TAG, "Could not remove cached OTA APK");
|
||||
// FileProvider's interactive installer opens asynchronously and still needs this file.
|
||||
// Other outcomes have either streamed the bytes already or rejected the archive.
|
||||
if (result != OtaUpdater.InstallResult.INSTALL_UI_STARTED && !apk.delete()) {
|
||||
Log.w(TAG, "Could not remove cached OTA APK");
|
||||
}
|
||||
|
||||
switch (result) {
|
||||
case SESSION_STARTED:
|
||||
@@ -128,6 +130,8 @@ final class UpdateHook {
|
||||
// platform may still want the driver to confirm, and either way the verdict
|
||||
// arrives at OtaInstallResultReceiver, not here.
|
||||
return "Kuruluyor: " + update.versionName + " — ekrandaki onayı bekleyin";
|
||||
case INSTALL_UI_STARTED:
|
||||
return "Kurulum ekranı açıldı: " + update.versionName;
|
||||
case UNREADABLE_ARCHIVE:
|
||||
return "Kurulum reddedildi: APK okunamadı";
|
||||
default:
|
||||
|
||||
Reference in New Issue
Block a user