From 3b9ec1993d0a11c0147fb0f31b3356ded73e80a8 Mon Sep 17 00:00:00 2001 From: Ox Cart Date: Fri, 1 Sep 2023 07:49:19 -0500 Subject: [PATCH] Revert "Changes to get app closer to working on Ox's Android 9 device" This reverts commit 8ef9dde36fb962b0923d13bf73ba8f7a668232d6. --- .../org/getlantern/lantern/LanternApp.kt | 30 +++++++++---------- .../lantern/service/LanternService.kt | 4 +-- android/build.gradle | 4 +-- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/android/app/src/main/kotlin/org/getlantern/lantern/LanternApp.kt b/android/app/src/main/kotlin/org/getlantern/lantern/LanternApp.kt index 9042b98b6..f200b423f 100644 --- a/android/app/src/main/kotlin/org/getlantern/lantern/LanternApp.kt +++ b/android/app/src/main/kotlin/org/getlantern/lantern/LanternApp.kt @@ -23,21 +23,21 @@ open class LanternApp : Application() { System.setProperty("kotlinx.coroutines.debug", "on") } - // if (BuildConfig.DEBUG) { - // StrictMode.setThreadPolicy( - // StrictMode.ThreadPolicy.Builder() - // .detectAll() - // .penaltyLog() - // .build(), - // ) - // StrictMode.setVmPolicy( - // StrictMode.VmPolicy.Builder() - // .detectLeakedSqlLiteObjects() - // .detectLeakedClosableObjects() - // .penaltyLog() - // .build(), - // ) - // } + if (BuildConfig.DEBUG) { + StrictMode.setThreadPolicy( + StrictMode.ThreadPolicy.Builder() + .detectAll() + .penaltyLog() + .build(), + ) + StrictMode.setVmPolicy( + StrictMode.VmPolicy.Builder() + .detectLeakedSqlLiteObjects() + .detectLeakedClosableObjects() + .penaltyLog() + .build(), + ) + } } override fun onCreate() { diff --git a/android/app/src/main/kotlin/org/getlantern/lantern/service/LanternService.kt b/android/app/src/main/kotlin/org/getlantern/lantern/service/LanternService.kt index 2df7f2050..ac39595ae 100644 --- a/android/app/src/main/kotlin/org/getlantern/lantern/service/LanternService.kt +++ b/android/app/src/main/kotlin/org/getlantern/lantern/service/LanternService.kt @@ -55,9 +55,9 @@ open class LanternService : Service(), Runnable { private val started: AtomicBoolean = AtomicBoolean() private lateinit var autoUpdater: AutoUpdater - override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int { + override fun onStartCommand(intent: Intent, flags: Int, startId: Int): Int { autoUpdater = AutoUpdater(this) - val autoBooted = intent?.getBooleanExtra(AUTO_BOOTED, false) == true + val autoBooted = intent.getBooleanExtra(AUTO_BOOTED, false) Logger.d(TAG, "Called onStartCommand, autoBooted?: $autoBooted") if (autoBooted) { Logger.debug( diff --git a/android/build.gradle b/android/build.gradle index 36a9481d6..e45a58ec5 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -29,8 +29,8 @@ ext { enableTestCodeCoverage = true - compileSdkVersion = 33 - targetSdkVersion = 33 + compileSdkVersion = 34 + targetSdkVersion = 34 minSdkVersion = 23 androidAnnotationsVersion = '4.8.0' androidAnnotationsAPIVersion = '4.8.0'