forked from organicmaps/organicmaps
[Android] Remove MwmApplication.prefs
This commit is contained in:
parent
0d8ba7fd3b
commit
be3d79b806
2 changed files with 2 additions and 17 deletions
|
@ -55,7 +55,6 @@ public class MwmApplication extends Application implements AppBackgroundTracker.
|
|||
public final static String TAG = "MwmApplication";
|
||||
|
||||
private static MwmApplication sSelf;
|
||||
private SharedPreferences mPrefs;
|
||||
private AppBackgroundTracker mBackgroundTracker;
|
||||
@SuppressWarnings("NullableProblems")
|
||||
@NonNull
|
||||
|
@ -147,19 +146,6 @@ public class MwmApplication extends Application implements AppBackgroundTracker.
|
|||
return ((MwmApplication) context.getApplicationContext()).getBackgroundTracker();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* Use {@link #prefs(Context)} instead.
|
||||
*/
|
||||
@Deprecated
|
||||
public synchronized static SharedPreferences prefs()
|
||||
{
|
||||
if (sSelf.mPrefs == null)
|
||||
sSelf.mPrefs = sSelf.getSharedPreferences(sSelf.getString(R.string.pref_file_name), MODE_PRIVATE);
|
||||
|
||||
return sSelf.mPrefs;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public static SharedPreferences prefs(@NonNull Context context)
|
||||
{
|
||||
|
@ -188,8 +174,7 @@ public class MwmApplication extends Application implements AppBackgroundTracker.
|
|||
mMediator.initSensitiveDataToleranceLibraries();
|
||||
mMediator.initSensitiveDataStrictLibrariesAsync();
|
||||
Statistics.INSTANCE.setMediator(mMediator);
|
||||
|
||||
mPrefs = getSharedPreferences(getString(R.string.pref_file_name), MODE_PRIVATE);
|
||||
|
||||
initNotificationChannels();
|
||||
|
||||
mBackgroundTracker = new AppBackgroundTracker();
|
||||
|
|
|
@ -162,7 +162,7 @@ public enum TrackRecorder implements Initializable<Context>
|
|||
|
||||
long getAwaitTimeout()
|
||||
{
|
||||
return MwmApplication.prefs().getLong(LOCATION_TIMEOUT_STORED_KEY, LOCATION_TIMEOUT_MIN_MS);
|
||||
return MwmApplication.prefs(mContext).getLong(LOCATION_TIMEOUT_STORED_KEY, LOCATION_TIMEOUT_MIN_MS);
|
||||
}
|
||||
|
||||
private void setAwaitTimeout(long timeout)
|
||||
|
|
Loading…
Add table
Reference in a new issue