1 /* 2 * Copyright (C) 2020 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package com.android.systemui.classifier; 18 19 import android.view.MotionEvent; 20 21 /** 22 * Defines a class that can be used to ingest system events for later processing. 23 */ 24 public interface FalsingCollector { 25 /** */ onSuccessfulUnlock()26 void onSuccessfulUnlock(); 27 28 /** */ onNotificationActive()29 void onNotificationActive(); 30 31 /** */ setShowingAod(boolean showingAod)32 void setShowingAod(boolean showingAod); 33 34 /** */ onNotificationStartDraggingDown()35 void onNotificationStartDraggingDown(); 36 37 /** */ onNotificationStopDraggingDown()38 void onNotificationStopDraggingDown(); 39 40 /** */ setNotificationExpanded()41 void setNotificationExpanded(); 42 43 /** */ onQsDown()44 void onQsDown(); 45 46 /** */ setQsExpanded(boolean expanded)47 void setQsExpanded(boolean expanded); 48 49 /** */ shouldEnforceBouncer()50 boolean shouldEnforceBouncer(); 51 52 /** */ onTrackingStarted(boolean secure)53 void onTrackingStarted(boolean secure); 54 55 /** */ onTrackingStopped()56 void onTrackingStopped(); 57 58 /** */ onLeftAffordanceOn()59 void onLeftAffordanceOn(); 60 61 /** */ onCameraOn()62 void onCameraOn(); 63 64 /** */ onAffordanceSwipingStarted(boolean rightCorner)65 void onAffordanceSwipingStarted(boolean rightCorner); 66 67 /** */ onAffordanceSwipingAborted()68 void onAffordanceSwipingAborted(); 69 70 /** */ onStartExpandingFromPulse()71 void onStartExpandingFromPulse(); 72 73 /** */ onExpansionFromPulseStopped()74 void onExpansionFromPulseStopped(); 75 76 /** */ onScreenOnFromTouch()77 void onScreenOnFromTouch(); 78 79 /** */ isReportingEnabled()80 boolean isReportingEnabled(); 81 82 /** */ onUnlockHintStarted()83 void onUnlockHintStarted(); 84 85 /** */ onCameraHintStarted()86 void onCameraHintStarted(); 87 88 /** */ onLeftAffordanceHintStarted()89 void onLeftAffordanceHintStarted(); 90 91 /** */ onScreenTurningOn()92 void onScreenTurningOn(); 93 94 /** */ onScreenOff()95 void onScreenOff(); 96 97 /** */ onNotificationStopDismissing()98 void onNotificationStopDismissing(); 99 100 /** */ onNotificationDismissed()101 void onNotificationDismissed(); 102 103 /** */ onNotificationStartDismissing()104 void onNotificationStartDismissing(); 105 106 /** */ onNotificationDoubleTap(boolean accepted, float dx, float dy)107 void onNotificationDoubleTap(boolean accepted, float dx, float dy); 108 109 /** */ onBouncerShown()110 void onBouncerShown(); 111 112 /** */ onBouncerHidden()113 void onBouncerHidden(); 114 115 /** 116 * Call this to record a MotionEvent in the {@link com.android.systemui.plugins.FalsingManager}. 117 * 118 * Be sure to call {@link #onMotionEventComplete()} after the rest of SystemUI is done with the 119 * MotionEvent. 120 */ onTouchEvent(MotionEvent ev)121 void onTouchEvent(MotionEvent ev); 122 123 /** 124 * Call this once SystemUI has completed all processing of a given MotionEvent. 125 * 126 * See {@link #onTouchEvent(MotionEvent)}. 127 */ onMotionEventComplete()128 void onMotionEventComplete(); 129 130 /** */ avoidGesture()131 void avoidGesture(); 132 133 /** */ cleanup()134 void cleanup(); 135 136 /** */ updateFalseConfidence(FalsingClassifier.Result result)137 void updateFalseConfidence(FalsingClassifier.Result result); 138 } 139 140