Skip to content

Commit b0ed8bd

Browse files
adampAndroid (Google) Code Review
authored andcommitted
Merge "Keyguard - prevent slider intercept when we don't want it" into jb-mr1-lockscreen-dev
2 parents 113ca64 + 995270f commit b0ed8bd

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

policy/src/com/android/internal/policy/impl/keyguard/SlidingChallengeLayout.java

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -481,6 +481,7 @@ public boolean onInterceptTouchEvent(MotionEvent ev) {
481481
switch (action) {
482482
case MotionEvent.ACTION_DOWN:
483483
mGestureStartY = ev.getY();
484+
mBlockDrag = false;
484485
break;
485486

486487
case MotionEvent.ACTION_CANCEL:
@@ -533,6 +534,11 @@ public boolean onTouchEvent(MotionEvent ev) {
533534

534535
final int action = ev.getActionMasked();
535536
switch (action) {
537+
case MotionEvent.ACTION_DOWN:
538+
mBlockDrag = false;
539+
mGestureStartY = ev.getY();
540+
break;
541+
536542
case MotionEvent.ACTION_CANCEL:
537543
if (mDragging) {
538544
showChallenge(0);
@@ -855,19 +861,17 @@ private int getChallengeBottom() {
855861
return mChallengeView.getBottom();
856862
}
857863

858-
/**
859-
* The top edge of the challenge if it were fully opened.
860-
*/
861-
private int getChallengeOpenedTop() {
862-
return getLayoutBottom() - ((mChallengeView == null) ? 0 : mChallengeView.getHeight());
863-
}
864-
865864
/**
866865
* Show or hide the challenge view, animating it if necessary.
867866
* @param show true to show, false to hide
868867
*/
869868
public void showChallenge(boolean show) {
870869
showChallenge(show, 0);
870+
if (!show) {
871+
// Block any drags in progress so that callers can use this to disable dragging
872+
// for other touch interactions.
873+
mBlockDrag = true;
874+
}
871875
}
872876

873877
private void showChallenge(int velocity) {

0 commit comments

Comments
 (0)