1 /*
2  * Copyright (C) 2022 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.biometrics.udfps
18 
19 import android.view.MotionEvent
20 
21 /** Interaction event between a finger and the under-display fingerprint sensor (UDFPS). */
22 enum class InteractionEvent {
23     /**
24      * A finger entered the sensor area. This can originate from either [MotionEvent.ACTION_DOWN] or
25      * [MotionEvent.ACTION_MOVE].
26      */
27     DOWN,
28 
29     /**
30      * A finger left the sensor area. This can originate from either [MotionEvent.ACTION_UP] or
31      * [MotionEvent.ACTION_MOVE].
32      */
33     UP,
34 
35     /**
36      * The touch reporting has stopped. This corresponds to [MotionEvent.ACTION_CANCEL]. This should
37      * not be confused with [UP]. If there was a finger on the sensor, it may or may not still be on
38      * the sensor.
39      */
40     CANCEL,
41 
42     /**
43      * The interaction hasn't changed since the previous event. The can originate from any of
44      * [MotionEvent.ACTION_DOWN], [MotionEvent.ACTION_MOVE], or [MotionEvent.ACTION_UP] if one of
45      * these is true:
46      * - There was previously a finger on the sensor, and that finger is still on the sensor.
47      * - There was previously no finger on the sensor, and there still isn't.
48      */
49     UNCHANGED,
50 }
51