[new downloader][android] del: Removed Gson instance from App class.

This commit is contained in:
Alexander Marchuk 2016-02-09 12:07:50 +03:00 committed by Sergey Yershov
parent 22f470f23a
commit 9a5e748217
2 changed files with 10 additions and 18 deletions

View file

@ -11,7 +11,6 @@ import android.util.Log;
import java.io.File;
import com.google.gson.Gson;
import com.mapswithme.maps.background.AppBackgroundTracker;
import com.mapswithme.maps.background.Notifier;
import com.mapswithme.maps.bookmarks.data.BookmarkManager;
@ -42,7 +41,6 @@ public class MwmApplication extends Application
private static MwmApplication sSelf;
private SharedPreferences mPrefs;
private AppBackgroundTracker mBackgroundTracker;
private final Gson mGson = new Gson();
private boolean mAreCountersInitialized;
private boolean mIsFrameworkInitialized;
@ -75,11 +73,6 @@ public class MwmApplication extends Application
return sSelf;
}
public static Gson gson()
{
return sSelf.mGson;
}
public static AppBackgroundTracker backgroundTracker()
{
return sSelf.mBackgroundTracker;

View file

@ -11,14 +11,6 @@ import android.content.pm.ResolveInfo;
import android.support.annotation.StringRes;
import android.text.TextUtils;
import com.cocosw.bottomsheet.BottomSheet;
import com.mapswithme.maps.MwmApplication;
import com.mapswithme.maps.R;
import com.mapswithme.maps.bookmarks.data.BookmarkManager;
import com.mapswithme.util.BottomSheetHelper;
import com.mapswithme.util.concurrency.ThreadPool;
import com.mapswithme.util.concurrency.UiThread;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
@ -28,7 +20,14 @@ import java.util.List;
import java.util.Map;
import java.util.Set;
import static com.mapswithme.maps.MwmApplication.gson;
import com.cocosw.bottomsheet.BottomSheet;
import com.google.gson.Gson;
import com.mapswithme.maps.MwmApplication;
import com.mapswithme.maps.R;
import com.mapswithme.maps.bookmarks.data.BookmarkManager;
import com.mapswithme.util.BottomSheetHelper;
import com.mapswithme.util.concurrency.ThreadPool;
import com.mapswithme.util.concurrency.UiThread;
public final class SharingHelper
{
@ -76,7 +75,7 @@ public final class SharingHelper
try
{
return gson().fromJson(json, SharingTarget[].class);
return new Gson().fromJson(json, SharingTarget[].class);
} catch (Exception e)
{
return null;
@ -85,7 +84,7 @@ public final class SharingHelper
private void save()
{
String json = gson().toJson(mItems.values());
String json = new Gson().toJson(mItems.values());
mPrefs.edit().putString(PREFS_KEY_ITEMS, json).apply();
}