summaryrefslogtreecommitdiff
path: root/core/java/android/inputmethodservice/InputMethodService.java
diff options
context:
space:
mode:
authorPaul Hadfield <hadfieldp@google.com>2021-12-07 16:39:32 +0000
committerPaul Hadfield <hadfieldp@google.com>2021-12-15 10:34:13 +0000
commit6118857c97474f3e3e2ab6bc59c6122afb1dd727 (patch)
treee10e49a479a010d77804970cb6da753e471b7e98 /core/java/android/inputmethodservice/InputMethodService.java
parent789acb12faf9816778a830734d8a984d2d1c6d62 (diff)
Trigger unbindBackupAgent if app dies during backup
This is to fix a bug where, if an app crashes in restricted mode, when the user restarts the app, it would be launched still in restricted mode. That happens because ActivityManager still has a BackupRecord indicating that the app should be in restricted mode, so next time the app launches, attachApplicationLocked() calls IApplicationThread.bindApplication() with the restricted mode flag set. To avoid this we must complete the clean up actions done when backup agents report errors. UserBackupManagerService has a call-back method agentDisconnected() that is notified if an agent dies. In that method we call handleCancel() on all outstanding operations that are linked to the package name, according to OperationStorage. The result is a call to the Activity Manager's unbindBackupAgent() which then removes the obsolete BackupRecord. Two new tests for agentDisconnected() verify that appropriate calls are made to OperationStore. BUG: 161089758 Test: atest FrameworksServicesTests:com.android.server.backup atest BackupFrameworksServicesRoboTests atest CtsBackupHostTestCases atest CtsBackupTestCases atest GtsBackupTestCase Also, manual testing with an app that deliberately dies during full backup: the lifecycle operation storage is used to cancel the backup; the app restarts in normal and not restricted mode. Change-Id: Ic4cf3875d59e3580b026340e884093f3aa1b09b9
Diffstat (limited to 'core/java/android/inputmethodservice/InputMethodService.java')
0 files changed, 0 insertions, 0 deletions