Only delete available rollbacks if packages are replaced

This accounts for the case when an update is staged and the
system server restarts. Previously, any rollbacks in the
ENABLING state were deleted in this case since the current
package versions would not match the "rolled back from" version
in the rollback. This would mean that a rollback could be
deleted even if the subsequent install was successful.

Instead, skip the package version check for ENABLING rollbacks.

Test: Stage install with rollback enabled, adb shell am restart,
      ensure the rollback is still in the enabling state
Bug: 198006738
Change-Id: I70dfde95ccf0d6a5e20144e3de7f6c8afe55c13b
1 file changed