Skip to content

Commit 67ad368

Browse files
author
John Spurlock
committed
Disable assist gesture when keyguard is active
Prevent search gesture from firing when keyguard is in restricted input mode, e.g. in Emergency Dialer. Also disable the Home touch listener in this mode to avoid bringing up the ring. Affects both phone and tablets. Bug: 6723749 Change-Id: I60f0aebfcce4cf7f66798ee1212ea326bdad3ef0
1 parent b6d148d commit 67ad368

File tree

4 files changed

+9
-3
lines changed

4 files changed

+9
-3
lines changed

packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -953,4 +953,9 @@ protected boolean showNotificationEvenIfUnprovisioned(StatusBarNotification sbn)
953953
}
954954
return false;
955955
}
956+
957+
public boolean inKeyguardRestrictedInputMode() {
958+
KeyguardManager km = (KeyguardManager) mContext.getSystemService(Context.KEYGUARD_SERVICE);
959+
return km.inKeyguardRestrictedInputMode();
960+
}
956961
}

packages/SystemUI/src/com/android/systemui/statusbar/DelegateViewHelper.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@ public void setBar(BaseStatusBar phoneStatusBar) {
4848
}
4949

5050
public boolean onInterceptTouchEvent(MotionEvent event) {
51-
if (mSourceView == null || mDelegateView == null || mBar.shouldDisableNavbarGestures()) {
51+
if (mSourceView == null || mDelegateView == null
52+
|| mBar.shouldDisableNavbarGestures() || mBar.inKeyguardRestrictedInputMode()) {
5253
return false;
5354
}
5455

packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -608,7 +608,7 @@ public void run() {
608608
public boolean onTouch(View v, MotionEvent event) {
609609
switch(event.getAction()) {
610610
case MotionEvent.ACTION_DOWN:
611-
if (!shouldDisableNavbarGestures()) {
611+
if (!shouldDisableNavbarGestures() && !inKeyguardRestrictedInputMode()) {
612612
mHandler.removeCallbacks(mShowSearchPanel);
613613
mHandler.postDelayed(mShowSearchPanel, mShowSearchHoldoff);
614614
}

packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ public void run() {
201201
public boolean onTouch(View v, MotionEvent event) {
202202
switch(event.getAction()) {
203203
case MotionEvent.ACTION_DOWN:
204-
if (!shouldDisableNavbarGestures()) {
204+
if (!shouldDisableNavbarGestures() && !inKeyguardRestrictedInputMode()) {
205205
mHandler.removeCallbacks(mShowSearchPanel);
206206
mHandler.postDelayed(mShowSearchPanel, mShowSearchHoldoff);
207207
}

0 commit comments

Comments
 (0)