commit | 2bc895dfe9e196366c08a437e7ea6f832eac10d0 | [log] [tgz] |
---|---|---|
author | Fyodor Kupolov <fkupolov@google.com> | Tue Dec 19 11:53:47 2017 -0800 |
committer | Fyodor Kupolov <fkupolov@google.com> | Tue Dec 19 11:53:47 2017 -0800 |
tree | 9bad9048c071f26b60c50b369aebc034ed64f75e | |
parent | f7ca81fbc99888076d56666475a33b7b1a40fbd7 [diff] [blame] |
Async handling of AMS.onUnlockUser syncSharedAccounts opens CE database and can block ActivityManager thread for 100+ ms. This operation can be offloaded to a worker thread. Test: Manual - No "AccountManagerService$Lifecycle took X ms" warnings Bug: 37579992 Change-Id: Ie517722efe37da7c6782144beccdad53b047770b
diff --git a/services/core/java/com/android/server/accounts/AccountManagerService.java b/services/core/java/com/android/server/accounts/AccountManagerService.java index 0ffc779..31aea63 100644 --- a/services/core/java/com/android/server/accounts/AccountManagerService.java +++ b/services/core/java/com/android/server/accounts/AccountManagerService.java
@@ -1406,7 +1406,7 @@ mLocalUnlockedUsers.put(userId, true); } if (userId < 1) return; - syncSharedAccounts(userId); + mHandler.post(() -> syncSharedAccounts(userId)); } private void syncSharedAccounts(int userId) {