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.
This commit is contained in:
Gabriele M
2017-07-02 22:21:26 +02:00
parent e7511d0041
commit 1e20caffc4

View File

@@ -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");
}
}
}