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 /** */ shouldEnforceBouncer()47 boolean shouldEnforceBouncer(); 48 49 /** */ onTrackingStarted(boolean secure)50 void onTrackingStarted(boolean secure); 51 52 /** */ onTrackingStopped()53 void onTrackingStopped(); 54 55 /** */ onLeftAffordanceOn()56 void onLeftAffordanceOn(); 57 58 /** */ onCameraOn()59 void onCameraOn(); 60 61 /** */ onAffordanceSwipingStarted(boolean rightCorner)62 void onAffordanceSwipingStarted(boolean rightCorner); 63 64 /** */ onAffordanceSwipingAborted()65 void onAffordanceSwipingAborted(); 66 67 /** */ onStartExpandingFromPulse()68 void onStartExpandingFromPulse(); 69 70 /** */ onExpansionFromPulseStopped()71 void onExpansionFromPulseStopped(); 72 73 /** */ onScreenOnFromTouch()74 void onScreenOnFromTouch(); 75 76 /** */ isReportingEnabled()77 boolean isReportingEnabled(); 78 79 /** */ onUnlockHintStarted()80 void onUnlockHintStarted(); 81 82 /** */ onCameraHintStarted()83 void onCameraHintStarted(); 84 85 /** */ onLeftAffordanceHintStarted()86 void onLeftAffordanceHintStarted(); 87 88 /** */ onScreenTurningOn()89 void onScreenTurningOn(); 90 91 /** */ onScreenOff()92 void onScreenOff(); 93 94 /** */ onNotificationStopDismissing()95 void onNotificationStopDismissing(); 96 97 /** */ onNotificationDismissed()98 void onNotificationDismissed(); 99 100 /** */ onNotificationStartDismissing()101 void onNotificationStartDismissing(); 102 103 /** */ onNotificationDoubleTap(boolean accepted, float dx, float dy)104 void onNotificationDoubleTap(boolean accepted, float dx, float dy); 105 106 /** */ onBouncerShown()107 void onBouncerShown(); 108 109 /** */ onBouncerHidden()110 void onBouncerHidden(); 111 112 /** 113 * Call this to record a MotionEvent in the {@link com.android.systemui.plugins.FalsingManager}. 114 * 115 * Be sure to call {@link #onMotionEventComplete()} after the rest of SystemUI is done with the 116 * MotionEvent. 117 */ onTouchEvent(MotionEvent ev)118 void onTouchEvent(MotionEvent ev); 119 120 /** 121 * Call this once SystemUI has completed all processing of a given MotionEvent. 122 * 123 * See {@link #onTouchEvent(MotionEvent)}. 124 */ onMotionEventComplete()125 void onMotionEventComplete(); 126 127 /** */ avoidGesture()128 void avoidGesture(); 129 130 /** */ cleanup()131 void cleanup(); 132 133 /** */ updateFalseConfidence(FalsingClassifier.Result result)134 void updateFalseConfidence(FalsingClassifier.Result result); 135 136 /** Indicates an a11y action was made. */ onA11yAction()137 void onA11yAction(); 138 } 139 140