Add HistoryEvaluator
Adds the possibility to store the evaluations for previous strokes and gestures.
Also and enables to take the history into account when classifying current
interatcions.
Change-Id: Ia8fa54a00daa80b4e5aebf11b11b568ed23165d4
diff --git a/packages/SystemUI/src/com/android/systemui/classifier/FalsingManager.java b/packages/SystemUI/src/com/android/systemui/classifier/FalsingManager.java
index 347273a..c68fff8 100644
--- a/packages/SystemUI/src/com/android/systemui/classifier/FalsingManager.java
+++ b/packages/SystemUI/src/com/android/systemui/classifier/FalsingManager.java
@@ -126,11 +126,10 @@
}
/**
- * @param type the type of action for which this method is called
* @return true if the classifier determined that this is not a human interacting with the phone
*/
- public boolean isFalseTouch(int type) {
- return mHumanInteractionClassifier.getFalseTouchEvaluation(type) > 0.5;
+ public boolean isFalseTouch() {
+ return mHumanInteractionClassifier.isFalseTouch();
}
@Override
@@ -189,6 +188,7 @@
}
public void onQsDown() {
+ mHumanInteractionClassifier.setType(Classifier.QUICK_SETTINGS);
mDataCollector.onQsDown();
}
@@ -197,6 +197,7 @@
}
public void onTrackingStarted() {
+ mHumanInteractionClassifier.setType(Classifier.UNLOCK);
mDataCollector.onTrackingStarted();
}
@@ -217,6 +218,7 @@
}
public void onNotificatonStartDraggingDown() {
+ mHumanInteractionClassifier.setType(Classifier.NOTIFICATION_DRAG_DOWN);
mDataCollector.onNotificatonStartDraggingDown();
}
@@ -229,6 +231,7 @@
}
public void onNotificatonStartDismissing() {
+ mHumanInteractionClassifier.setType(Classifier.NOTIFICATION_DISMISS);
mDataCollector.onNotificatonStartDismissing();
}
@@ -245,6 +248,11 @@
}
public void onAffordanceSwipingStarted(boolean rightCorner) {
+ if (rightCorner) {
+ mHumanInteractionClassifier.setType(Classifier.RIGHT_AFFORDANCE);
+ } else {
+ mHumanInteractionClassifier.setType(Classifier.LEFT_AFFORDANCE);
+ }
mDataCollector.onAffordanceSwipingStarted(rightCorner);
}