fix so process restarts after archive loaded

This commit is contained in:
Eric House 2022-06-24 12:43:35 -07:00
parent 08a8bc4189
commit e516dbcf66

View file

@ -116,18 +116,19 @@ public class ZipUtils {
Log.d( TAG, "getHasWhats() => %s", result ); Log.d( TAG, "getHasWhats() => %s", result );
return result; return result;
} }
// Return true if anything is loaded/changed, as caller will use result to
// decide whether to restart process.
public static boolean load( Context context, Uri uri, public static boolean load( Context context, Uri uri,
final List<SaveWhat> whats ) final List<SaveWhat> whats )
{ {
Log.d( TAG, "load(%s)", whats );
boolean result = false; boolean result = false;
try { try {
result = iterate( context, uri, new EntryIter() { result = iterate( context, uri, new EntryIter() {
@Override @Override
public boolean withEntry( ZipInputStream zis, SaveWhat what ) public boolean withEntry( ZipInputStream zis, SaveWhat what )
throws FileNotFoundException, IOException { throws FileNotFoundException, IOException {
boolean success = false; boolean success = true;
if ( whats.contains( what ) ) { if ( whats.contains( what ) ) {
switch ( what ) { switch ( what ) {
case COLORS: case COLORS:
@ -151,7 +152,7 @@ public class ZipUtils {
Log.ex( TAG, ex ); Log.ex( TAG, ex );
result = false; result = false;
} }
Log.d( TAG, "load(%s) => %b", whats, result );
return result; return result;
} }