Return from onUserUnlocked if user is no longer unlocked

User can be removed or stopped by the time broadcast is delivered.

Bug: 28582351
Change-Id: I26f1a37a1ed61694679afff458c91438ee4e78cb
diff --git a/services/appwidget/java/com/android/server/appwidget/AppWidgetServiceImpl.java b/services/appwidget/java/com/android/server/appwidget/AppWidgetServiceImpl.java
index c62689c..ac2dda3 100644
--- a/services/appwidget/java/com/android/server/appwidget/AppWidgetServiceImpl.java
+++ b/services/appwidget/java/com/android/server/appwidget/AppWidgetServiceImpl.java
@@ -2529,6 +2529,10 @@
         if (isProfileWithLockedParent(userId)) {
             return;
         }
+        if (!mUserManager.isUserUnlockingOrUnlocked(userId)) {
+            Slog.w(TAG, "User " + userId + " is no longer unlocked - exiting");
+            return;
+        }
         synchronized (mLock) {
             ensureGroupStateLoadedLocked(userId);
             reloadWidgetsMaskedStateForGroup(mSecurityPolicy.getGroupParent(userId));