From 1e20caffc4bec5756e32b569321ea7f282b08946 Mon Sep 17 00:00:00 2001 From: Gabriele M Date: Sun, 2 Jul 2017 22:21:26 +0200 Subject: [PATCH] Throw an exception when trying to install unverified downloads Don't silently ignore the request. This will allow to display some useful message to the user. --- src/org/lineageos/updater/misc/Utils.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/org/lineageos/updater/misc/Utils.java b/src/org/lineageos/updater/misc/Utils.java index addc0e8..2d68127 100644 --- a/src/org/lineageos/updater/misc/Utils.java +++ b/src/org/lineageos/updater/misc/Utils.java @@ -126,6 +126,8 @@ public class Utils { public static void triggerUpdate(Context context, UpdateDownload update) throws IOException { if (update.getStatus() == UpdateStatus.VERIFIED) { android.os.RecoverySystem.installPackage(context, update.getFile()); + } else { + throw new IllegalStateException("Update must be verified"); } } }