Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ object AppLoadedFromBackupWorkaround {
if (AnkiDroidApp.isInitialized) {
return false
}
// TODO: Timber likely does not work on this path - maybe add a check in IntentHandler

// #7630: Can be triggered with `adb shell bmgr restore com.ichi2.anki` after AnkiDroid settings are changed.
// Application.onCreate() is not called if:
Expand All @@ -73,7 +74,10 @@ object AppLoadedFromBackupWorkaround {
Themes.setTheme(this)
// Avoids a SuperNotCalledException
activitySuperOnCreate(savedInstanceState)
finish()
// Process.killProcess is a hard kill. I suspect that some Android OSes leave has the app in
// an invalid state after this occurs (meaning Application.onCreate is not called).
// Before killProcess, gracefully kill the app, removing it from the recents list
finishAndRemoveTask()

// If we don't kill the process, the backup is not "done" and reopening the app show the same message.
Thread {
Expand Down
Loading