Loading api/current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -22718,6 +22718,7 @@ package android.view { method public int describeContents(); method public final android.view.InputDevice getDevice(); method public abstract int getDeviceId(); method public abstract long getEventTime(); method public abstract int getSource(); field public static final android.os.Parcelable.Creator CREATOR; } core/java/android/view/InputEvent.java +19 −1 Original line number Diff line number Diff line Loading @@ -159,8 +159,26 @@ public abstract class InputEvent implements Parcelable { public abstract void setTainted(boolean tainted); /** * Returns the time (in ns) when this specific event was generated. * Retrieve the time this event occurred, * in the {@link android.os.SystemClock#uptimeMillis} time base. * * @return Returns the time this event occurred, * in the {@link android.os.SystemClock#uptimeMillis} time base. */ public abstract long getEventTime(); /** * Retrieve the time this event occurred, * in the {@link android.os.SystemClock#uptimeMillis} time base but with * nanosecond (instead of millisecond) precision. * <p> * The value is in nanosecond precision but it may not have nanosecond accuracy. * </p> * * @return Returns the time this event occurred, * in the {@link android.os.SystemClock#uptimeMillis} time base but with * nanosecond (instead of millisecond) precision. * * @hide */ public abstract long getEventTimeNano(); Loading core/java/android/view/KeyEvent.java +17 −3 Original line number Diff line number Diff line Loading @@ -2381,11 +2381,25 @@ public class KeyEvent extends InputEvent implements Parcelable { * @return Returns the time this event occurred, * in the {@link android.os.SystemClock#uptimeMillis} time base. */ @Override public final long getEventTime() { return mEventTime; } /** @hide */ /** * Retrieve the time this event occurred, * in the {@link android.os.SystemClock#uptimeMillis} time base but with * nanosecond (instead of millisecond) precision. * <p> * The value is in nanosecond precision but it may not have nanosecond accuracy. * </p> * * @return Returns the time this event occurred, * in the {@link android.os.SystemClock#uptimeMillis} time base but with * nanosecond (instead of millisecond) precision. * * @hide */ @Override public final long getEventTimeNano() { return mEventTime * 1000000L; Loading core/java/android/view/MotionEvent.java +49 −3 Original line number Diff line number Diff line Loading @@ -1781,18 +1781,32 @@ public final class MotionEvent extends InputEvent implements Parcelable { } /** * Returns the time (in ms) when this specific event was generated. * Retrieve the time this event occurred, * in the {@link android.os.SystemClock#uptimeMillis} time base. * * @return Returns the time this event occurred, * in the {@link android.os.SystemClock#uptimeMillis} time base. */ @Override public final long getEventTime() { return nativeGetEventTimeNanos(mNativePtr, HISTORY_CURRENT) / NS_PER_MS; } /** * Returns the time (in ns) when this specific event was generated. * Retrieve the time this event occurred, * in the {@link android.os.SystemClock#uptimeMillis} time base but with * nanosecond precision. * <p> * The value is in nanosecond precision but it may not have nanosecond accuracy. * </p> * * @return Returns the time this event occurred, * in the {@link android.os.SystemClock#uptimeMillis} time base but with * nanosecond precision. * * @hide */ @Override public final long getEventTimeNano() { return nativeGetEventTimeNanos(mNativePtr, HISTORY_CURRENT); } Loading Loading @@ -2234,10 +2248,16 @@ public final class MotionEvent extends InputEvent implements Parcelable { /** * Returns the time that a historical movement occurred between this event * and the previous event. Only applies to ACTION_MOVE events. * and the previous event, in the {@link android.os.SystemClock#uptimeMillis} time base. * <p> * This only applies to ACTION_MOVE events. * </p> * * @param pos Which historical value to return; must be less than * {@link #getHistorySize} * @return Returns the time that a historical movement occurred between this * event and the previous event, * in the {@link android.os.SystemClock#uptimeMillis} time base. * * @see #getHistorySize * @see #getEventTime Loading @@ -2246,6 +2266,32 @@ public final class MotionEvent extends InputEvent implements Parcelable { return nativeGetEventTimeNanos(mNativePtr, pos) / NS_PER_MS; } /** * Returns the time that a historical movement occurred between this event * and the previous event, in the {@link android.os.SystemClock#uptimeMillis} time base * but with nanosecond (instead of millisecond) precision. * <p> * This only applies to ACTION_MOVE events. * </p><p> * The value is in nanosecond precision but it may not have nanosecond accuracy. * </p> * * @param pos Which historical value to return; must be less than * {@link #getHistorySize} * @return Returns the time that a historical movement occurred between this * event and the previous event, * in the {@link android.os.SystemClock#uptimeMillis} time base but with * nanosecond (instead of millisecond) precision. * * @see #getHistorySize * @see #getEventTime * * @hide */ public final long getHistoricalEventTimeNano(int pos) { return nativeGetEventTimeNanos(mNativePtr, pos); } /** * {@link #getHistoricalX(int, int)} for the first pointer index (may be an * arbitrary pointer identifier). Loading Loading
api/current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -22718,6 +22718,7 @@ package android.view { method public int describeContents(); method public final android.view.InputDevice getDevice(); method public abstract int getDeviceId(); method public abstract long getEventTime(); method public abstract int getSource(); field public static final android.os.Parcelable.Creator CREATOR; }
core/java/android/view/InputEvent.java +19 −1 Original line number Diff line number Diff line Loading @@ -159,8 +159,26 @@ public abstract class InputEvent implements Parcelable { public abstract void setTainted(boolean tainted); /** * Returns the time (in ns) when this specific event was generated. * Retrieve the time this event occurred, * in the {@link android.os.SystemClock#uptimeMillis} time base. * * @return Returns the time this event occurred, * in the {@link android.os.SystemClock#uptimeMillis} time base. */ public abstract long getEventTime(); /** * Retrieve the time this event occurred, * in the {@link android.os.SystemClock#uptimeMillis} time base but with * nanosecond (instead of millisecond) precision. * <p> * The value is in nanosecond precision but it may not have nanosecond accuracy. * </p> * * @return Returns the time this event occurred, * in the {@link android.os.SystemClock#uptimeMillis} time base but with * nanosecond (instead of millisecond) precision. * * @hide */ public abstract long getEventTimeNano(); Loading
core/java/android/view/KeyEvent.java +17 −3 Original line number Diff line number Diff line Loading @@ -2381,11 +2381,25 @@ public class KeyEvent extends InputEvent implements Parcelable { * @return Returns the time this event occurred, * in the {@link android.os.SystemClock#uptimeMillis} time base. */ @Override public final long getEventTime() { return mEventTime; } /** @hide */ /** * Retrieve the time this event occurred, * in the {@link android.os.SystemClock#uptimeMillis} time base but with * nanosecond (instead of millisecond) precision. * <p> * The value is in nanosecond precision but it may not have nanosecond accuracy. * </p> * * @return Returns the time this event occurred, * in the {@link android.os.SystemClock#uptimeMillis} time base but with * nanosecond (instead of millisecond) precision. * * @hide */ @Override public final long getEventTimeNano() { return mEventTime * 1000000L; Loading
core/java/android/view/MotionEvent.java +49 −3 Original line number Diff line number Diff line Loading @@ -1781,18 +1781,32 @@ public final class MotionEvent extends InputEvent implements Parcelable { } /** * Returns the time (in ms) when this specific event was generated. * Retrieve the time this event occurred, * in the {@link android.os.SystemClock#uptimeMillis} time base. * * @return Returns the time this event occurred, * in the {@link android.os.SystemClock#uptimeMillis} time base. */ @Override public final long getEventTime() { return nativeGetEventTimeNanos(mNativePtr, HISTORY_CURRENT) / NS_PER_MS; } /** * Returns the time (in ns) when this specific event was generated. * Retrieve the time this event occurred, * in the {@link android.os.SystemClock#uptimeMillis} time base but with * nanosecond precision. * <p> * The value is in nanosecond precision but it may not have nanosecond accuracy. * </p> * * @return Returns the time this event occurred, * in the {@link android.os.SystemClock#uptimeMillis} time base but with * nanosecond precision. * * @hide */ @Override public final long getEventTimeNano() { return nativeGetEventTimeNanos(mNativePtr, HISTORY_CURRENT); } Loading Loading @@ -2234,10 +2248,16 @@ public final class MotionEvent extends InputEvent implements Parcelable { /** * Returns the time that a historical movement occurred between this event * and the previous event. Only applies to ACTION_MOVE events. * and the previous event, in the {@link android.os.SystemClock#uptimeMillis} time base. * <p> * This only applies to ACTION_MOVE events. * </p> * * @param pos Which historical value to return; must be less than * {@link #getHistorySize} * @return Returns the time that a historical movement occurred between this * event and the previous event, * in the {@link android.os.SystemClock#uptimeMillis} time base. * * @see #getHistorySize * @see #getEventTime Loading @@ -2246,6 +2266,32 @@ public final class MotionEvent extends InputEvent implements Parcelable { return nativeGetEventTimeNanos(mNativePtr, pos) / NS_PER_MS; } /** * Returns the time that a historical movement occurred between this event * and the previous event, in the {@link android.os.SystemClock#uptimeMillis} time base * but with nanosecond (instead of millisecond) precision. * <p> * This only applies to ACTION_MOVE events. * </p><p> * The value is in nanosecond precision but it may not have nanosecond accuracy. * </p> * * @param pos Which historical value to return; must be less than * {@link #getHistorySize} * @return Returns the time that a historical movement occurred between this * event and the previous event, * in the {@link android.os.SystemClock#uptimeMillis} time base but with * nanosecond (instead of millisecond) precision. * * @see #getHistorySize * @see #getEventTime * * @hide */ public final long getHistoricalEventTimeNano(int pos) { return nativeGetEventTimeNanos(mNativePtr, pos); } /** * {@link #getHistoricalX(int, int)} for the first pointer index (may be an * arbitrary pointer identifier). Loading