Handle uncaught exceptions in BackupHandler
Bug: 144431410
Test: 1. atest BackupHandlerTest
2. Manual (with and without the fix):
1) Locally create a host-side CTS test that extends
BaseMultiUserBackupHostSideTest
2) Modify the test so that it creates a user, starts backup
init and removes the user
3) Add log in BackupHandler to indicate when an exception is
suppressed.
3) If the fix is applied, verify the crash doesn't happen and
the log message from 3) is present. If the fix isn't applied
verify that the crash happens.
After backup service for a user is stopped, leftover work on the
corresponding BackupHandler can throw exceptions. If uncaught, they
can crash the system process. Catch all uncaught BackupHandler
exceptions after the backup service has entered the stopping state, to
allow any leftover work to finish harmlessly.
Change-Id: I8c233ad0e117ec0ae65599a762d87f15f8a3cec2
2 files changed