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 android.hardware.input; 18 19 import android.annotation.NonNull; 20 import android.os.Parcel; 21 import android.os.Parcelable; 22 23 import com.android.internal.util.DataClass; 24 /** 25 * This class represents a motion sensor for input devices. 26 * 27 * @hide 28 */ 29 @DataClass( 30 genToString = true, 31 genHiddenConstructor = true, 32 genHiddenConstDefs = true) 33 public class InputSensorInfo implements Parcelable { 34 35 private @NonNull String mName; 36 private @NonNull String mVendor; 37 private int mVersion; 38 private int mHandle; 39 private int mType; 40 private float mMaxRange; 41 private float mResolution; 42 private float mPower; 43 private int mMinDelay; 44 private int mFifoReservedEventCount; 45 private int mFifoMaxEventCount; 46 private @NonNull String mStringType; 47 private @NonNull String mRequiredPermission; 48 private int mMaxDelay; 49 private int mFlags; 50 private int mId; 51 52 53 54 // Code below generated by codegen v1.0.20. 55 // 56 // DO NOT MODIFY! 57 // CHECKSTYLE:OFF Generated code 58 // 59 // To regenerate run: 60 // $ codegen $ANDROID_BUILD_TOP/frameworks/base/core/java/android/hardware/input/InputSensorInfo.java 61 // 62 // To exclude the generated code from IntelliJ auto-formatting enable (one-time): 63 // Settings > Editor > Code Style > Formatter Control 64 //@formatter:off 65 66 67 /** 68 * Creates a new InputSensorInfo. 69 * 70 * @hide 71 */ 72 @DataClass.Generated.Member InputSensorInfo( @onNull String name, @NonNull String vendor, int version, int handle, int type, float maxRange, float resolution, float power, int minDelay, int fifoReservedEventCount, int fifoMaxEventCount, @NonNull String stringType, @NonNull String requiredPermission, int maxDelay, int flags, int id)73 public InputSensorInfo( 74 @NonNull String name, 75 @NonNull String vendor, 76 int version, 77 int handle, 78 int type, 79 float maxRange, 80 float resolution, 81 float power, 82 int minDelay, 83 int fifoReservedEventCount, 84 int fifoMaxEventCount, 85 @NonNull String stringType, 86 @NonNull String requiredPermission, 87 int maxDelay, 88 int flags, 89 int id) { 90 this.mName = name; 91 com.android.internal.util.AnnotationValidations.validate( 92 NonNull.class, null, mName); 93 this.mVendor = vendor; 94 com.android.internal.util.AnnotationValidations.validate( 95 NonNull.class, null, mVendor); 96 this.mVersion = version; 97 this.mHandle = handle; 98 this.mType = type; 99 this.mMaxRange = maxRange; 100 this.mResolution = resolution; 101 this.mPower = power; 102 this.mMinDelay = minDelay; 103 this.mFifoReservedEventCount = fifoReservedEventCount; 104 this.mFifoMaxEventCount = fifoMaxEventCount; 105 this.mStringType = stringType; 106 com.android.internal.util.AnnotationValidations.validate( 107 NonNull.class, null, mStringType); 108 this.mRequiredPermission = requiredPermission; 109 com.android.internal.util.AnnotationValidations.validate( 110 NonNull.class, null, mRequiredPermission); 111 this.mMaxDelay = maxDelay; 112 this.mFlags = flags; 113 this.mId = id; 114 115 // onConstructed(); // You can define this method to get a callback 116 } 117 118 @DataClass.Generated.Member getName()119 public @NonNull String getName() { 120 return mName; 121 } 122 123 @DataClass.Generated.Member getVendor()124 public @NonNull String getVendor() { 125 return mVendor; 126 } 127 128 @DataClass.Generated.Member getVersion()129 public int getVersion() { 130 return mVersion; 131 } 132 133 @DataClass.Generated.Member getHandle()134 public int getHandle() { 135 return mHandle; 136 } 137 138 @DataClass.Generated.Member getType()139 public int getType() { 140 return mType; 141 } 142 143 @DataClass.Generated.Member getMaxRange()144 public float getMaxRange() { 145 return mMaxRange; 146 } 147 148 @DataClass.Generated.Member getResolution()149 public float getResolution() { 150 return mResolution; 151 } 152 153 @DataClass.Generated.Member getPower()154 public float getPower() { 155 return mPower; 156 } 157 158 @DataClass.Generated.Member getMinDelay()159 public int getMinDelay() { 160 return mMinDelay; 161 } 162 163 @DataClass.Generated.Member getFifoReservedEventCount()164 public int getFifoReservedEventCount() { 165 return mFifoReservedEventCount; 166 } 167 168 @DataClass.Generated.Member getFifoMaxEventCount()169 public int getFifoMaxEventCount() { 170 return mFifoMaxEventCount; 171 } 172 173 @DataClass.Generated.Member getStringType()174 public @NonNull String getStringType() { 175 return mStringType; 176 } 177 178 @DataClass.Generated.Member getRequiredPermission()179 public @NonNull String getRequiredPermission() { 180 return mRequiredPermission; 181 } 182 183 @DataClass.Generated.Member getMaxDelay()184 public int getMaxDelay() { 185 return mMaxDelay; 186 } 187 188 @DataClass.Generated.Member getFlags()189 public int getFlags() { 190 return mFlags; 191 } 192 193 @DataClass.Generated.Member getId()194 public int getId() { 195 return mId; 196 } 197 198 @Override 199 @DataClass.Generated.Member toString()200 public String toString() { 201 // You can override field toString logic by defining methods like: 202 // String fieldNameToString() { ... } 203 204 return "InputSensorInfo { " + 205 "name = " + mName + ", " + 206 "vendor = " + mVendor + ", " + 207 "version = " + mVersion + ", " + 208 "handle = " + mHandle + ", " + 209 "type = " + mType + ", " + 210 "maxRange = " + mMaxRange + ", " + 211 "resolution = " + mResolution + ", " + 212 "power = " + mPower + ", " + 213 "minDelay = " + mMinDelay + ", " + 214 "fifoReservedEventCount = " + mFifoReservedEventCount + ", " + 215 "fifoMaxEventCount = " + mFifoMaxEventCount + ", " + 216 "stringType = " + mStringType + ", " + 217 "requiredPermission = " + mRequiredPermission + ", " + 218 "maxDelay = " + mMaxDelay + ", " + 219 "flags = " + mFlags + ", " + 220 "id = " + mId + 221 " }"; 222 } 223 224 @Override 225 @DataClass.Generated.Member writeToParcel(@onNull Parcel dest, int flags)226 public void writeToParcel(@NonNull Parcel dest, int flags) { 227 // You can override field parcelling by defining methods like: 228 // void parcelFieldName(Parcel dest, int flags) { ... } 229 230 dest.writeString(mName); 231 dest.writeString(mVendor); 232 dest.writeInt(mVersion); 233 dest.writeInt(mHandle); 234 dest.writeInt(mType); 235 dest.writeFloat(mMaxRange); 236 dest.writeFloat(mResolution); 237 dest.writeFloat(mPower); 238 dest.writeInt(mMinDelay); 239 dest.writeInt(mFifoReservedEventCount); 240 dest.writeInt(mFifoMaxEventCount); 241 dest.writeString(mStringType); 242 dest.writeString(mRequiredPermission); 243 dest.writeInt(mMaxDelay); 244 dest.writeInt(mFlags); 245 dest.writeInt(mId); 246 } 247 248 @Override 249 @DataClass.Generated.Member describeContents()250 public int describeContents() { return 0; } 251 252 /** @hide */ 253 @SuppressWarnings({"unchecked", "RedundantCast"}) 254 @DataClass.Generated.Member InputSensorInfo(@onNull Parcel in)255 protected InputSensorInfo(@NonNull Parcel in) { 256 // You can override field unparcelling by defining methods like: 257 // static FieldType unparcelFieldName(Parcel in) { ... } 258 259 String name = in.readString(); 260 String vendor = in.readString(); 261 int version = in.readInt(); 262 int handle = in.readInt(); 263 int type = in.readInt(); 264 float maxRange = in.readFloat(); 265 float resolution = in.readFloat(); 266 float power = in.readFloat(); 267 int minDelay = in.readInt(); 268 int fifoReservedEventCount = in.readInt(); 269 int fifoMaxEventCount = in.readInt(); 270 String stringType = in.readString(); 271 String requiredPermission = in.readString(); 272 int maxDelay = in.readInt(); 273 int flags = in.readInt(); 274 int id = in.readInt(); 275 276 this.mName = name; 277 com.android.internal.util.AnnotationValidations.validate( 278 NonNull.class, null, mName); 279 this.mVendor = vendor; 280 com.android.internal.util.AnnotationValidations.validate( 281 NonNull.class, null, mVendor); 282 this.mVersion = version; 283 this.mHandle = handle; 284 this.mType = type; 285 this.mMaxRange = maxRange; 286 this.mResolution = resolution; 287 this.mPower = power; 288 this.mMinDelay = minDelay; 289 this.mFifoReservedEventCount = fifoReservedEventCount; 290 this.mFifoMaxEventCount = fifoMaxEventCount; 291 this.mStringType = stringType; 292 com.android.internal.util.AnnotationValidations.validate( 293 NonNull.class, null, mStringType); 294 this.mRequiredPermission = requiredPermission; 295 com.android.internal.util.AnnotationValidations.validate( 296 NonNull.class, null, mRequiredPermission); 297 this.mMaxDelay = maxDelay; 298 this.mFlags = flags; 299 this.mId = id; 300 301 // onConstructed(); // You can define this method to get a callback 302 } 303 304 @DataClass.Generated.Member 305 public static final @NonNull Parcelable.Creator<InputSensorInfo> CREATOR 306 = new Parcelable.Creator<InputSensorInfo>() { 307 @Override 308 public InputSensorInfo[] newArray(int size) { 309 return new InputSensorInfo[size]; 310 } 311 312 @Override 313 public InputSensorInfo createFromParcel(@NonNull Parcel in) { 314 return new InputSensorInfo(in); 315 } 316 }; 317 318 @DataClass.Generated( 319 time = 1605294854951L, 320 codegenVersion = "1.0.20", 321 sourceFile = "frameworks/base/core/java/android/hardware/input/InputSensorInfo.java", 322 inputSignatures = "private @android.annotation.NonNull java.lang.String mName\nprivate @android.annotation.NonNull java.lang.String mVendor\nprivate int mVersion\nprivate int mHandle\nprivate int mType\nprivate float mMaxRange\nprivate float mResolution\nprivate float mPower\nprivate int mMinDelay\nprivate int mFifoReservedEventCount\nprivate int mFifoMaxEventCount\nprivate @android.annotation.NonNull java.lang.String mStringType\nprivate @android.annotation.NonNull java.lang.String mRequiredPermission\nprivate int mMaxDelay\nprivate int mFlags\nprivate int mId\nclass InputSensorInfo extends java.lang.Object implements [android.os.Parcelable]\n@com.android.internal.util.DataClass(genToString=true, genHiddenConstructor=true, genHiddenConstDefs=true)") 323 @Deprecated __metadata()324 private void __metadata() {} 325 326 327 //@formatter:on 328 // End of generated code 329 330 } 331