summaryrefslogtreecommitdiffstats
path: root/packages
diff options
context:
space:
mode:
authorJim Miller <jaggies@google.com>2013-10-03 21:27:17 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2013-10-03 21:27:17 -0700
commit3efc75acce4c77c5ef62e6ff6ac57410ec53bde7 (patch)
tree086e653c637774b750583e69770475c37d7767a7 /packages
parent049e663c3bedda1b86d9276eaf660ba8571e375b (diff)
parentfea784ddec162951e95e91010b25ffb65fe704db (diff)
downloadframeworks_base-3efc75acce4c77c5ef62e6ff6ac57410ec53bde7.zip
frameworks_base-3efc75acce4c77c5ef62e6ff6ac57410ec53bde7.tar.gz
frameworks_base-3efc75acce4c77c5ef62e6ff6ac57410ec53bde7.tar.bz2
am fea784dd: Merge "Fix bug where dismiss() was being called from the wrong thread" into klp-dev
* commit 'fea784ddec162951e95e91010b25ffb65fe704db': Fix bug where dismiss() was being called from the wrong thread
Diffstat (limited to 'packages')
-rw-r--r--packages/Keyguard/src/com/android/keyguard/KeyguardViewMediator.java42
1 files changed, 24 insertions, 18 deletions
diff --git a/packages/Keyguard/src/com/android/keyguard/KeyguardViewMediator.java b/packages/Keyguard/src/com/android/keyguard/KeyguardViewMediator.java
index ec3eb15..dc28bd0 100644
--- a/packages/Keyguard/src/com/android/keyguard/KeyguardViewMediator.java
+++ b/packages/Keyguard/src/com/android/keyguard/KeyguardViewMediator.java
@@ -124,6 +124,7 @@ public class KeyguardViewMediator {
private static final int SHOW_ASSISTANT = 14;
private static final int DISPATCH_EVENT = 15;
private static final int LAUNCH_CAMERA = 16;
+ private static final int DISMISS = 17;
/**
* The default amount of time we stay awake (used for all key input)
@@ -910,12 +911,16 @@ public class KeyguardViewMediator {
/**
* Dismiss the keyguard through the security layers.
*/
- public void dismiss() {
+ public void handleDismiss() {
if (mShowing && !mHidden) {
mKeyguardViewManager.dismiss();
}
}
+ public void dismiss() {
+ mHandler.sendEmptyMessage(DISMISS);
+ }
+
/**
* Send message to keyguard telling it to reset its state.
* @param options options about how to show the keyguard
@@ -1014,14 +1019,13 @@ public class KeyguardViewMediator {
};
public void keyguardDone(boolean authenticated, boolean wakeup) {
- mKeyguardDonePending = false;
+ if (DEBUG) Log.d(TAG, "keyguardDone(" + authenticated + ")");
+ EventLog.writeEvent(70000, 2);
synchronized (this) {
- EventLog.writeEvent(70000, 2);
- if (DEBUG) Log.d(TAG, "keyguardDone(" + authenticated + ")");
- Message msg = mHandler.obtainMessage(KEYGUARD_DONE, authenticated ? 1 : 0,
- wakeup ? 1 : 0);
- mHandler.sendMessage(msg);
+ mKeyguardDonePending = false;
}
+ Message msg = mHandler.obtainMessage(KEYGUARD_DONE, authenticated ? 1 : 0, wakeup ? 1 : 0);
+ mHandler.sendMessage(msg);
}
/**
@@ -1037,31 +1041,31 @@ public class KeyguardViewMediator {
switch (msg.what) {
case SHOW:
handleShow((Bundle) msg.obj);
- return ;
+ break;
case HIDE:
handleHide();
- return ;
+ break;
case RESET:
handleReset((Bundle) msg.obj);
- return ;
+ break;
case VERIFY_UNLOCK:
handleVerifyUnlock();
- return;
+ break;
case NOTIFY_SCREEN_OFF:
handleNotifyScreenOff();
- return;
+ break;
case NOTIFY_SCREEN_ON:
handleNotifyScreenOn((IKeyguardShowCallback) msg.obj);
- return;
+ break;
case KEYGUARD_DONE:
handleKeyguardDone(msg.arg1 != 0, msg.arg2 != 0);
- return;
+ break;
case KEYGUARD_DONE_DRAWING:
handleKeyguardDoneDrawing();
- return;
+ break;
case KEYGUARD_DONE_AUTHENTICATING:
keyguardDone(true, true);
- return;
+ break;
case SET_HIDDEN:
handleSetHidden(msg.arg1 != 0);
break;
@@ -1079,6 +1083,9 @@ public class KeyguardViewMediator {
case LAUNCH_CAMERA:
handleLaunchCamera();
break;
+ case DISMISS:
+ handleDismiss();
+ break;
}
}
};
@@ -1178,8 +1185,7 @@ public class KeyguardViewMediator {
private void updateActivityLockScreenState() {
try {
- ActivityManagerNative.getDefault().setLockScreenShown(
- mShowing && !mHidden);
+ ActivityManagerNative.getDefault().setLockScreenShown(mShowing && !mHidden);
} catch (RemoteException e) {
}
}