Merge remote-tracking branch 'origin/master'

This commit is contained in:
Weblate 2016-01-20 10:01:25 +01:00
commit fbc24d32e0

View file

@ -5,8 +5,8 @@ import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import android.os.AsyncTask;
import android.widget.Toast;
import net.osmand.PlatformUtil;
import net.osmand.plus.OsmandApplication;
import net.osmand.plus.OsmandSettings;
import net.osmand.plus.activities.LocalIndexInfo;
@ -17,6 +17,8 @@ import net.osmand.plus.download.IndexItem;
import net.osmand.plus.resources.IncrementalChangesManager;
import net.osmand.util.Algorithms;
import org.apache.commons.logging.Log;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
@ -25,6 +27,8 @@ import static net.osmand.plus.liveupdates.LiveUpdatesHelper.preferenceUpdateFreq
public class PerformLiveUpdateAsyncTask
extends AsyncTask<String, Object, IncrementalChangesManager.IncrementalUpdateList> {
private final static Log LOG = PlatformUtil.getLog(OsmLiveActivity.class);
private final Context context;
private final LocalIndexInfo localIndexInfo;
private final boolean forceUpdate;
@ -41,7 +45,6 @@ public class PerformLiveUpdateAsyncTask
if (context instanceof AbstractDownloadActivity) {
AbstractDownloadActivity activity = (AbstractDownloadActivity) context;
activity.setSupportProgressBarIndeterminateVisibility(true);
OsmandSettings settings = activity.getMyApplication().getSettings();
}
final OsmandApplication myApplication = getMyApplication();
OsmandSettings.CommonPreference<Long> lastCheckPreference =
@ -69,7 +72,7 @@ public class PerformLiveUpdateAsyncTask
final OsmandApplication application = getMyApplication();
final OsmandSettings settings = application.getSettings();
if (result.errorMessage != null) {
Toast.makeText(context, result.errorMessage, Toast.LENGTH_SHORT).show();
LOG.info(result.errorMessage);
tryRescheduleDownload(context, settings, localIndexInfo);
} else {
settings.LIVE_UPDATES_RETRIES.resetToDefault();