adding Leak Canary

This commit is contained in:
tibbi 2017-12-18 12:21:41 +01:00
parent 027005986b
commit bb18218c0a
4 changed files with 17 additions and 0 deletions

View File

@ -31,6 +31,13 @@ android {
}
}
ext {
leakCanaryVersion = '1.5.4'
}
dependencies {
implementation 'com.simplemobiletools:commons:3.2.19'
debugImplementation "com.squareup.leakcanary:leakcanary-android:$leakCanaryVersion"
releaseImplementation "com.squareup.leakcanary:leakcanary-android-no-op:$leakCanaryVersion"
}

View File

@ -8,6 +8,7 @@
<uses-permission android:name="android.permission.CALL_PHONE"/>
<uses-permission android:name="android.permission.READ_CONTACTS"/>
<uses-permission android:name="android.permission.WRITE_CONTACTS"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission
android:name="android.permission.USE_FINGERPRINT"

View File

@ -2,10 +2,18 @@ package com.simplemobiletools.contacts
import android.app.Application
import com.simplemobiletools.commons.extensions.checkUseEnglish
import com.squareup.leakcanary.LeakCanary
class App : Application() {
override fun onCreate() {
super.onCreate()
if (BuildConfig.DEBUG) {
if (LeakCanary.isInAnalyzerProcess(this)) {
return
}
LeakCanary.install(this)
}
checkUseEnglish()
}
}

View File

@ -55,6 +55,7 @@ class ContactsHelper(val activity: BaseSimpleActivity) {
selection += " AND ${ContactsContract.RawContacts.ACCOUNT_NAME} IN ($questionMarks)"
selectionArgs += sources.toTypedArray()
}
val sortOrder = getSortString()
var cursor: Cursor? = null
try {