Close databases in onStop user
The key is evicted before onCleanup. To be safe we should close db in
onStopUser while the key is still available
Test: switch to u10, switch to u0, am stop-user 10, am switch-user 10
Bug: 37781320
Change-Id: Iab18c503a236a15833974b0dad2af6eed86a6c02
diff --git a/services/core/java/com/android/server/accounts/AccountManagerService.java b/services/core/java/com/android/server/accounts/AccountManagerService.java
index 03da5b2..2bd55e2 100644
--- a/services/core/java/com/android/server/accounts/AccountManagerService.java
+++ b/services/core/java/com/android/server/accounts/AccountManagerService.java
@@ -158,8 +158,8 @@
}
@Override
- public void onCleanupUser(int userHandle) {
- mService.onCleanupUser(userHandle);
+ public void onStopUser(int userHandle) {
+ mService.onStopUser(userHandle);
}
}
@@ -1360,8 +1360,8 @@
}
- private void onCleanupUser(int userId) {
- Log.i(TAG, "onCleanupUser " + userId);
+ private void onStopUser(int userId) {
+ Log.i(TAG, "onStopUser " + userId);
UserAccounts accounts;
synchronized (mUsers) {
accounts = mUsers.get(userId);