Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit aa74ed12 authored by Joël Stemmer's avatar Joël Stemmer
Browse files

Set `mStatus` when `dispatchNextRestore` encounters a transport error

`PerformUnifiedRestoreTask` is a state-machine that is responsible for
restoring the backups a given set of packages. At every point in this
process it's possible for a transport error to occur. This is treated as
a fatal error, immediately moving the state machine into the `FINAL`
state.

The `mStatus` variable is used to indicate the result in the
`RestoreObserver.restoreFinished` callback. A non-zero value for
`mStatus` indicates something failed during restore.

`dispatchNextRestore` is the only place in this state machine where a
transport error does not set `mStatus` to `TRANSPORT_ERROR`, even though
the state is set to `FINAL`. As a result, the `RestoreObserver` listener
is likely to wrongly assume that the restore succeeded in this
particular case.

Bug: 283932000
Test: atest services/tests/mockingservicestests/src/com/android/server/backup
Test: Manual testing with custom build that returns an error in `dispatchNextRestore`.
Change-Id: I769e8200ad4ac12b58dbb8c8181b21ff9933453a
parent 8bbff97a
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment