diff options
author | daniel oeh <daniel.oeh@gmail.com> | 2012-07-22 13:06:25 +0200 |
---|---|---|
committer | daniel oeh <daniel.oeh@gmail.com> | 2012-07-22 13:06:25 +0200 |
commit | 4a7b6d439edfad289a7cc1f34de4bf1dc2509e0b (patch) | |
tree | e941fd0675f6f5a27b9710e4c3d085f66e261962 /src/de/danoeh/antennapod/util | |
parent | f0edc0558b19bd8185e84876a233d1930c5867f5 (diff) | |
download | AntennaPod-4a7b6d439edfad289a7cc1f34de4bf1dc2509e0b.zip |
Replaced buildconfig condition with appconfig condition
Diffstat (limited to 'src/de/danoeh/antennapod/util')
5 files changed, 21 insertions, 21 deletions
diff --git a/src/de/danoeh/antennapod/util/ConnectionTester.java b/src/de/danoeh/antennapod/util/ConnectionTester.java index 8d5e189f4..2318c0c59 100644 --- a/src/de/danoeh/antennapod/util/ConnectionTester.java +++ b/src/de/danoeh/antennapod/util/ConnectionTester.java @@ -6,7 +6,7 @@ import java.net.MalformedURLException; import java.net.URL; import java.net.URLConnection; -import de.danoeh.antennapod.BuildConfig; +import de.danoeh.antennapod.AppConfig; import android.content.Context; import android.util.Log; @@ -34,22 +34,22 @@ public class ConnectionTester implements Runnable { @Override public void run() { - if (BuildConfig.DEBUG) Log.d(TAG, "Testing connection"); + if (AppConfig.DEBUG) Log.d(TAG, "Testing connection"); try { URL url = new URL(strUrl); HttpURLConnection con = (HttpURLConnection) url.openConnection(); con.connect(); callback.onConnectionSuccessful(); - if (BuildConfig.DEBUG) Log.d(TAG, "Connection seems to work"); + if (AppConfig.DEBUG) Log.d(TAG, "Connection seems to work"); } catch (MalformedURLException e) { e.printStackTrace(); reason = DownloadError.ERROR_CONNECTION_ERROR; - if (BuildConfig.DEBUG) Log.d(TAG, "Connection failed"); + if (AppConfig.DEBUG) Log.d(TAG, "Connection failed"); callback.onConnectionFailure(); } catch (IOException e) { e.printStackTrace(); reason = DownloadError.ERROR_CONNECTION_ERROR; - if (BuildConfig.DEBUG) Log.d(TAG, "Connection failed"); + if (AppConfig.DEBUG) Log.d(TAG, "Connection failed"); callback.onConnectionFailure(); } } diff --git a/src/de/danoeh/antennapod/util/FeedMenuHandler.java b/src/de/danoeh/antennapod/util/FeedMenuHandler.java index 6c87b2313..31d3febdf 100644 --- a/src/de/danoeh/antennapod/util/FeedMenuHandler.java +++ b/src/de/danoeh/antennapod/util/FeedMenuHandler.java @@ -17,7 +17,7 @@ import de.danoeh.antennapod.feed.FeedItem; import de.danoeh.antennapod.feed.FeedManager; import de.danoeh.antennapod.service.DownloadService; import de.danoeh.antennapod.storage.DownloadRequester; -import de.danoeh.antennapod.BuildConfig; +import de.danoeh.antennapod.AppConfig; import de.danoeh.antennapod.R; /** Handles interactions with the FeedItemMenu. */ @@ -30,7 +30,7 @@ public class FeedMenuHandler { } public static boolean onPrepareOptionsMenu(Menu menu, Feed selectedFeed) { - if (BuildConfig.DEBUG) Log.d(TAG, "Preparing options menu"); + if (AppConfig.DEBUG) Log.d(TAG, "Preparing options menu"); if (selectedFeed.getPaymentLink() != null) { menu.findItem(R.id.support_item).setVisible(true); } diff --git a/src/de/danoeh/antennapod/util/FlattrServiceCreator.java b/src/de/danoeh/antennapod/util/FlattrServiceCreator.java index 28c64e093..9602df53c 100644 --- a/src/de/danoeh/antennapod/util/FlattrServiceCreator.java +++ b/src/de/danoeh/antennapod/util/FlattrServiceCreator.java @@ -4,7 +4,7 @@ import org.shredzone.flattr4j.FlattrFactory; import org.shredzone.flattr4j.FlattrService; import org.shredzone.flattr4j.oauth.AccessToken; -import de.danoeh.antennapod.BuildConfig; +import de.danoeh.antennapod.AppConfig; import android.util.Log; @@ -16,7 +16,7 @@ public class FlattrServiceCreator { public static FlattrService getService(AccessToken token) { if (flattrService == null) { - if (BuildConfig.DEBUG) Log.d(TAG, "Creating new instance of Flattr Service"); + if (AppConfig.DEBUG) Log.d(TAG, "Creating new instance of Flattr Service"); FlattrFactory factory = FlattrFactory.getInstance(); flattrService = factory.createFlattrService(token); } @@ -24,7 +24,7 @@ public class FlattrServiceCreator { } public static void deleteFlattrService() { - if (BuildConfig.DEBUG) Log.d(TAG, "Deleting service instance"); + if (AppConfig.DEBUG) Log.d(TAG, "Deleting service instance"); flattrService = null; } } diff --git a/src/de/danoeh/antennapod/util/FlattrUtils.java b/src/de/danoeh/antennapod/util/FlattrUtils.java index 0c16dbd7b..1c77b7fc4 100644 --- a/src/de/danoeh/antennapod/util/FlattrUtils.java +++ b/src/de/danoeh/antennapod/util/FlattrUtils.java @@ -23,7 +23,7 @@ import android.os.AsyncTask; import android.preference.PreferenceManager; import android.util.Log; import android.widget.Toast; -import de.danoeh.antennapod.BuildConfig; +import de.danoeh.antennapod.AppConfig; import de.danoeh.antennapod.PodcastApp; import de.danoeh.antennapod.activity.FlattrAuthActivity; import de.danoeh.antennapod.asynctask.FlattrTokenFetcher; @@ -64,15 +64,15 @@ public class FlattrUtils { */ private static AccessToken retrieveToken() { if (cachedToken == null) { - if (BuildConfig.DEBUG) Log.d(TAG, "Retrieving access token"); + if (AppConfig.DEBUG) Log.d(TAG, "Retrieving access token"); String token = PreferenceManager.getDefaultSharedPreferences( PodcastApp.getInstance()) .getString(PREF_ACCESS_TOKEN, null); if (token != null) { - if (BuildConfig.DEBUG) Log.d(TAG, "Found access token. Caching."); + if (AppConfig.DEBUG) Log.d(TAG, "Found access token. Caching."); cachedToken = new AccessToken(token); } else { - if (BuildConfig.DEBUG) Log.d(TAG, "No access token found"); + if (AppConfig.DEBUG) Log.d(TAG, "No access token found"); return null; } } @@ -87,7 +87,7 @@ public class FlattrUtils { /** Stores the token as a preference */ public static void storeToken(AccessToken token) { - if (BuildConfig.DEBUG) Log.d(TAG, "Storing token"); + if (AppConfig.DEBUG) Log.d(TAG, "Storing token"); SharedPreferences.Editor editor = PreferenceManager .getDefaultSharedPreferences(PodcastApp.getInstance()).edit(); if (token != null) { @@ -100,7 +100,7 @@ public class FlattrUtils { } public static void deleteToken() { - if (BuildConfig.DEBUG) Log.d(TAG, "Deleting flattr token"); + if (AppConfig.DEBUG) Log.d(TAG, "Deleting flattr token"); storeToken(null); } @@ -133,7 +133,7 @@ public class FlattrUtils { } public static void revokeAccessToken(Context context) { - if (BuildConfig.DEBUG) Log.d(TAG, "Revoking access token"); + if (AppConfig.DEBUG) Log.d(TAG, "Revoking access token"); deleteToken(); FlattrServiceCreator.deleteFlattrService(); showRevokeDialog(context); @@ -156,7 +156,7 @@ public class FlattrUtils { } public static void showNoTokenDialog(final Context context, final String url) { - if (BuildConfig.DEBUG) Log.d(TAG, "Creating showNoTokenDialog"); + if (AppConfig.DEBUG) Log.d(TAG, "Creating showNoTokenDialog"); AlertDialog.Builder builder = new AlertDialog.Builder(context); builder.setTitle(R.string.no_flattr_token_title); builder.setMessage(R.string.no_flattr_token_msg); diff --git a/src/de/danoeh/antennapod/util/URLChecker.java b/src/de/danoeh/antennapod/util/URLChecker.java index 338401060..7eca63f4a 100644 --- a/src/de/danoeh/antennapod/util/URLChecker.java +++ b/src/de/danoeh/antennapod/util/URLChecker.java @@ -1,6 +1,6 @@ package de.danoeh.antennapod.util; -import de.danoeh.antennapod.BuildConfig; +import de.danoeh.antennapod.AppConfig; import android.util.Log; /** Provides methods for checking and editing a URL.*/ @@ -26,12 +26,12 @@ public final class URLChecker { if (!url.startsWith("http")) { builder.append("http://"); - if (BuildConfig.DEBUG) Log.d(TAG, "Missing http; appending"); + if (AppConfig.DEBUG) Log.d(TAG, "Missing http; appending"); } builder.append(url); if (url.contains(FEEDBURNER_URL)) { - if (BuildConfig.DEBUG) Log.d(TAG, + if (AppConfig.DEBUG) Log.d(TAG, "URL seems to be Feedburner URL; appending prefix"); builder.append(FEEDBURNER_PREFIX); } |