Merge 2.8 release with master (#1887)

* Add Traceur for getting meaningful RxJava stack traces (#1832)

* Hotfix for overwrite issue in 2.8.0  (#1838)

* This solution is an hotfix for overrite issue came back on 2.8.0 version. What I did is checking the extension, and if it is null, adding .jpg suffix. Because commons files always have suffixes, and we should compare file names after adding suffixes. Othervise overrides are possible.

* Check if file title includes an extension already, by checking if is there any dot in it.

* Fix logic error

* Add uncovered tests

* Remove unecessary line breaks

* Make Javadocs more explicit

* Versioning and changelog for v2.8.2 (#1842)

* Versioning for v2.8.2

* Changelog for v2.8.2

* Add logs in wiki data edit and session refresh flow (#1874)

* Fix logout (#1875)

* [WIP] Refactor feedback and quiz to reduce possibility of NPE (#1881)

* Refactor feedback and quiz to reduce possibility of NPE

* Handle throwables in quiz checker

* Minor refactoring

* Set Traceur to only work in DEBUG mode (#1884)

* Bug fix for uploaded images count in achievements activity (#1885)

* Versioning and changelog for v2.8.3 (#1886)

* Update changelog.md

* Versioning for v2.8.3
This commit is contained in:
Vivek Maskara 2018-09-07 05:50:41 +05:30 committed by GitHub
parent 13c377aa17
commit a63b9f88bb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
18 changed files with 284 additions and 252 deletions

View file

@ -1,5 +1,6 @@
package fr.free.nrw.commons;
import android.annotation.SuppressLint;
import android.app.Application;
import android.app.NotificationChannel;
import android.app.NotificationManager;
@ -14,6 +15,8 @@ import com.facebook.imagepipeline.core.ImagePipelineConfig;
import com.facebook.stetho.Stetho;
import com.squareup.leakcanary.LeakCanary;
import com.squareup.leakcanary.RefWatcher;
import com.tspoon.traceur.Traceur;
import com.tspoon.traceur.TraceurConfig;
import org.acra.ACRA;
import org.acra.ReportingInteractionMode;
@ -84,6 +87,12 @@ public class CommonsApplication extends Application {
@Override
public void onCreate() {
super.onCreate();
if (BuildConfig.DEBUG) {
//FIXME: Traceur should be disabled for release builds until error fixed
//See https://github.com/commons-app/apps-android-commons/issues/1877
Traceur.enableLogging();
}
ApplicationlessInjection
.getInstance(this)
.getCommonsApplicationComponent()
@ -152,6 +161,7 @@ public class CommonsApplication extends Application {
* @param context Application context
* @param logoutListener Implementation of interface LogoutListener
*/
@SuppressLint("CheckResult")
public void clearApplicationData(Context context, LogoutListener logoutListener) {
File cacheDirectory = context.getCacheDir();
File applicationDirectory = new File(cacheDirectory.getParent());
@ -164,7 +174,7 @@ public class CommonsApplication extends Application {
}
}
sessionManager.clearAllAccounts()
sessionManager.logout()
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(() -> {
@ -175,7 +185,6 @@ public class CommonsApplication extends Application {
applicationPrefs.edit().putBoolean("firstrun", false).apply();
otherPrefs.edit().clear().apply();
updateAllDatabases();
logoutListener.onLogoutComplete();
});
}