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

Commit ce25ed29 authored by Fyodor Kupolov's avatar Fyodor Kupolov
Browse files

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
parent 5fafafab
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -158,8 +158,8 @@ public class AccountManagerService
        }

        @Override
        public void onCleanupUser(int userHandle) {
            mService.onCleanupUser(userHandle);
        public void onStopUser(int userHandle) {
            mService.onStopUser(userHandle);
        }
    }

@@ -1360,8 +1360,8 @@ public class AccountManagerService
    }


    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);