To prevent the error I introduce the method restorePreviousState().
This reverts commit 1234090589.
Reason for revert: Fixing presubmit breaks
Bug: 325285743
Flag: ACONFIG narrow_grid_restore disabled
Test: BackupAndRestoreDBSelectionTest
Change-Id: I63666c29eb91dada4243af019ab0538c40bc0f78
Adding test to make sure this is the case.
Bug: 325285743
Flag: ACONFIG narrow_grid_restore disabled
Test: BackupAndRestoreDBSelectionTest
Change-Id: I84c3a92f40598137d5c5c52d34af7583b384122c