blob: 0e7c65a8165db41c59ce93516e0b4bd6633caa47 [file] [log] [blame]
Dave Mankoffdde5ee62019-05-02 17:36:11 -04001/*
2 * Copyright (C) 2015 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
17package com.android.systemui.classifier;
18
19import android.content.Context;
20import android.net.Uri;
21import android.view.MotionEvent;
22
23import java.io.PrintWriter;
24
25/**
26 * When the phone is locked, listens to touch, sensor and phone events and sends them to
27 * DataCollector and HumanInteractionClassifier.
28 *
29 * It does not collect touch events when the bouncer shows up.
30 */
31public class FalsingManagerFactory {
32 private static FalsingManager sInstance = null;
33
34 private FalsingManagerFactory() {}
35
36 public static FalsingManager getInstance(Context context) {
37 if (sInstance == null) {
38 sInstance = new FalsingManagerImpl(context);
39 }
40 return sInstance;
41 }
42
43 public interface FalsingManager {
44 void onSucccessfulUnlock();
45
46 void onNotificationActive();
47
48 void setShowingAod(boolean showingAod);
49
50 void onNotificatonStartDraggingDown();
51
52 boolean isUnlockingDisabled();
53
54 boolean isFalseTouch();
55
56 void onNotificatonStopDraggingDown();
57
58 void setNotificationExpanded();
59
60 boolean isClassiferEnabled();
61
62 void onQsDown();
63
64 void setQsExpanded(boolean expanded);
65
66 boolean shouldEnforceBouncer();
67
68 void onTrackingStarted(boolean secure);
69
70 void onTrackingStopped();
71
72 void onLeftAffordanceOn();
73
74 void onCameraOn();
75
76 void onAffordanceSwipingStarted(boolean rightCorner);
77
78 void onAffordanceSwipingAborted();
79
80 void onStartExpandingFromPulse();
81
82 void onExpansionFromPulseStopped();
83
84 Uri reportRejectedTouch();
85
86 void onScreenOnFromTouch();
87
88 boolean isReportingEnabled();
89
90 void onUnlockHintStarted();
91
92 void onCameraHintStarted();
93
94 void onLeftAffordanceHintStarted();
95
96 void onScreenTurningOn();
97
98 void onScreenOff();
99
100 void onNotificatonStopDismissing();
101
102 void onNotificationDismissed();
103
104 void onNotificatonStartDismissing();
105
106 void onNotificationDoubleTap(boolean accepted, float dx, float dy);
107
108 void onBouncerShown();
109
110 void onBouncerHidden();
111
112 void onTouchEvent(MotionEvent ev, int width, int height);
113
114 void dump(PrintWriter pw);
115 }
116}