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
This commit is contained in:
John Spurlock
2012-06-26 17:42:00 -04:00
parent b6d148d02a
commit 67ad368d4d
4 changed files with 9 additions and 3 deletions

View File

@@ -953,4 +953,9 @@ public abstract class BaseStatusBar extends SystemUI implements
}
return false;
}
public boolean inKeyguardRestrictedInputMode() {
KeyguardManager km = (KeyguardManager) mContext.getSystemService(Context.KEYGUARD_SERVICE);
return km.inKeyguardRestrictedInputMode();
}
}

View File

@@ -48,7 +48,8 @@ public class DelegateViewHelper {
}
public boolean onInterceptTouchEvent(MotionEvent event) {
if (mSourceView == null || mDelegateView == null || mBar.shouldDisableNavbarGestures()) {
if (mSourceView == null || mDelegateView == null
|| mBar.shouldDisableNavbarGestures() || mBar.inKeyguardRestrictedInputMode()) {
return false;
}

View File

@@ -608,7 +608,7 @@ public class PhoneStatusBar extends BaseStatusBar {
public boolean onTouch(View v, MotionEvent event) {
switch(event.getAction()) {
case MotionEvent.ACTION_DOWN:
if (!shouldDisableNavbarGestures()) {
if (!shouldDisableNavbarGestures() && !inKeyguardRestrictedInputMode()) {
mHandler.removeCallbacks(mShowSearchPanel);
mHandler.postDelayed(mShowSearchPanel, mShowSearchHoldoff);
}

View File

@@ -201,7 +201,7 @@ public class TabletStatusBar extends BaseStatusBar implements
public boolean onTouch(View v, MotionEvent event) {
switch(event.getAction()) {
case MotionEvent.ACTION_DOWN:
if (!shouldDisableNavbarGestures()) {
if (!shouldDisableNavbarGestures() && !inKeyguardRestrictedInputMode()) {
mHandler.removeCallbacks(mShowSearchPanel);
mHandler.postDelayed(mShowSearchPanel, mShowSearchHoldoff);
}