OSDN Git Service

Lock task doesn't always end properly.
authorJason Monk <jmonk@google.com>
Wed, 20 Aug 2014 18:48:46 +0000 (14:48 -0400)
committerJason Monk <jmonk@google.com>
Wed, 20 Aug 2014 19:29:06 +0000 (15:29 -0400)
This can result in the keyguard not being re-enabled, the status
bar being in a bad state, and various other weirdness.  When a task
is going away, it needs to send the standard lock task ending
messages so that exiting the state can be handled properly.

Bug: 16010327
Change-Id: Id7ee632f4765af0af209b70fb69dd75f2e541820

services/core/java/com/android/server/am/ActivityStackSupervisor.java

index 1107139..2533d37 100644 (file)
@@ -3182,7 +3182,11 @@ public final class ActivityStackSupervisor implements DisplayListener {
 
     void endLockTaskModeIfTaskEnding(TaskRecord task) {
         if (mLockTaskModeTask != null && mLockTaskModeTask == task) {
+            final Message lockTaskMsg = Message.obtain();
+            lockTaskMsg.arg1 = mLockTaskModeTask.userId;
+            lockTaskMsg.what = LOCK_TASK_END_MSG;
             mLockTaskModeTask = null;
+            mHandler.sendMessage(lockTaskMsg);
         }
     }