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