Correctly report package index in RestoreObserver#onUpdate calls
PerformUnifiedRestoreTask uses the `RestoreObserver` to report its
progress as it restores packages. The `onUpdate` method takes two
parameters: the package index and the package name.
PerformUnifiedRestoreTask keeps track of the package index by counting
the number of packages being restored. The count was only incremented
after successfully restoring a key-value app. This meant that the wrong
package index was reported when a key-value app was not restored (e.g.
when it was skipped, or the restore failed), or when a non-key-value app
was restored.
This change fixes that by incrementing the index for every package and
before the restore starts.
Bug: 291249666
Test: Manually performed a system restore (see linked bug for details)
Change-Id: I3bdb8efb3c7deab47bf801e10c42ef2e8fd29182
1 file changed