Check if user is unlocked when handler is executed

When the user gets unlocked we schedule a handler-runnable to do cleanup work.
This runnable might be executed after the user is already locked again.

Fixes: 28512952
Change-Id: I6c05cbc8adab699e451565d74d56ad0f9b965954
This commit is contained in:
Philip P. Moltmann
2016-04-29 12:49:22 -07:00
parent a5d3e91cef
commit efb1950263

View File

@@ -836,6 +836,8 @@ public final class PrintManagerService extends SystemService {
BackgroundThread.getHandler().post(new Runnable() {
@Override
public void run() {
if (!mUserManager.isUserUnlockingOrUnlocked(userId)) return;
UserState userState;
synchronized (mLock) {
userState = getOrCreateUserStateLocked(userId, true);