private static final int KEYGUARD_DONE = 9;
private static final int KEYGUARD_DONE_DRAWING = 10;
private static final int KEYGUARD_DONE_AUTHENTICATING = 11;
+ private static final int SET_HIDDEN = 12;
/**
* The default amount of time we stay awake (used for all key input)
*/
public void setHidden(boolean isHidden) {
if (DEBUG) Log.d(TAG, "setHidden " + isHidden);
+ mHandler.removeMessages(SET_HIDDEN);
+ Message msg = mHandler.obtainMessage(SET_HIDDEN, (isHidden ? 1 : 0), 0);
+ mHandler.sendMessage(msg);
+ }
+
+ /**
+ * Handles SET_HIDDEN message sent by setHidden()
+ */
+ private void handleSetHidden(boolean isHidden) {
synchronized (KeyguardViewMediator.this) {
- mHidden = isHidden;
- adjustUserActivityLocked();
+ if (mHidden != isHidden) {
+ mHidden = isHidden;
+ adjustUserActivityLocked();
+ }
}
}
case KEYGUARD_DONE_AUTHENTICATING:
keyguardDone(true);
return;
+ case SET_HIDDEN:
+ handleSetHidden(msg.arg1 != 0);
+ break;
}
}
};