| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
package android.view; |
| 18 |
|
| 19 |
import static android.view.KeyEvent.FLAG_CANCELED; |
| 20 |
import static android.view.KeyEvent.FLAG_IS_ACCESSIBILITY_EVENT; |
| 21 |
|
| 22 |
import static java.lang.annotation.RetentionPolicy.SOURCE; |
| 23 |
|
| 24 |
import android.annotation.IntDef; |
| 25 |
import android.annotation.Nullable; |
| 26 |
import android.annotation.SuppressLint; |
| 27 |
import android.os.Parcel; |
| 28 |
import android.os.Parcelable; |
| 29 |
|
| 30 |
import com.android.internal.util.DataClass; |
| 31 |
|
| 32 |
import java.lang.annotation.Retention; |
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
|
| 38 |
|
| 39 |
|
| 40 |
|
| 41 |
|
| 42 |
|
| 43 |
@DataClass(genHiddenConstructor = true, genEqualsHashCode = true) |
| 44 |
public final class VerifiedKeyEvent extends VerifiedInputEvent implements Parcelable { |
| 45 |
private static final String TAG = "VerifiedKeyEvent"; |
| 46 |
|
| 47 |
|
| 48 |
@Retention(SOURCE) |
| 49 |
@IntDef({KeyEvent.ACTION_DOWN, KeyEvent.ACTION_UP}) |
| 50 |
public @interface KeyEventAction {}; |
| 51 |
|
| 52 |
|
| 53 |
|
| 54 |
|
| 55 |
|
| 56 |
|
| 57 |
|
| 58 |
@KeyEventAction |
| 59 |
private int mAction; |
| 60 |
|
| 61 |
|
| 62 |
|
| 63 |
|
| 64 |
|
| 65 |
|
| 66 |
|
| 67 |
|
| 68 |
@SuppressLint({"MethodNameUnits"}) |
| 69 |
private long mDownTimeNanos; |
| 70 |
|
| 71 |
|
| 72 |
|
| 73 |
|
| 74 |
|
| 75 |
|
| 76 |
|
| 77 |
|
| 78 |
|
| 79 |
|
| 80 |
private int mFlags; |
| 81 |
|
| 82 |
|
| 83 |
|
| 84 |
|
| 85 |
|
| 86 |
|
| 87 |
private int mKeyCode; |
| 88 |
|
| 89 |
|
| 90 |
|
| 91 |
|
| 92 |
|
| 93 |
|
| 94 |
|
| 95 |
private int mScanCode; |
| 96 |
|
| 97 |
|
| 98 |
|
| 99 |
|
| 100 |
|
| 101 |
|
| 102 |
|
| 103 |
private int mMetaState; |
| 104 |
|
| 105 |
|
| 106 |
|
| 107 |
|
| 108 |
|
| 109 |
|
| 110 |
|
| 111 |
private int mRepeatCount; |
| 112 |
|
| 113 |
|
| 114 |
|
| 115 |
|
| 116 |
|
| 117 |
|
| 118 |
|
| 119 |
|
| 120 |
|
| 121 |
|
| 122 |
|
| 123 |
|
| 124 |
|
| 125 |
public @Nullable Boolean getFlag(int flag) { |
| 126 |
switch(flag) { |
| 127 |
|
| 128 |
|
| 129 |
case FLAG_CANCELED: |
| 130 |
case FLAG_IS_ACCESSIBILITY_EVENT: |
| 131 |
return (mFlags & flag) != 0; |
| 132 |
} |
| 133 |
return null; |
| 134 |
} |
| 135 |
|
| 136 |
|
| 137 |
|
| 138 |
|
| 139 |
|
| 140 |
|
| 141 |
|
| 142 |
|
| 143 |
|
| 144 |
|
| 145 |
|
| 146 |
|
| 147 |
|
| 148 |
|
| 149 |
|
| 150 |
|
| 151 |
|
| 152 |
|
| 153 |
|
| 154 |
|
| 155 |
|
| 156 |
|
| 157 |
|
| 158 |
|
| 159 |
|
| 160 |
|
| 161 |
|
| 162 |
|
| 163 |
|
| 164 |
|
| 165 |
|
| 166 |
|
| 167 |
|
| 168 |
|
| 169 |
|
| 170 |
|
| 171 |
|
| 172 |
|
| 173 |
|
| 174 |
|
| 175 |
|
| 176 |
|
| 177 |
|
| 178 |
|
| 179 |
|
| 180 |
|
| 181 |
|
| 182 |
|
| 183 |
|
| 184 |
|
| 185 |
public VerifiedKeyEvent( |
| 186 |
int deviceId, |
| 187 |
long eventTimeNanos, |
| 188 |
int source, |
| 189 |
int displayId, |
| 190 |
@KeyEventAction int action, |
| 191 |
@SuppressLint({ "MethodNameUnits" }) long downTimeNanos, |
| 192 |
int flags, |
| 193 |
int keyCode, |
| 194 |
int scanCode, |
| 195 |
int metaState, |
| 196 |
int repeatCount) { |
| 197 |
super(VERIFIED_KEY, deviceId, eventTimeNanos, source, displayId); |
| 198 |
this.mAction = action; |
| 199 |
com.android.internal.util.AnnotationValidations.validate( |
| 200 |
KeyEventAction.class, null, mAction); |
| 201 |
this.mDownTimeNanos = downTimeNanos; |
| 202 |
this.mFlags = flags; |
| 203 |
this.mKeyCode = keyCode; |
| 204 |
this.mScanCode = scanCode; |
| 205 |
this.mMetaState = metaState; |
| 206 |
this.mRepeatCount = repeatCount; |
| 207 |
} |
| 208 |
|
| 209 |
|
| 210 |
|
| 211 |
|
| 212 |
|
| 213 |
|
| 214 |
|
| 215 |
@DataClass.Generated.Member |
| 216 |
public @KeyEventAction int getAction() { |
| 217 |
return mAction; |
| 218 |
} |
| 219 |
|
| 220 |
|
| 221 |
|
| 222 |
|
| 223 |
|
| 224 |
|
| 225 |
|
| 226 |
|
| 227 |
@DataClass.Generated.Member |
| 228 |
public @SuppressLint({ "MethodNameUnits" }) long getDownTimeNanos() { |
| 229 |
return mDownTimeNanos; |
| 230 |
} |
| 231 |
|
| 232 |
|
| 233 |
|
| 234 |
|
| 235 |
|
| 236 |
|
| 237 |
|
| 238 |
|
| 239 |
@DataClass.Generated.Member |
| 240 |
public int getFlags() { |
| 241 |
return mFlags; |
| 242 |
} |
| 243 |
|
| 244 |
|
| 245 |
|
| 246 |
|
| 247 |
|
| 248 |
|
| 249 |
@DataClass.Generated.Member |
| 250 |
public int getKeyCode() { |
| 251 |
return mKeyCode; |
| 252 |
} |
| 253 |
|
| 254 |
|
| 255 |
|
| 256 |
|
| 257 |
|
| 258 |
|
| 259 |
|
| 260 |
@DataClass.Generated.Member |
| 261 |
public int getScanCode() { |
| 262 |
return mScanCode; |
| 263 |
} |
| 264 |
|
| 265 |
|
| 266 |
|
| 267 |
|
| 268 |
|
| 269 |
|
| 270 |
|
| 271 |
@DataClass.Generated.Member |
| 272 |
public int getMetaState() { |
| 273 |
return mMetaState; |
| 274 |
} |
| 275 |
|
| 276 |
|
| 277 |
|
| 278 |
|
| 279 |
|
| 280 |
|
| 281 |
|
| 282 |
@DataClass.Generated.Member |
| 283 |
public int getRepeatCount() { |
| 284 |
return mRepeatCount; |
| 285 |
} |
| 286 |
|
| 287 |
@Override |
| 288 |
@DataClass.Generated.Member |
| 289 |
public boolean equals(@Nullable Object o) { |
| 290 |
|
| 291 |
|
| 292 |
|
| 293 |
|
| 294 |
if (this == o) return true; |
| 295 |
if (o == null || getClass() != o.getClass()) return false; |
| 296 |
@SuppressWarnings("unchecked") |
| 297 |
VerifiedKeyEvent that = (VerifiedKeyEvent) o; |
| 298 |
|
| 299 |
return true |
| 300 |
&& super.equals(that) |
| 301 |
&& mAction == that.mAction |
| 302 |
&& mDownTimeNanos == that.mDownTimeNanos |
| 303 |
&& mFlags == that.mFlags |
| 304 |
&& mKeyCode == that.mKeyCode |
| 305 |
&& mScanCode == that.mScanCode |
| 306 |
&& mMetaState == that.mMetaState |
| 307 |
&& mRepeatCount == that.mRepeatCount; |
| 308 |
} |
| 309 |
|
| 310 |
@Override |
| 311 |
@DataClass.Generated.Member |
| 312 |
public int hashCode() { |
| 313 |
|
| 314 |
|
| 315 |
|
| 316 |
int _hash = 1; |
| 317 |
_hash = 31 * _hash + super.hashCode(); |
| 318 |
_hash = 31 * _hash + mAction; |
| 319 |
_hash = 31 * _hash + Long.hashCode(mDownTimeNanos); |
| 320 |
_hash = 31 * _hash + mFlags; |
| 321 |
_hash = 31 * _hash + mKeyCode; |
| 322 |
_hash = 31 * _hash + mScanCode; |
| 323 |
_hash = 31 * _hash + mMetaState; |
| 324 |
_hash = 31 * _hash + mRepeatCount; |
| 325 |
return _hash; |
| 326 |
} |
| 327 |
|
| 328 |
@Override |
| 329 |
@DataClass.Generated.Member |
| 330 |
public void writeToParcel(@android.annotation.NonNull Parcel dest, int flags) { |
| 331 |
|
| 332 |
|
| 333 |
super.writeToParcel(dest, flags); |
| 334 |
|
| 335 |
dest.writeInt(mAction); |
| 336 |
dest.writeLong(mDownTimeNanos); |
| 337 |
dest.writeInt(mFlags); |
| 338 |
dest.writeInt(mKeyCode); |
| 339 |
dest.writeInt(mScanCode); |
| 340 |
dest.writeInt(mMetaState); |
| 341 |
dest.writeInt(mRepeatCount); |
| 342 |
} |
| 343 |
|
| 344 |
@Override |
| 345 |
@DataClass.Generated.Member |
| 346 |
public int describeContents() { return 0; } |
| 347 |
|
| 348 |
|
| 349 |
@SuppressWarnings({"unchecked", "RedundantCast"}) |
| 350 |
@DataClass.Generated.Member |
| 351 |
VerifiedKeyEvent(@android.annotation.NonNull Parcel in) { |
| 352 |
|
| 353 |
|
| 354 |
super(in, VERIFIED_KEY); |
| 355 |
|
| 356 |
int action = in.readInt(); |
| 357 |
long downTimeNanos = in.readLong(); |
| 358 |
int flags = in.readInt(); |
| 359 |
int keyCode = in.readInt(); |
| 360 |
int scanCode = in.readInt(); |
| 361 |
int metaState = in.readInt(); |
| 362 |
int repeatCount = in.readInt(); |
| 363 |
|
| 364 |
this.mAction = action; |
| 365 |
com.android.internal.util.AnnotationValidations.validate( |
| 366 |
KeyEventAction.class, null, mAction); |
| 367 |
this.mDownTimeNanos = downTimeNanos; |
| 368 |
this.mFlags = flags; |
| 369 |
this.mKeyCode = keyCode; |
| 370 |
this.mScanCode = scanCode; |
| 371 |
this.mMetaState = metaState; |
| 372 |
this.mRepeatCount = repeatCount; |
| 373 |
|
| 374 |
|
| 375 |
} |
| 376 |
|
| 377 |
@DataClass.Generated.Member |
| 378 |
public static final @android.annotation.NonNull Parcelable.Creator<VerifiedKeyEvent> CREATOR |
| 379 |
= new Parcelable.Creator<VerifiedKeyEvent>() { |
| 380 |
@Override |
| 381 |
public VerifiedKeyEvent[] newArray(int size) { |
| 382 |
return new VerifiedKeyEvent[size]; |
| 383 |
} |
| 384 |
|
| 385 |
@Override |
| 386 |
public VerifiedKeyEvent createFromParcel(@android.annotation.NonNull Parcel in) { |
| 387 |
return new VerifiedKeyEvent(in); |
| 388 |
} |
| 389 |
}; |
| 390 |
|
| 391 |
@DataClass.Generated( |
| 392 |
time = 1604509197793L, |
| 393 |
codegenVersion = "1.0.20", |
| 394 |
sourceFile = "frameworks/base/core/java/android/view/VerifiedKeyEvent.java", |
| 395 |
inputSignatures = "private static final java.lang.String TAG\nprivate @android.view.VerifiedKeyEvent.KeyEventAction int mAction\nprivate @android.annotation.SuppressLint long mDownTimeNanos\nprivate int mFlags\nprivate int mKeyCode\nprivate int mScanCode\nprivate int mMetaState\nprivate int mRepeatCount\npublic @android.annotation.Nullable java.lang.Boolean getFlag(int)\nclass VerifiedKeyEvent extends android.view.VerifiedInputEvent implements [android.os.Parcelable]\n@com.android.internal.util.DataClass(genHiddenConstructor=true, genEqualsHashCode=true)") |
| 396 |
@Deprecated |
| 397 |
private void __metadata() {} |
| 398 |
|
| 399 |
|
| 400 |
|
| 401 |
|
| 402 |
|
| 403 |
} |