Skip to content

Commit

Permalink
Merge branch 'fix-release-2024.3.7' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
UweTrottmann committed Aug 16, 2024
2 parents a316fcd + 73bdba9 commit 9395063
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 26 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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*

Expand Down
5 changes: 0 additions & 5 deletions app/src/main/java/com/battlelancer/seriesguide/SgApp.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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()
Expand Down Expand Up @@ -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<AlarmManager>()
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.
Expand Down

0 comments on commit 9395063

Please sign in to comment.