diff options
author | Gabriele M <moto.falcon.git@gmail.com> | 2017-11-30 23:41:00 +0100 |
---|---|---|
committer | Gabriele M <moto.falcon.git@gmail.com> | 2018-01-23 22:41:40 +0100 |
commit | 63f6fd1a70d15f311b16a3f9f725bfecb432ca7c (patch) | |
tree | 3dbab6038d32766366de1167afb58c05cf95a9b2 | |
parent | e02b8a0b00730ead5ed5d9c09a6a23831b1b9bce (diff) | |
download | android_packages_apps_Updater-63f6fd1a70d15f311b16a3f9f725bfecb432ca7c.tar.gz android_packages_apps_Updater-63f6fd1a70d15f311b16a3f9f725bfecb432ca7c.tar.bz2 android_packages_apps_Updater-63f6fd1a70d15f311b16a3f9f725bfecb432ca7c.zip |
Report installation failures
Change-Id: I5e11db1e6e338a510b3c1c7d16f8c085d874a9db
3 files changed, 12 insertions, 2 deletions
diff --git a/src/org/lineageos/updater/controller/ABUpdateInstaller.java b/src/org/lineageos/updater/controller/ABUpdateInstaller.java index 7978e31..2524296 100644 --- a/src/org/lineageos/updater/controller/ABUpdateInstaller.java +++ b/src/org/lineageos/updater/controller/ABUpdateInstaller.java @@ -141,6 +141,9 @@ class ABUpdateInstaller { File file = mUpdaterController.getActualUpdate(mDownloadId).getFile(); if (!file.exists()) { Log.e(TAG, "The given update doesn't exist"); + mUpdaterController.getActualUpdate(downloadId) + .setStatus(UpdateStatus.INSTALLATION_FAILED); + mUpdaterController.notifyUpdateChange(downloadId); return false; } @@ -175,6 +178,9 @@ class ABUpdateInstaller { mUpdateEngine = new UpdateEngine(); if (!mUpdateEngine.bind(mUpdateEngineCallback)) { Log.e(TAG, "Could not bind"); + mUpdaterController.getActualUpdate(downloadId) + .setStatus(UpdateStatus.INSTALLATION_FAILED); + mUpdaterController.notifyUpdateChange(downloadId); return false; } String zipFileUri = "file://" + file.getAbsolutePath(); diff --git a/src/org/lineageos/updater/controller/UpdateInstaller.java b/src/org/lineageos/updater/controller/UpdateInstaller.java index f0d41c9..aaae06b 100644 --- a/src/org/lineageos/updater/controller/UpdateInstaller.java +++ b/src/org/lineageos/updater/controller/UpdateInstaller.java @@ -76,8 +76,10 @@ class UpdateInstaller { try { android.os.RecoverySystem.installPackage(mContext, update); } catch (IOException e) { - // TODO: show error message Log.e(TAG, "Could not install update", e); + mUpdaterController.getActualUpdate(downloadId) + .setStatus(UpdateStatus.INSTALLATION_FAILED); + mUpdaterController.notifyUpdateChange(downloadId); } } diff --git a/src/org/lineageos/updater/controller/UpdaterService.java b/src/org/lineageos/updater/controller/UpdaterService.java index 03fcf8d..c151a4a 100644 --- a/src/org/lineageos/updater/controller/UpdaterService.java +++ b/src/org/lineageos/updater/controller/UpdaterService.java @@ -187,7 +187,9 @@ public class UpdaterService extends Service { } } catch (IOException e) { Log.e(TAG, "Could not install update", e); - // TODO: user facing message + mUpdaterController.getActualUpdate(downloadId) + .setStatus(UpdateStatus.INSTALLATION_FAILED); + mUpdaterController.notifyUpdateChange(downloadId); } } else if (ACTION_INSTALL_STOP.equals(intent.getAction())) { if (UpdateInstaller.isInstalling()) { |