diff options
author | Chiao Cheng <chiaocheng@google.com> | 2013-11-14 12:31:02 -0800 |
---|---|---|
committer | Chiao Cheng <chiaocheng@google.com> | 2013-11-14 12:31:02 -0800 |
commit | 21256c08138c6700e47d7ea0517ecd001d681644 (patch) | |
tree | fa85d154aea8b440a3aa0a158e22752ce080a111 /InCallUI/src/com/android/incallui/InCallActivity.java | |
parent | e5bd978b0400f6bcf2267fe0ee4765c5214074a5 (diff) |
Add logic to dynamic dismiss keyguard.
If the user rejects or misses call, keyguard should not be dismissed. Check for
active or outgoing call.
Bug: 11580109
Change-Id: I1d83041d38ae60dd835bb967ae307791b605cf21
Diffstat (limited to 'InCallUI/src/com/android/incallui/InCallActivity.java')
-rw-r--r-- | InCallUI/src/com/android/incallui/InCallActivity.java | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/InCallUI/src/com/android/incallui/InCallActivity.java b/InCallUI/src/com/android/incallui/InCallActivity.java index 64e856c93..08a8f12d0 100644 --- a/InCallUI/src/com/android/incallui/InCallActivity.java +++ b/InCallUI/src/com/android/incallui/InCallActivity.java @@ -62,10 +62,11 @@ public class InCallActivity extends Activity { // set this flag so this activity will stay in front of the keyguard // Have the WindowManager filter out touch events that are "too fat". - getWindow().addFlags(WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED + int flags = WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED | WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON - | WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD - | WindowManager.LayoutParams.FLAG_IGNORE_CHEEK_PRESSES); + | WindowManager.LayoutParams.FLAG_IGNORE_CHEEK_PRESSES; + + getWindow().addFlags(flags); requestWindowFeature(Window.FEATURE_NO_TITLE); @@ -388,6 +389,14 @@ public class InCallActivity extends Activity { mCallButtonFragment.displayDialpad(false); } + public void dismissKeyguard(boolean dismiss) { + if (dismiss) { + getWindow().addFlags(WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD); + } else { + getWindow().clearFlags(WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD); + } + } + public void displayDialpad(boolean showDialpad) { if (showDialpad) { mDialpadFragment.setVisible(true); |