diff --git a/CHANGELOG.md b/CHANGELOG.md index 2934f0d24f..62466cbf04 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -45,6 +45,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/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..686ecc3b8e 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 @@ -37,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() @@ -74,22 +70,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.