• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright 2024 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.server.input;
18 
19 import com.android.internal.util.DataClass;
20 import com.android.tools.r8.keepanno.annotations.KeepItemKind;
21 import com.android.tools.r8.keepanno.annotations.UsedByNative;
22 
23 /**
24  * This class represents the Touchpad Finger State of a single contact on the touchpad.
25  * It is used for the touchpad visualizer project at TouchpadDebugActivity
26  */
27 @DataClass(genToString = true)
28 @UsedByNative(
29         description = "Called from JNI in jni/com_android_server_input_InputManagerService.cpp",
30         kind = KeepItemKind.CLASS_AND_MEMBERS)
31 public final class TouchpadFingerState{
32     /**
33      * The large radius of the ellipse of the finger touching the pad.
34      */
35     private final float mTouchMajor;
36 
37     /**
38      * The small radius of the ellipse of the finger touching the pad.
39      */
40     private final float mTouchMinor;
41 
42     /**
43      * The large radius of the ellipse of the finger, including parts
44      * that are hovering over the pad but not quite touching.
45      */
46     private final float mWidthMajor;
47 
48     /**
49      * The small radius of the ellipse of the finger, including parts
50      * that are hovering over the pad but not quite touching.
51      */
52     private final float mWidthMinor;
53 
54     /**
55      * Pressure applied by a finger on the touchpad.
56      */
57     private final float mPressure;
58 
59     /**
60      * Orientation of a finger on the touchpad. Measured in radians.
61      */
62     private final float mOrientation;
63 
64     /**
65      * The X-coordinate of the center of the ellipse that represents a finger.
66      */
67     private final float mPositionX;
68 
69     /**
70      * The Y-coordinate of the center of the ellipse that represents a finger.
71      */
72     private final float mPositionY;
73 
74     /**
75      * A number that identifies a single physical finger across consecutive frames.
76      * If a finger is the same physical finger across two consecutive frames, it
77      * must have the same tracking ID; if it's a different finger, it should
78      * have a different tracking ID.
79      */
80     private final int mTrackingId;
81 
82 
83     // Code below generated by codegen v1.0.23.
84     //
85     // DO NOT MODIFY!
86     // CHECKSTYLE:OFF Generated code
87     //
88     // To regenerate run:
89     // $ codegen $ANDROID_BUILD_TOP/frameworks/base/services/core/java/com/android/server/input/
90     // TouchpadFingerState.java
91     //
92     // To exclude the generated code from IntelliJ auto-formatting enable (one-time):
93     //   Settings > Editor > Code Style > Formatter Control
94     //@formatter:off
95 
96     /**
97      * Creates a new TouchpadFingerState.
98      *
99      * @param touchMajor
100      *   The large radius of the ellipse of the finger touching the pad.
101      * @param touchMinor
102      *   The small radius of the ellipse of the finger touching the pad.
103      * @param widthMajor
104      *   The large radius of the ellipse of the finger, including parts
105      *   that are hovering over the pad but not quite touching.
106      * @param widthMinor
107      *   The small radius of the ellipse of the finger, including parts
108      *   that are hovering over the pad but not quite touching.
109      * @param pressure
110      *   Pressure applied by a finger on the touchpad.
111      * @param orientation
112      *   Orientation of a finger on the touchpad. Measured in radians.
113      * @param positionX
114      *   The X-coordinate of the center of the ellipse that represents a finger.
115      * @param positionY
116      *   The Y-coordinate of the center of the ellipse that represents a finger.
117      * @param trackingId
118      *   A number that identifies a single physical finger across consecutive frames.
119      *   If a finger is the same physical finger across two consecutive frames, it
120      *   must have the same tracking ID; if it's a different finger, it should
121      *   have a different tracking ID.
122      */
123     @DataClass.Generated.Member
TouchpadFingerState( float touchMajor, float touchMinor, float widthMajor, float widthMinor, float pressure, float orientation, float positionX, float positionY, int trackingId)124     public TouchpadFingerState(
125             float touchMajor,
126             float touchMinor,
127             float widthMajor,
128             float widthMinor,
129             float pressure,
130             float orientation,
131             float positionX,
132             float positionY,
133             int trackingId) {
134         this.mTouchMajor = touchMajor;
135         this.mTouchMinor = touchMinor;
136         this.mWidthMajor = widthMajor;
137         this.mWidthMinor = widthMinor;
138         this.mPressure = pressure;
139         this.mOrientation = orientation;
140         this.mPositionX = positionX;
141         this.mPositionY = positionY;
142         this.mTrackingId = trackingId;
143 
144         // onConstructed(); // You can define this method to get a callback
145     }
146 
147     /**
148      * The large radius of the ellipse of the finger touching the pad.
149      */
150     @DataClass.Generated.Member
getTouchMajor()151     public float getTouchMajor() {
152         return mTouchMajor;
153     }
154 
155     /**
156      * The small radius of the ellipse of the finger touching the pad.
157      */
158     @DataClass.Generated.Member
getTouchMinor()159     public float getTouchMinor() {
160         return mTouchMinor;
161     }
162 
163     /**
164      * The large radius of the ellipse of the finger, including parts
165      * that are hovering over the pad but not quite touching.
166      */
167     @DataClass.Generated.Member
getWidthMajor()168     public float getWidthMajor() {
169         return mWidthMajor;
170     }
171 
172     /**
173      * The small radius of the ellipse of the finger, including parts
174      * that are hovering over the pad but not quite touching.
175      */
176     @DataClass.Generated.Member
getWidthMinor()177     public float getWidthMinor() {
178         return mWidthMinor;
179     }
180 
181     /**
182      * Pressure applied by a finger on the touchpad.
183      */
184     @DataClass.Generated.Member
getPressure()185     public float getPressure() {
186         return mPressure;
187     }
188 
189     /**
190      * Orientation of a finger on the touchpad. Measured in radians.
191      */
192     @DataClass.Generated.Member
getOrientation()193     public float getOrientation() {
194         return mOrientation;
195     }
196 
197     /**
198      * The X-coordinate of the center of the ellipse that represents a finger.
199      */
200     @DataClass.Generated.Member
getPositionX()201     public float getPositionX() {
202         return mPositionX;
203     }
204 
205     /**
206      * The Y-coordinate of the center of the ellipse that represents a finger.
207      */
208     @DataClass.Generated.Member
getPositionY()209     public float getPositionY() {
210         return mPositionY;
211     }
212 
213     /**
214      * A number that identifies a single physical finger across consecutive frames.
215      * If a finger is the same physical finger across two consecutive frames, it
216      * must have the same tracking ID; if it's a different finger, it should
217      * have a different tracking ID.
218      */
219     @DataClass.Generated.Member
getTrackingId()220     public int getTrackingId() {
221         return mTrackingId;
222     }
223 
224     @Override
225     @DataClass.Generated.Member
toString()226     public String toString() {
227         // You can override field toString logic by defining methods like:
228         // String fieldNameToString() { ... }
229 
230         return "TouchpadFingerState { " +
231                 "touchMajor = " + mTouchMajor + ", " +
232                 "touchMinor = " + mTouchMinor + ", " +
233                 "widthMajor = " + mWidthMajor + ", " +
234                 "widthMinor = " + mWidthMinor + ", " +
235                 "pressure = " + mPressure + ", " +
236                 "orientation = " + mOrientation + ", " +
237                 "positionX = " + mPositionX + ", " +
238                 "positionY = " + mPositionY + ", " +
239                 "trackingId = " + mTrackingId +
240         " }";
241     }
242 
243     @DataClass.Generated(
244             time = 1724078820706L,
245             codegenVersion = "1.0.23",
246             sourceFile = "frameworks/base/services/core/java/com/android/server/input/"
247                     + "TouchpadFingerState.java",
248             inputSignatures = "private final  float mTouchMajor\nprivate final  float mTouchMinor\n"
249                     + "private final  float mWidthMajor\nprivate final  float mWidthMinor\nprivate"
250                     + " final  float mPressure\nprivate final  float mOrientation\nprivate final  "
251                     + "float mPositionX\nprivate final  float mPositionY\nprivate final  int "
252                     + "mTrackingId\nclass TouchpadFingerState extends java.lang.Object implements"
253                     + " []\n@com.android.internal.util.DataClass(genToString=true)")
254     @Deprecated
__metadata()255     private void __metadata() {}
256 
257 
258     //@formatter:on
259     // End of generated code
260 
261 }
262