Removed app context for PreferenceUtil class
This commit is contained in:
parent
5df5f6c93e
commit
2bbe39eab7
97 changed files with 397 additions and 456 deletions
|
@ -47,13 +47,13 @@ public class BlacklistStore extends SQLiteOpenHelper {
|
|||
public static synchronized BlacklistStore getInstance(@NonNull final Context context) {
|
||||
if (sInstance == null) {
|
||||
sInstance = new BlacklistStore(context.getApplicationContext());
|
||||
if (!PreferenceUtil.getInstance().initializedBlacklist()) {
|
||||
if (!PreferenceUtil.getInstance(context).initializedBlacklist()) {
|
||||
// blacklisted by default
|
||||
sInstance.addPathImpl(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_ALARMS));
|
||||
sInstance.addPathImpl(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_NOTIFICATIONS));
|
||||
sInstance.addPathImpl(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_RINGTONES));
|
||||
|
||||
PreferenceUtil.getInstance().setInitializedBlacklist();
|
||||
PreferenceUtil.getInstance(context).setInitializedBlacklist();
|
||||
}
|
||||
}
|
||||
return sInstance;
|
||||
|
|
|
@ -26,6 +26,7 @@ import io.reactivex.android.schedulers.AndroidSchedulers
|
|||
import io.reactivex.schedulers.Schedulers
|
||||
|
||||
class RepositoryImpl(private val context: Context) : Repository {
|
||||
|
||||
override fun artistInfoFloable(
|
||||
name: String,
|
||||
lang: String?,
|
||||
|
@ -188,17 +189,4 @@ class RepositoryImpl(private val context: Context) : Repository {
|
|||
return GenreLoader.getSongs(context, genreId)
|
||||
|
||||
}
|
||||
|
||||
|
||||
companion object {
|
||||
private var INSTANCE: RepositoryImpl? = null
|
||||
|
||||
val instance: RepositoryImpl
|
||||
@Synchronized get() {
|
||||
if (INSTANCE == null) {
|
||||
INSTANCE = RepositoryImpl(App.instance)
|
||||
}
|
||||
return INSTANCE!!
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue