Unsubscribe listeners when stopping UserBackupManagerService
Unsubscribe listeners as otherwise they schedule work on a stopped handler thread
after the user backup manager service is stopped
This also ensures that any dangling wakelocks are released when they are
garbage collected
This was already done in master in ag/8036218
Test: atest CtsBackupTestCases CtsBackupHostTestCases
Test: m RunBackupFrameworksServicesRoboTests && atest RunBackupFrameworksServicesRoboTests
Test: blaze run -- //experimental/users/nathch/py/bug_repros:repro 136264323 -m w_codechange
followed by "adb shell kill -10 pid" (where pid = "adb shell pgrep system_server") to force GC
see in logs: PowerManager: WakeLock finalized while still held: *backup*-0
Test: blaze run -- //experimental/users/nathch/py/bug_repros:repro 136264323 -m backup_w_codechange
followed by same as above
Bug: 136264323
Bug: 135261178
Change-Id: I769d750a46faa3d28634d302e0f8e18cce41a744
1 file changed