This repository was archived by the owner on Nov 8, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
packages/SystemUI/src/com/android/keyguard Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -119,6 +119,7 @@ public class LockIconViewController extends ViewController<LockIconView> impleme
119
119
private boolean mShowLockIcon ;
120
120
121
121
private boolean mDownDetected ;
122
+ private boolean mDetectedLongPress ;
122
123
private final Rect mSensorTouchLocation = new Rect ();
123
124
124
125
@ Inject
@@ -485,6 +486,7 @@ public void onConfigChanged(Configuration newConfig) {
485
486
private final GestureDetector mGestureDetector =
486
487
new GestureDetector (new SimpleOnGestureListener () {
487
488
public boolean onDown (MotionEvent e ) {
489
+ mDetectedLongPress = false ;
488
490
if (!isClickable ()) {
489
491
mDownDetected = false ;
490
492
return false ;
@@ -517,6 +519,7 @@ public void onLongPress(MotionEvent e) {
517
519
"lockIcon-onLongPress" ,
518
520
VIBRATION_SONIFICATION_ATTRIBUTES );
519
521
}
522
+ mDetectedLongPress = true ;
520
523
onAffordanceClick ();
521
524
}
522
525
@@ -559,7 +562,7 @@ public boolean onTouchEvent(MotionEvent event) {
559
562
// we continue to intercept all following touches until we see MotionEvent.ACTION_CANCEL UP
560
563
// or MotionEvent.ACTION_UP. this is to avoid passing the touch to NPV
561
564
// after the lock icon disappears on device entry
562
- if (mDownDetected ) {
565
+ if (mDownDetected && mDetectedLongPress ) {
563
566
if (event .getAction () == MotionEvent .ACTION_CANCEL
564
567
|| event .getAction () == MotionEvent .ACTION_UP ) {
565
568
mDownDetected = false ;
You can’t perform that action at this time.
0 commit comments