mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 20:33:53 +01:00
Leak Canary Integration
This commit is contained in:
parent
a81aa7fec0
commit
7d6c836e31
2 changed files with 18 additions and 8 deletions
|
|
@ -25,6 +25,10 @@ dependencies {
|
|||
testCompile 'junit:junit:4.12'
|
||||
androidTestCompile "com.android.support:support-annotations:${project.supportLibVersion}"
|
||||
androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2.2'
|
||||
|
||||
debugCompile 'com.squareup.leakcanary:leakcanary-android:1.5.1'
|
||||
releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5.1'
|
||||
testCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5.1'
|
||||
}
|
||||
|
||||
android {
|
||||
|
|
|
|||
|
|
@ -23,14 +23,7 @@ import com.nostra13.universalimageloader.cache.disc.impl.TotalSizeLimitedDiscCac
|
|||
import com.nostra13.universalimageloader.core.ImageLoader;
|
||||
import com.nostra13.universalimageloader.core.ImageLoaderConfiguration;
|
||||
import com.nostra13.universalimageloader.utils.StorageUtils;
|
||||
|
||||
import fr.free.nrw.commons.caching.CacheController;
|
||||
import fr.free.nrw.commons.category.Category;
|
||||
import fr.free.nrw.commons.contributions.Contribution;
|
||||
import fr.free.nrw.commons.data.DBOpenHelper;
|
||||
import fr.free.nrw.commons.modifications.ModifierSequence;
|
||||
import fr.free.nrw.commons.auth.AccountUtil;
|
||||
import fr.free.nrw.commons.nearby.NearbyPlaces;
|
||||
import com.squareup.leakcanary.LeakCanary;
|
||||
|
||||
import org.acra.ACRA;
|
||||
import org.acra.ReportingInteractionMode;
|
||||
|
|
@ -49,6 +42,13 @@ import org.apache.http.params.CoreProtocolPNames;
|
|||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
import fr.free.nrw.commons.auth.AccountUtil;
|
||||
import fr.free.nrw.commons.caching.CacheController;
|
||||
import fr.free.nrw.commons.category.Category;
|
||||
import fr.free.nrw.commons.contributions.Contribution;
|
||||
import fr.free.nrw.commons.data.DBOpenHelper;
|
||||
import fr.free.nrw.commons.modifications.ModifierSequence;
|
||||
import fr.free.nrw.commons.nearby.NearbyPlaces;
|
||||
import fr.free.nrw.commons.utils.FileUtils;
|
||||
import timber.log.Timber;
|
||||
|
||||
|
|
@ -166,6 +166,12 @@ public class CommonsApplication extends Application {
|
|||
@Override
|
||||
public void onCreate() {
|
||||
super.onCreate();
|
||||
if (LeakCanary.isInAnalyzerProcess(this)) {
|
||||
// This process is dedicated to LeakCanary for heap analysis.
|
||||
// You should not init your app in this process.
|
||||
return;
|
||||
}
|
||||
LeakCanary.install(this);
|
||||
|
||||
Timber.plant(new Timber.DebugTree());
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue