Merge "Ensure that FalsingManager#isFalseTap handles delayed clicks." into sc-dev
This commit is contained in:
@@ -224,7 +224,9 @@ public class BrightLineFalsingManager implements FalsingManager {
|
||||
}
|
||||
|
||||
FalsingClassifier.Result singleTapResult =
|
||||
mSingleTapClassifier.isTap(mDataProvider.getRecentMotionEvents());
|
||||
mSingleTapClassifier.isTap(mDataProvider.getRecentMotionEvents().isEmpty()
|
||||
? mDataProvider.getPriorMotionEvents()
|
||||
: mDataProvider.getRecentMotionEvents());
|
||||
mPriorResults = Collections.singleton(singleTapResult);
|
||||
|
||||
if (!singleTapResult.isFalse() && robustCheck) {
|
||||
|
||||
@@ -276,7 +276,9 @@ public abstract class QSTileImpl<TState extends State> implements QSTile, Lifecy
|
||||
mUiEventLogger.logWithInstanceId(QSEvent.QS_ACTION_CLICK, 0, getMetricsSpec(),
|
||||
getInstanceId());
|
||||
mQSLogger.logTileClick(mTileSpec, mStatusBarStateController.getState(), mState.state);
|
||||
mHandler.sendEmptyMessage(H.CLICK);
|
||||
if (!mFalsingManager.isFalseTap(true, 0.1)) {
|
||||
mHandler.sendEmptyMessage(H.CLICK);
|
||||
}
|
||||
}
|
||||
|
||||
public void secondaryClick() {
|
||||
@@ -605,9 +607,7 @@ public abstract class QSTileImpl<TState extends State> implements QSTile, Lifecy
|
||||
mContext, mEnforcedAdmin);
|
||||
mActivityStarter.postStartActivityDismissingKeyguard(intent, 0);
|
||||
} else {
|
||||
if (!mFalsingManager.isFalseTap(true, 0.1)) {
|
||||
handleClick();
|
||||
}
|
||||
handleClick();
|
||||
}
|
||||
} else if (msg.what == SECONDARY_CLICK) {
|
||||
name = "handleSecondaryClick";
|
||||
|
||||
@@ -179,6 +179,17 @@ public class BrightLineClassifierTest extends SysuiTestCase {
|
||||
assertThat(mBrightLineFalsingManager.isFalseTap(false, 0)).isFalse();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testIsFalseTap_EmptyRecentEvents() {
|
||||
// Ensure we look at prior events if recent events has already been emptied.
|
||||
when(mFalsingDataProvider.getRecentMotionEvents()).thenReturn(new ArrayList<>());
|
||||
when(mFalsingDataProvider.getPriorMotionEvents()).thenReturn(mMotionEventList);
|
||||
|
||||
mBrightLineFalsingManager.isFalseTap(false, 0);
|
||||
verify(mSingleTapClassfier).isTap(mMotionEventList);
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void testIsFalseTap_RobustCheck_NoFaceAuth() {
|
||||
when(mSingleTapClassfier.isTap(mMotionEventList)).thenReturn(mPassedResult);
|
||||
|
||||
Reference in New Issue
Block a user