Merge remote-tracking branch 'origin/2.8-release' into 2.8-release

# Conflicts:
#	app/build.gradle
#	app/src/main/java/fr/free/nrw/commons/di/CommonsApplicationModule.java
This commit is contained in:
misaochan 2018-07-28 23:39:15 +10:00
commit d05cf395d8
23 changed files with 208 additions and 93 deletions

View file

@ -12,6 +12,7 @@ import javax.inject.Singleton;
import dagger.Module;
import dagger.Provides;
import fr.free.nrw.commons.BuildConfig;
import fr.free.nrw.commons.auth.AccountUtil;
import fr.free.nrw.commons.auth.SessionManager;
import fr.free.nrw.commons.data.DBOpenHelper;
@ -30,8 +31,6 @@ import static fr.free.nrw.commons.modifications.ModificationsContentProvider.MOD
@Module
@SuppressWarnings({"WeakerAccess", "unused"})
public class CommonsApplicationModule {
public static final String CATEGORY_AUTHORITY = "fr.free.nrw.commons.categories.contentprovider";
private Context applicationContext;
public CommonsApplicationModule(Context applicationContext) {
@ -51,7 +50,7 @@ public class CommonsApplicationModule {
@Provides
@Named("category")
public ContentProviderClient provideCategoryContentProviderClient(Context context) {
return context.getContentResolver().acquireContentProviderClient(CATEGORY_AUTHORITY);
return context.getContentResolver().acquireContentProviderClient(BuildConfig.CATEGORY_AUTHORITY);
}
/**
@ -69,13 +68,13 @@ public class CommonsApplicationModule {
@Provides
@Named("contribution")
public ContentProviderClient provideContributionContentProviderClient(Context context) {
return context.getContentResolver().acquireContentProviderClient(CONTRIBUTION_AUTHORITY);
return context.getContentResolver().acquireContentProviderClient(BuildConfig.CONTRIBUTION_AUTHORITY);
}
@Provides
@Named("modification")
public ContentProviderClient provideModificationContentProviderClient(Context context) {
return context.getContentResolver().acquireContentProviderClient(MODIFICATIONS_AUTHORITY);
return context.getContentResolver().acquireContentProviderClient(BuildConfig.MODIFICATION_AUTHORITY);
}
@Provides