From 988420842af53c72dcdc4221c605581788403ba9 Mon Sep 17 00:00:00 2001 From: GaidamakUA Date: Wed, 20 Jan 2016 11:00:59 +0200 Subject: [PATCH] Removed toast and unnecessary code line. --- .../plus/liveupdates/PerformLiveUpdateAsyncTask.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/liveupdates/PerformLiveUpdateAsyncTask.java b/OsmAnd/src/net/osmand/plus/liveupdates/PerformLiveUpdateAsyncTask.java index 52bd7b5f4e..84ae58400a 100644 --- a/OsmAnd/src/net/osmand/plus/liveupdates/PerformLiveUpdateAsyncTask.java +++ b/OsmAnd/src/net/osmand/plus/liveupdates/PerformLiveUpdateAsyncTask.java @@ -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 { + 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 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(); @@ -118,7 +121,7 @@ public class PerformLiveUpdateAsyncTask } public static void tryRescheduleDownload(Context context, OsmandSettings settings, - LocalIndexInfo localIndexInfo) { + LocalIndexInfo localIndexInfo) { final OsmandSettings.CommonPreference updateFrequencyPreference = preferenceUpdateFrequency(localIndexInfo, settings); final Integer frequencyOrdinal = updateFrequencyPreference.get();