Fix the issue "Turn on work profile?" dialog not displayed for
work profile deep shortcuts when disabled.

When work profile is locked, the state change doesn't propagated
into UserManagerService immediately. This CL remove that dependency,
rather than having Launcher calls UserManager#isUserUnlocked, the state
is passed into UserLockStateChangedTask by extracting user state from
broadcasted intent at the call-site.

Bug: 147210578
Test: manual
Change-Id: I87f3d0478df44df60e273189f77b61bc40dd2630
diff --git a/src/com/android/launcher3/LauncherModel.java b/src/com/android/launcher3/LauncherModel.java
index e61b7a8..9e91e70 100644
--- a/src/com/android/launcher3/LauncherModel.java
+++ b/src/com/android/launcher3/LauncherModel.java
@@ -235,7 +235,8 @@
                 // we need to run the state change task again.
                 if (Intent.ACTION_MANAGED_PROFILE_UNAVAILABLE.equals(action) ||
                         Intent.ACTION_MANAGED_PROFILE_UNLOCKED.equals(action)) {
-                    enqueueModelUpdateTask(new UserLockStateChangedTask(user));
+                    enqueueModelUpdateTask(new UserLockStateChangedTask(
+                            user, Intent.ACTION_MANAGED_PROFILE_UNLOCKED.equals(action)));
                 }
             }
         } else if (IS_STUDIO_BUILD && ACTION_FORCE_ROLOAD.equals(action)) {