File tree Expand file tree Collapse file tree
src/main/java/com/owncloud/android Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -407,6 +407,22 @@ and thereof we'd ask contributors to be mindful of their code testability:
407407 should at least not make future efforts more challenging
4084083. whenever possible, testability should be improved even if the code is not covered by tests
409409
410+ ### Performance
411+
412+ If you're interested in improving the app's performance, please check the [official documentation](https: // developer.android.com/topic/performance)
413+ for ways you can inspect and improve performance.
414+
415+ For additional analysis, set the `perfAnalysis` property
416+ in your Gradle build:
417+
418+ ```shell
419+ . / gradlew installGplayDebug - P perfAnalysis
420+ ```
421+
422+ This will install the app with [LeakCanary ](https: // square.github.io/leakcanary/) and
423+ [StrictMode ](https: // developer.android.com/reference/android/os/StrictMode) enabled and configured.
424+ These tools can help find memory leaks, foreground operations that should be in background, and other performance
425+ problems.
410426
411427# Releases
412428At the moment we are releasing the app in two app stores:
Original file line number Diff line number Diff line change @@ -69,6 +69,8 @@ file("$project.rootDir/ndk.env").readLines().each() {
6969 ndkEnv. put(key, value)
7070}
7171
72+ def perfAnalysis = project. hasProperty(' perfAnalysis' )
73+
7274android {
7375
7476 compileSdkVersion 32
@@ -85,6 +87,7 @@ android {
8587 targetSdkVersion 31
8688
8789 buildConfigField ' boolean' , ' CI' , ciBuild. toString()
90+ buildConfigField ' boolean' , ' RUNTIME_PERF_ANALYSIS' , perfAnalysis. toString()
8891
8992 javaCompileOptions {
9093 annotationProcessorOptions {
@@ -309,7 +312,7 @@ dependencies {
309312 }
310313 }
311314
312- if (project . hasProperty( " leakCanary " ) ) {
315+ if (perfAnalysis ) {
313316 debugImplementation ' com.squareup.leakcanary:leakcanary-android:2.10'
314317 }
315318
Original file line number Diff line number Diff line change @@ -488,7 +488,8 @@ private void fixStoragePath() {
488488 }
489489
490490 private void enableStrictMode () {
491- if (BuildConfig .DEBUG ) {
491+ if (BuildConfig .DEBUG && BuildConfig .RUNTIME_PERF_ANALYSIS ) {
492+ Log_OC .d (TAG , "Enabling StrictMode" );
492493 StrictMode .setThreadPolicy (new StrictMode .ThreadPolicy .Builder ()
493494 .detectDiskReads ()
494495 .detectDiskWrites ()
You can’t perform that action at this time.
0 commit comments