Refactor parts of FalsingManager into FalsingCollector
This CL separates out the two roles of the FalsingManager. It
introduces the FalsingCollector, used by SystemUI to report events
that may be interesting to Falsing, such as touch events, sensor
events, and general user actions.
The FalsingManager, meanwhile, continues to support the methods
This helps breakup the monolithic FalsingManger into more manageable
pieces, reducing the API surface area of FalsingManager significantly.
Bug: 172655679
Test: atest SystemUITests && manual
Change-Id: I92f8e3747f5c4a04eaa64e1a8b626c2a07c480aa
diff --git a/packages/SystemUI/plugin/Android.bp b/packages/SystemUI/plugin/Android.bp
index df5561a..ab4f800 100644
--- a/packages/SystemUI/plugin/Android.bp
+++ b/packages/SystemUI/plugin/Android.bp
@@ -19,7 +19,8 @@
srcs: ["src/**/*.java"],
static_libs: [
- "PluginCoreLib"
+ "PluginCoreLib",
+ "SystemUI-sensors",
],
}
diff --git a/packages/SystemUI/plugin/src/com/android/systemui/plugins/FalsingManager.java b/packages/SystemUI/plugin/src/com/android/systemui/plugins/FalsingManager.java
index 0f94bca..6e86f26 100644
--- a/packages/SystemUI/plugin/src/com/android/systemui/plugins/FalsingManager.java
+++ b/packages/SystemUI/plugin/src/com/android/systemui/plugins/FalsingManager.java
@@ -20,6 +20,7 @@
import android.view.MotionEvent;
import com.android.systemui.plugins.annotations.ProvidesInterface;
+import com.android.systemui.util.sensors.ThresholdSensor;
import java.io.FileDescriptor;
import java.io.PrintWriter;
@@ -35,12 +36,6 @@
void onSuccessfulUnlock();
- void onNotificationActive();
-
- void setShowingAod(boolean showingAod);
-
- void onNotificatonStartDraggingDown();
-
boolean isUnlockingDisabled();
/** Returns true if the gesture should be rejected. */
@@ -82,66 +77,21 @@
*/
boolean isFalseDoubleTap();
- void onNotificatonStopDraggingDown();
-
- void setNotificationExpanded();
-
boolean isClassifierEnabled();
- void onQsDown();
-
- void setQsExpanded(boolean expanded);
-
boolean shouldEnforceBouncer();
- void onTrackingStarted(boolean secure);
-
- void onTrackingStopped();
-
- void onLeftAffordanceOn();
-
- void onCameraOn();
-
- void onAffordanceSwipingStarted(boolean rightCorner);
-
- void onAffordanceSwipingAborted();
-
- void onStartExpandingFromPulse();
-
- void onExpansionFromPulseStopped();
-
Uri reportRejectedTouch();
- void onScreenOnFromTouch();
-
boolean isReportingEnabled();
- void onUnlockHintStarted();
-
- void onCameraHintStarted();
-
- void onLeftAffordanceHintStarted();
-
- void onScreenTurningOn();
-
- void onScreenOff();
-
- void onNotificationStopDismissing();
-
- void onNotificationDismissed();
-
- void onNotificationStartDismissing();
-
- void onNotificationDoubleTap(boolean accepted, float dx, float dy);
-
- void onBouncerShown();
-
- void onBouncerHidden();
-
void onTouchEvent(MotionEvent ev, int width, int height);
/** From com.android.systemui.Dumpable. */
void dump(FileDescriptor fd, PrintWriter pw, String[] args);
void cleanup();
+
+ /** Call to report a ProximityEvent to the FalsingManager. */
+ void onProximityEvent(ThresholdSensor.ThresholdSensorEvent proximityEvent);
}