Skip to content

Commit

Permalink
Ensure mediaUsn survives activity restart
Browse files Browse the repository at this point in the history
  • Loading branch information
dae authored and BrayanDSO committed Oct 19, 2023
1 parent 2ebcf74 commit 24862b3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions AnkiDroid/src/main/java/com/ichi2/anki/DeckPicker.kt
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ import com.ichi2.anki.utils.timeQuantityTopDeckPicker
import com.ichi2.anki.widgets.DeckAdapter
import com.ichi2.annotations.NeedsTest
import com.ichi2.async.*
import com.ichi2.compat.CompatHelper.Companion.getSerializableCompat
import com.ichi2.compat.CompatHelper.Companion.sdkVersion
import com.ichi2.libanki.*
import com.ichi2.libanki.Collection
Expand Down Expand Up @@ -994,6 +995,7 @@ open class DeckPicker :
savedInstanceState.getString("dbRestorationPath", it.newAnkiDroidDirectory)
}
}
savedInstanceState.putSerializable("mediaUsnOnConflict", mediaUsnOnConflict)
}

public override fun onRestoreInstanceState(savedInstanceState: Bundle) {
Expand All @@ -1004,6 +1006,7 @@ open class DeckPicker :
CollectionHelper.ankiDroidDirectoryOverride = path
importColpkgListener = DatabaseRestorationListener(this, path)
}
mediaUsnOnConflict = savedInstanceState.getSerializableCompat("mediaUsnOnConflict")
}

override fun onPause() {
Expand Down

0 comments on commit 24862b3

Please sign in to comment.