From ac1f262a8f00b45f35b3f446281cd0fefd650339 Mon Sep 17 00:00:00 2001 From: maxwen Date: Thu, 25 Feb 2016 00:49:03 +0100 Subject: [PATCH] OpenDelta: add error state for failing to create flash setup sometimes /cache is full - so signal that to the user and dont just fail silently Change-Id: I1a5455381381f0ad316a302811e23962dc7261f4 --- res/values/strings.xml | 1 + src/eu/chainfire/opendelta/MainActivity.java | 4 ++++ src/eu/chainfire/opendelta/UpdateService.java | 2 ++ 3 files changed, 7 insertions(+) diff --git a/res/values/strings.xml b/res/values/strings.xml index 79922c7..36b17e6 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -105,4 +105,5 @@ Delete existing update files to force downloading full update Deleted %d files. Now press \'Check for updates\' No storage permissions. + Failed to setup flash. Clean /cache and retry. diff --git a/src/eu/chainfire/opendelta/MainActivity.java b/src/eu/chainfire/opendelta/MainActivity.java index 18ec25f..cb81d64 100644 --- a/src/eu/chainfire/opendelta/MainActivity.java +++ b/src/eu/chainfire/opendelta/MainActivity.java @@ -257,6 +257,10 @@ public class MainActivity extends Activity { progress.setIndeterminate(false); } else if (UpdateService.STATE_ERROR_PERMISSIONS.equals(state)) { progress.setIndeterminate(false); + } else if (UpdateService.STATE_ERROR_FLASH.equals(state)) { + enableCheck = true; + enableFlash = true; + progress.setIndeterminate(false); } else if (UpdateService.STATE_ACTION_NONE.equals(state)) { enableCheck = true; progress.setIndeterminate(false); diff --git a/src/eu/chainfire/opendelta/UpdateService.java b/src/eu/chainfire/opendelta/UpdateService.java index 032bdbf..da20035 100644 --- a/src/eu/chainfire/opendelta/UpdateService.java +++ b/src/eu/chainfire/opendelta/UpdateService.java @@ -152,6 +152,7 @@ OnWantUpdateCheckListener, OnSharedPreferenceChangeListener { public static final String STATE_ERROR_DOWNLOAD = "error_download"; public static final String STATE_ERROR_CONNECTION = "error_connection"; public static final String STATE_ERROR_PERMISSIONS = "error_permissions"; + public static final String STATE_ERROR_FLASH = "error_flash"; private static final String ACTION_CHECK = "eu.chainfire.opendelta.action.CHECK"; private static final String ACTION_FLASH = "eu.chainfire.opendelta.action.FLASH"; @@ -1608,6 +1609,7 @@ OnWantUpdateCheckListener, OnSharedPreferenceChangeListener { // else to do at // at this stage than give up. No reason to crash though. Logger.ex(e); + updateState(STATE_ERROR_FLASH, null, null, null, null, null); } }