From bc1fe2ab27d2aeba5435d4d7e9877d3ad28a2b4e Mon Sep 17 00:00:00 2001 From: Uwe Trottmann Date: Fri, 16 Aug 2024 08:39:37 +0200 Subject: [PATCH 1/5] AppUpgrade: do not crash when updating from version 40 Getting mutable implicit intent is disallowed. Instead of adding FLAG_NO_CREATE just drop the upgrade code as alarms should get canceled anyhow when the app is updated. --- .../com/battlelancer/seriesguide/SgApp.kt | 5 ----- .../seriesguide/util/AppUpgrade.kt | 21 ------------------- 2 files changed, 26 deletions(-) diff --git a/app/src/main/java/com/battlelancer/seriesguide/SgApp.kt b/app/src/main/java/com/battlelancer/seriesguide/SgApp.kt index 6b57ec71d0..3af3253b4a 100644 --- a/app/src/main/java/com/battlelancer/seriesguide/SgApp.kt +++ b/app/src/main/java/com/battlelancer/seriesguide/SgApp.kt @@ -106,11 +106,6 @@ class SgApp : Application() { */ const val RELEASE_VERSION_40_BETA4 = 1502803 - /** - * ListWidgetProvider alarm intent is now explicit. - */ - const val RELEASE_VERSION_40_BETA6 = 1502805 - /** * For trakt and hexagon sync movies were not added in all cases, reset sync times. */ diff --git a/app/src/main/java/com/battlelancer/seriesguide/util/AppUpgrade.kt b/app/src/main/java/com/battlelancer/seriesguide/util/AppUpgrade.kt index 6053815504..5681ce6286 100644 --- a/app/src/main/java/com/battlelancer/seriesguide/util/AppUpgrade.kt +++ b/app/src/main/java/com/battlelancer/seriesguide/util/AppUpgrade.kt @@ -3,16 +3,11 @@ package com.battlelancer.seriesguide.util -import android.app.AlarmManager -import android.app.PendingIntent import android.content.Context -import android.content.Intent import androidx.core.content.edit -import androidx.core.content.getSystemService import androidx.preference.PreferenceManager import com.battlelancer.seriesguide.BuildConfig import com.battlelancer.seriesguide.SgApp -import com.battlelancer.seriesguide.appwidget.ListWidgetProvider import com.battlelancer.seriesguide.backend.settings.HexagonSettings import com.battlelancer.seriesguide.extensions.ExtensionManager import com.battlelancer.seriesguide.provider.SgRoomDatabase @@ -74,22 +69,6 @@ class AppUpgrade( ExtensionManager.get(context).setDefaultEnabledExtensions(context) } - if (lastVersion < SgApp.RELEASE_VERSION_40_BETA6) { - // cancel old widget alarm using implicit intent - val am = context.getSystemService() - if (am != null) { - val pi = PendingIntent.getBroadcast( - context, - ListWidgetProvider.REQUEST_CODE, - Intent(ListWidgetProvider.ACTION_DATA_CHANGED), - // Mutable because it was created without flags which defaulted to mutable. - PendingIntentCompat.flagMutable - ) - am.cancel(pi) - } - // new alarm is set automatically as upgrading causes app widgets to update - } - if (lastVersion != SgApp.RELEASE_VERSION_50_1 && lastVersion < SgApp.RELEASE_VERSION_51_BETA4) { // Movies were not added in all cases when syncing, so ensure they are now. From a9202182cd515a6bb69405f4ab33ffd0de4a5b93 Mon Sep 17 00:00:00 2001 From: Uwe Trottmann Date: Fri, 16 Aug 2024 08:49:24 +0200 Subject: [PATCH 2/5] AppUpgrade: log if upgrade code is running --- .../main/java/com/battlelancer/seriesguide/util/AppUpgrade.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/app/src/main/java/com/battlelancer/seriesguide/util/AppUpgrade.kt b/app/src/main/java/com/battlelancer/seriesguide/util/AppUpgrade.kt index 5681ce6286..686ecc3b8e 100644 --- a/app/src/main/java/com/battlelancer/seriesguide/util/AppUpgrade.kt +++ b/app/src/main/java/com/battlelancer/seriesguide/util/AppUpgrade.kt @@ -32,6 +32,7 @@ class AppUpgrade( */ fun upgradeIfNewVersion(): Boolean { return if (lastVersion < currentVersion) { + Timber.i("Upgrading from %d to %d", lastVersion, currentVersion) doUpgrades() // Update last version to current version PreferenceManager.getDefaultSharedPreferences(context).edit() From 25912200017ec18ec026b2e3a7b40e6976867509 Mon Sep 17 00:00:00 2001 From: Uwe Trottmann Date: Fri, 16 Aug 2024 09:41:01 +0200 Subject: [PATCH 3/5] Prepare version 2024.3.7 (21240307) --- CHANGELOG.md | 5 +++++ build.gradle.kts | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3426e26eda..c07f359e0f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,11 @@ Version 2024.3 * 🌟 Trakt: support to edit and delete (new) comments. * 🌟 Trakt: support to remove a rating. +#### 2024.3.7 +*2024-08-16* + +* 🔨 Android 14: do not crash when updating from version 40 or older. + #### 2024.3.6 *2024-07-25* diff --git a/build.gradle.kts b/build.gradle.kts index 488f21d66c..d49069c8ab 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -21,9 +21,9 @@ buildscript { // YYYY.. - like 2024.1.0 // - allows to more easily judge how old a release is // - allows multiple releases per month (though currently unlikely) - val sgVersionName by extra("2024.3.6") + val sgVersionName by extra("2024.3.7") // version 21yyrrbb -> min SDK 21, year yy, release rr, build bb - val sgVersionCode by extra(21240306) + val sgVersionCode by extra(21240307) val isCiBuild by extra { System.getenv("CI") == "true" } From 42025d61398f747772da34fa72bba3b963092f1f Mon Sep 17 00:00:00 2001 From: Uwe Trottmann Date: Thu, 25 Jul 2024 14:47:34 +0200 Subject: [PATCH 4/5] Update fragment-ktx [1.8.0 -> 1.8.2], should fix IndexOutOfBoundsException https://issuetracker.google.com/issues/342316801 --- gradle/libs.versions.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 249c24f7bd..dd5766be10 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -26,7 +26,7 @@ androidx-coordinatorlayout = "androidx.coordinatorlayout:coordinatorlayout:1.2.0 androidx-core = "androidx.core:core:1.13.1" androidx-core-ktx = "androidx.core:core-ktx:1.13.1" # https://developer.android.com/jetpack/androidx/releases/fragment -androidx-fragment = "androidx.fragment:fragment-ktx:1.8.0" +androidx-fragment = "androidx.fragment:fragment-ktx:1.8.2" androidx-lifecycle-livedata = { module = "androidx.lifecycle:lifecycle-livedata-ktx", version.ref = "androidx-lifecycle" } androidx-lifecycle-runtime = { module = "androidx.lifecycle:lifecycle-runtime-ktx", version.ref = "androidx-lifecycle" } androidx-lifecycle-viewmodel = { module = "androidx.lifecycle:lifecycle-viewmodel-ktx", version.ref = "androidx-lifecycle" } From 73bdba9310cca76dabeabc6bb84ee0ed2354dd06 Mon Sep 17 00:00:00 2001 From: Uwe Trottmann Date: Thu, 25 Jul 2024 15:01:55 +0200 Subject: [PATCH 5/5] Update activity [1.9.0 -> 1.9.1], with more predictive back fixes --- gradle/libs.versions.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index dd5766be10..903b995d8f 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -11,7 +11,7 @@ retrofit2 = "2.11.0" # https://github.com/square/retrofit/blob/master/CHANGELOG. amazon-appstore-sdk = "com.amazon.device:amazon-appstore-sdk:3.0.5" # https://developer.amazon.com/docs/in-app-purchasing/iap-whats-new.html androidutils = "com.uwetrottmann.androidutils:androidutils:4.0.0" # https://github.com/UweTrottmann/AndroidUtils/releases # https://developer.android.com/jetpack/androidx/releases/activity -androidx-activity = "androidx.activity:activity:1.9.0" +androidx-activity = "androidx.activity:activity:1.9.1" # https://developer.android.com/jetpack/androidx/releases/annotation androidx-annotation = "androidx.annotation:annotation:1.8.0" # https://developer.android.com/jetpack/androidx/releases/appcompat @@ -120,7 +120,7 @@ compose = "androidx.compose:compose-bom:2024.06.00" compose-material3 = { module = "androidx.compose.material3:material3" } compose-tooling = { module = "androidx.compose.ui:ui-tooling" } compose-tooling-preview = { module = "androidx.compose.ui:ui-tooling-preview" } -androidx-activity-compose = "androidx.activity:activity-compose:1.9.0" +androidx-activity-compose = "androidx.activity:activity-compose:1.9.1" androidx-lifecycle-compose = { module = "androidx.lifecycle:lifecycle-viewmodel-compose", version.ref = "androidx-lifecycle" } [plugins]