summaryrefslogtreecommitdiff
path: root/core/java/android/view/KeyEvent.java
diff options
context:
space:
mode:
Diffstat (limited to 'core/java/android/view/KeyEvent.java')
-rw-r--r--core/java/android/view/KeyEvent.java25
1 files changed, 25 insertions, 0 deletions
diff --git a/core/java/android/view/KeyEvent.java b/core/java/android/view/KeyEvent.java
index 907f38535842..0739516e4e96 100644
--- a/core/java/android/view/KeyEvent.java
+++ b/core/java/android/view/KeyEvent.java
@@ -1978,6 +1978,7 @@ public class KeyEvent extends InputEvent implements Parcelable {
}
/** @hide */
+ @TestApi
@Override
public final void setDisplayId(int displayId) {
mDisplayId = displayId;
@@ -2042,6 +2043,16 @@ public class KeyEvent extends InputEvent implements Parcelable {
}
/**
+ * Modifies the flags of the event.
+ *
+ * @param newFlags New flags for the event, replacing the entire value.
+ * @hide
+ */
+ public final void setFlags(int newFlags) {
+ mFlags = newFlags;
+ }
+
+ /**
* Returns the flags for this key event.
*
* @see #FLAG_WOKE_HERE
@@ -2542,6 +2553,20 @@ public class KeyEvent extends InputEvent implements Parcelable {
}
/**
+ * Modifies the down time and the event time of the event.
+ *
+ * @param downTime The new down time (in {@link android.os.SystemClock#uptimeMillis}) of the
+ * event.
+ * @param eventTime The new event time (in {@link android.os.SystemClock#uptimeMillis}) of the
+ * event.
+ * @hide
+ */
+ public final void setTime(long downTime, long eventTime) {
+ mDownTime = downTime;
+ mEventTime = eventTime;
+ }
+
+ /**
* Retrieve the time of the most recent key down event,
* in the {@link android.os.SystemClock#uptimeMillis} time base. If this
* is a down event, this will be the same as {@link #getEventTime()}.