summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Derek Wu <derekwu@google.com> 2024-03-25 17:05:25 +0000
committer Derek Wu <derekwu@google.com> 2024-03-25 17:14:23 +0000
commitfb7fad03c34c1f0773e9955f593ceece2c5f038e (patch)
tree57db13c1ddaa4274c4dd317e20dbbdcf883625c1
parent1af8b968a8cd93d2642d9a8bf84f23a8db9d016e (diff)
Revert "Add flag to enable jerk prediction pruning."
This reverts commit fe8bbb039dbe458b485c055bbfc6b862681809f3. Reason for revert: Performance regression: b/330854747 BUG: 330854747 Change-Id: I323b13594fd271af5f73579218fe4797ea0d6b92
-rw-r--r--libs/input/MotionPredictor.cpp13
-rw-r--r--libs/input/input_flags.aconfig7
2 files changed, 1 insertions, 19 deletions
diff --git a/libs/input/MotionPredictor.cpp b/libs/input/MotionPredictor.cpp
index e836a4c92f..c4e3ff6dee 100644
--- a/libs/input/MotionPredictor.cpp
+++ b/libs/input/MotionPredictor.cpp
@@ -22,21 +22,17 @@
#include <cmath>
#include <cstddef>
#include <cstdint>
-#include <limits>
#include <string>
#include <vector>
#include <android-base/logging.h>
#include <android-base/strings.h>
#include <android/input.h>
-#include <com_android_input_flags.h>
#include <attestation/HmacKeyManager.h>
#include <ftl/enum.h>
#include <input/TfLiteMotionPredictor.h>
-namespace input_flags = com::android::input::flags;
-
namespace android {
namespace {
@@ -201,14 +197,7 @@ std::unique_ptr<MotionEvent> MotionPredictor::predict(nsecs_t timestamp) {
// device starts to speed up, but avoids producing noisy predictions as it slows down.
break;
}
- if (input_flags::enable_jerk_prediction_pruning()) {
- // TODO(b/266747654): Stop predictions if confidence is < some threshold
- // Arbitrarily high pruning index, will correct once jerk thresholding is implemented.
- const size_t upperBoundPredictionIndex = std::numeric_limits<size_t>::max();
- if (i > upperBoundPredictionIndex) {
- break;
- }
- }
+ // TODO(b/266747654): Stop predictions if confidence is < some threshold.
const TfLiteMotionPredictorSample::Point predictedPoint =
convertPrediction(axisFrom, axisTo, predictedR[i], predictedPhi[i]);
diff --git a/libs/input/input_flags.aconfig b/libs/input/input_flags.aconfig
index c1f5e2a53b..b48b0fb924 100644
--- a/libs/input/input_flags.aconfig
+++ b/libs/input/input_flags.aconfig
@@ -128,10 +128,3 @@ flag {
description: "Enable fling scrolling to be stopped by putting a finger on the touchpad again"
bug: "281106755"
}
-
-flag {
- name: "enable_jerk_prediction_pruning"
- namespace: "input"
- description: "Enable prediction pruning based on jerk thresholds."
- bug: "266747654"
-}