Reduce WTF for user-still-locked case

Test: boot, launch some app shortcuts
Change-Id: I8b1d604e12be3da9ebd6797828c8927a027f894e
Fix: 64939202
This commit is contained in:
Makoto Onuki
2019-10-08 13:56:10 -07:00
parent ffa0a6f4bf
commit dc801c8170

View File

@@ -1200,12 +1200,20 @@ public class ShortcutService extends IShortcutService.Stub {
return mUsers.get(userId) != null;
}
private int mLastLockedUser = -1;
/** Return the per-user state. */
@GuardedBy("mLock")
@NonNull
ShortcutUser getUserShortcutsLocked(@UserIdInt int userId) {
if (!isUserUnlockedL(userId)) {
wtf("User still locked");
// Only do wtf once for each user. (until the user is unlocked)
if (userId != mLastLockedUser) {
wtf("User still locked");
mLastLockedUser = userId;
}
} else {
mLastLockedUser = -1;
}
ShortcutUser userPackages = mUsers.get(userId);