Loading api/current.txt +29 −1 Original line number Diff line number Diff line Loading @@ -20160,6 +20160,7 @@ package android.view { field public static final int SOURCE_JOYSTICK = 16777232; // 0x1000010 field public static final int SOURCE_KEYBOARD = 257; // 0x101 field public static final int SOURCE_MOUSE = 8194; // 0x2002 field public static final int SOURCE_STYLUS = 16386; // 0x4002 field public static final int SOURCE_TOUCHPAD = 1048584; // 0x100008 field public static final int SOURCE_TOUCHSCREEN = 4098; // 0x1002 field public static final int SOURCE_TRACKBALL = 65540; // 0x10004 Loading Loading @@ -20692,6 +20693,7 @@ package android.view { method public final int getActionMasked(); method public final float getAxisValue(int); method public final float getAxisValue(int, int); method public final int getButtonState(); method public final int getDeviceId(); method public final long getDownTime(); method public final int getEdgeFlags(); Loading Loading @@ -20726,6 +20728,7 @@ package android.view { method public final void getPointerCoords(int, android.view.MotionEvent.PointerCoords); method public final int getPointerCount(); method public final int getPointerId(int); method public final void getPointerProperties(int, android.view.MotionEvent.PointerProperties); method public final float getPressure(); method public final float getPressure(int); method public final float getRawX(); Loading @@ -20737,6 +20740,7 @@ package android.view { method public final float getToolMajor(int); method public final float getToolMinor(); method public final float getToolMinor(int); method public final int getToolType(int); method public final float getTouchMajor(); method public final float getTouchMajor(int); method public final float getTouchMinor(); Loading @@ -20747,7 +20751,8 @@ package android.view { method public final float getY(); method public final float getY(int); method public final float getYPrecision(); method public static android.view.MotionEvent obtain(long, long, int, int, int[], android.view.MotionEvent.PointerCoords[], int, float, float, int, int, int, int); method public static android.view.MotionEvent obtain(long, long, int, int, android.view.MotionEvent.PointerProperties[], android.view.MotionEvent.PointerCoords[], int, int, float, float, int, int, int, int); method public static deprecated android.view.MotionEvent obtain(long, long, int, int, int[], android.view.MotionEvent.PointerCoords[], int, float, float, int, int, int, int); method public static android.view.MotionEvent obtain(long, long, int, float, float, float, float, int, float, float, int, int); method public static deprecated android.view.MotionEvent obtain(long, long, int, int, float, float, float, float, int, float, float, int, int); method public static android.view.MotionEvent obtain(long, long, int, float, float, int); Loading Loading @@ -20784,6 +20789,7 @@ package android.view { field public static final int ACTION_SCROLL = 8; // 0x8 field public static final int ACTION_UP = 1; // 0x1 field public static final int AXIS_BRAKE = 23; // 0x17 field public static final int AXIS_DISTANCE = 24; // 0x18 field public static final int AXIS_GAS = 22; // 0x16 field public static final int AXIS_GENERIC_1 = 32; // 0x20 field public static final int AXIS_GENERIC_10 = 41; // 0x29 Loading Loading @@ -20823,12 +20829,25 @@ package android.view { field public static final int AXIS_X = 0; // 0x0 field public static final int AXIS_Y = 1; // 0x1 field public static final int AXIS_Z = 11; // 0xb field public static final int BUTTON_BACK = 8; // 0x8 field public static final int BUTTON_ERASER = 32; // 0x20 field public static final int BUTTON_FORWARD = 16; // 0x10 field public static final int BUTTON_PRIMARY = 1; // 0x1 field public static final int BUTTON_SECONDARY = 2; // 0x2 field public static final int BUTTON_TERTIARY = 4; // 0x4 field public static final android.os.Parcelable.Creator CREATOR; field public static final int EDGE_BOTTOM = 2; // 0x2 field public static final int EDGE_LEFT = 4; // 0x4 field public static final int EDGE_RIGHT = 8; // 0x8 field public static final int EDGE_TOP = 1; // 0x1 field public static final int FLAG_WINDOW_IS_OBSCURED = 1; // 0x1 field public static final int INVALID_POINTER_ID = -1; // 0xffffffff field public static final int TOOL_TYPE_FINGER = 1; // 0x1 field public static final int TOOL_TYPE_INDIRECT_FINGER = 4; // 0x4 field public static final int TOOL_TYPE_INDIRECT_STYLUS = 5; // 0x5 field public static final int TOOL_TYPE_MOUSE = 3; // 0x3 field public static final int TOOL_TYPE_STYLUS = 2; // 0x2 field public static final int TOOL_TYPE_UNKNOWN = 0; // 0x0 } public static final class MotionEvent.PointerCoords { Loading @@ -20849,6 +20868,15 @@ package android.view { field public float y; } public static final class MotionEvent.PointerProperties { ctor public MotionEvent.PointerProperties(); ctor public MotionEvent.PointerProperties(android.view.MotionEvent.PointerProperties); method public void clear(); method public void copyFrom(android.view.MotionEvent.PointerProperties); field public int id; field public int toolType; } public abstract class OrientationEventListener { ctor public OrientationEventListener(android.content.Context); ctor public OrientationEventListener(android.content.Context, int); core/java/android/inputmethodservice/SoftInputWindow.java +11 −46 Original line number Diff line number Diff line Loading @@ -73,8 +73,17 @@ class SoftInputWindow extends Dialog { @Override public boolean dispatchTouchEvent(MotionEvent ev) { getWindow().getDecorView().getHitRect(mBounds); final MotionEvent event = clipMotionEvent(ev, mBounds); return super.dispatchTouchEvent(event); if (ev.isWithinBoundsNoHistory(mBounds.left, mBounds.top, mBounds.right - 1, mBounds.bottom - 1)) { return super.dispatchTouchEvent(ev); } else { MotionEvent temp = ev.clampNoHistory(mBounds.left, mBounds.top, mBounds.right - 1, mBounds.bottom - 1); boolean handled = super.dispatchTouchEvent(temp); temp.recycle(); return handled; } } /** Loading Loading @@ -163,48 +172,4 @@ class SoftInputWindow extends Dialog { WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE | WindowManager.LayoutParams.FLAG_DIM_BEHIND); } private static MotionEvent clipMotionEvent(MotionEvent me, Rect bounds) { final int pointerCount = me.getPointerCount(); boolean shouldClip = false; for (int pointerIndex = 0; pointerIndex < pointerCount; pointerIndex++) { final int x = (int)me.getX(pointerIndex); final int y = (int)me.getY(pointerIndex); if (!bounds.contains(x, y)) { shouldClip = true; break; } } if (!shouldClip) return me; if (pointerCount == 1) { final int x = (int)me.getX(); final int y = (int)me.getY(); me.setLocation( Math.max(bounds.left, Math.min(x, bounds.right - 1)), Math.max(bounds.top, Math.min(y, bounds.bottom - 1))); return me; } final int[] pointerIds = new int[pointerCount]; final MotionEvent.PointerCoords[] pointerCoords = new MotionEvent.PointerCoords[pointerCount]; for (int pointerIndex = 0; pointerIndex < pointerCount; pointerIndex++) { pointerIds[pointerIndex] = me.getPointerId(pointerIndex); final MotionEvent.PointerCoords coords = new MotionEvent.PointerCoords(); me.getPointerCoords(pointerIndex, coords); pointerCoords[pointerIndex] = coords; final int x = (int)coords.x; final int y = (int)coords.y; if (!bounds.contains(x, y)) { coords.x = Math.max(bounds.left, Math.min(x, bounds.right - 1)); coords.y = Math.max(bounds.top, Math.min(y, bounds.bottom - 1)); } } return MotionEvent.obtain( me.getDownTime(), me.getEventTime(), me.getAction(), pointerCount, pointerIds, pointerCoords, me.getMetaState(), me.getXPrecision(), me.getYPrecision(), me.getDeviceId(), me.getEdgeFlags(), me.getSource(), me.getFlags()); } } core/java/android/view/InputDevice.java +9 −1 Original line number Diff line number Diff line Loading @@ -154,6 +154,13 @@ public final class InputDevice implements Parcelable { */ public static final int SOURCE_MOUSE = 0x00002000 | SOURCE_CLASS_POINTER; /** * The input source is a stylus pointing device. * * @see #SOURCE_CLASS_POINTER */ public static final int SOURCE_STYLUS = 0x00004000 | SOURCE_CLASS_POINTER; /** * The input source is a trackball. * Loading Loading @@ -585,6 +592,7 @@ public final class InputDevice implements Parcelable { appendSourceDescriptionIfApplicable(description, SOURCE_DPAD, "dpad"); appendSourceDescriptionIfApplicable(description, SOURCE_TOUCHSCREEN, "touchscreen"); appendSourceDescriptionIfApplicable(description, SOURCE_MOUSE, "mouse"); appendSourceDescriptionIfApplicable(description, SOURCE_STYLUS, "stylus"); appendSourceDescriptionIfApplicable(description, SOURCE_TRACKBALL, "trackball"); appendSourceDescriptionIfApplicable(description, SOURCE_TOUCHPAD, "touchpad"); appendSourceDescriptionIfApplicable(description, SOURCE_JOYSTICK, "joystick"); Loading core/java/android/view/KeyEvent.java +16 −9 Original line number Diff line number Diff line Loading @@ -2672,15 +2672,22 @@ public class KeyEvent extends InputEvent implements Parcelable { @Override public String toString() { return "KeyEvent{action=" + actionToString(mAction) + " keycode=" + keyCodeToString(mKeyCode) + " scancode=" + mScanCode + " metaState=" + metaStateToString(mMetaState) + " flags=0x" + Integer.toHexString(mFlags) + " repeat=" + mRepeatCount + " device=" + mDeviceId + " source=0x" + Integer.toHexString(mSource) + "}"; StringBuilder msg = new StringBuilder(); msg.append("KeyEvent { action=").append(actionToString(mAction)); msg.append(", keyCode=").append(keyCodeToString(mKeyCode)); msg.append(", scanCode=").append(mScanCode); if (mCharacters != null) { msg.append(", characters=\"").append(mCharacters).append("\""); } msg.append(", metaState=").append(metaStateToString(mMetaState)); msg.append(", flags=0x").append(Integer.toHexString(mFlags)); msg.append(", repeatCount=").append(mRepeatCount); msg.append(", eventTime=").append(mEventTime); msg.append(", downTime=").append(mDownTime); msg.append(", deviceId=").append(mDeviceId); msg.append(", source=0x").append(Integer.toHexString(mSource)); msg.append(" }"); return msg.toString(); } /** Loading core/java/android/view/MotionEvent.java +852 −168 File changed.Preview size limit exceeded, changes collapsed. Show changes Loading
api/current.txt +29 −1 Original line number Diff line number Diff line Loading @@ -20160,6 +20160,7 @@ package android.view { field public static final int SOURCE_JOYSTICK = 16777232; // 0x1000010 field public static final int SOURCE_KEYBOARD = 257; // 0x101 field public static final int SOURCE_MOUSE = 8194; // 0x2002 field public static final int SOURCE_STYLUS = 16386; // 0x4002 field public static final int SOURCE_TOUCHPAD = 1048584; // 0x100008 field public static final int SOURCE_TOUCHSCREEN = 4098; // 0x1002 field public static final int SOURCE_TRACKBALL = 65540; // 0x10004 Loading Loading @@ -20692,6 +20693,7 @@ package android.view { method public final int getActionMasked(); method public final float getAxisValue(int); method public final float getAxisValue(int, int); method public final int getButtonState(); method public final int getDeviceId(); method public final long getDownTime(); method public final int getEdgeFlags(); Loading Loading @@ -20726,6 +20728,7 @@ package android.view { method public final void getPointerCoords(int, android.view.MotionEvent.PointerCoords); method public final int getPointerCount(); method public final int getPointerId(int); method public final void getPointerProperties(int, android.view.MotionEvent.PointerProperties); method public final float getPressure(); method public final float getPressure(int); method public final float getRawX(); Loading @@ -20737,6 +20740,7 @@ package android.view { method public final float getToolMajor(int); method public final float getToolMinor(); method public final float getToolMinor(int); method public final int getToolType(int); method public final float getTouchMajor(); method public final float getTouchMajor(int); method public final float getTouchMinor(); Loading @@ -20747,7 +20751,8 @@ package android.view { method public final float getY(); method public final float getY(int); method public final float getYPrecision(); method public static android.view.MotionEvent obtain(long, long, int, int, int[], android.view.MotionEvent.PointerCoords[], int, float, float, int, int, int, int); method public static android.view.MotionEvent obtain(long, long, int, int, android.view.MotionEvent.PointerProperties[], android.view.MotionEvent.PointerCoords[], int, int, float, float, int, int, int, int); method public static deprecated android.view.MotionEvent obtain(long, long, int, int, int[], android.view.MotionEvent.PointerCoords[], int, float, float, int, int, int, int); method public static android.view.MotionEvent obtain(long, long, int, float, float, float, float, int, float, float, int, int); method public static deprecated android.view.MotionEvent obtain(long, long, int, int, float, float, float, float, int, float, float, int, int); method public static android.view.MotionEvent obtain(long, long, int, float, float, int); Loading Loading @@ -20784,6 +20789,7 @@ package android.view { field public static final int ACTION_SCROLL = 8; // 0x8 field public static final int ACTION_UP = 1; // 0x1 field public static final int AXIS_BRAKE = 23; // 0x17 field public static final int AXIS_DISTANCE = 24; // 0x18 field public static final int AXIS_GAS = 22; // 0x16 field public static final int AXIS_GENERIC_1 = 32; // 0x20 field public static final int AXIS_GENERIC_10 = 41; // 0x29 Loading Loading @@ -20823,12 +20829,25 @@ package android.view { field public static final int AXIS_X = 0; // 0x0 field public static final int AXIS_Y = 1; // 0x1 field public static final int AXIS_Z = 11; // 0xb field public static final int BUTTON_BACK = 8; // 0x8 field public static final int BUTTON_ERASER = 32; // 0x20 field public static final int BUTTON_FORWARD = 16; // 0x10 field public static final int BUTTON_PRIMARY = 1; // 0x1 field public static final int BUTTON_SECONDARY = 2; // 0x2 field public static final int BUTTON_TERTIARY = 4; // 0x4 field public static final android.os.Parcelable.Creator CREATOR; field public static final int EDGE_BOTTOM = 2; // 0x2 field public static final int EDGE_LEFT = 4; // 0x4 field public static final int EDGE_RIGHT = 8; // 0x8 field public static final int EDGE_TOP = 1; // 0x1 field public static final int FLAG_WINDOW_IS_OBSCURED = 1; // 0x1 field public static final int INVALID_POINTER_ID = -1; // 0xffffffff field public static final int TOOL_TYPE_FINGER = 1; // 0x1 field public static final int TOOL_TYPE_INDIRECT_FINGER = 4; // 0x4 field public static final int TOOL_TYPE_INDIRECT_STYLUS = 5; // 0x5 field public static final int TOOL_TYPE_MOUSE = 3; // 0x3 field public static final int TOOL_TYPE_STYLUS = 2; // 0x2 field public static final int TOOL_TYPE_UNKNOWN = 0; // 0x0 } public static final class MotionEvent.PointerCoords { Loading @@ -20849,6 +20868,15 @@ package android.view { field public float y; } public static final class MotionEvent.PointerProperties { ctor public MotionEvent.PointerProperties(); ctor public MotionEvent.PointerProperties(android.view.MotionEvent.PointerProperties); method public void clear(); method public void copyFrom(android.view.MotionEvent.PointerProperties); field public int id; field public int toolType; } public abstract class OrientationEventListener { ctor public OrientationEventListener(android.content.Context); ctor public OrientationEventListener(android.content.Context, int);
core/java/android/inputmethodservice/SoftInputWindow.java +11 −46 Original line number Diff line number Diff line Loading @@ -73,8 +73,17 @@ class SoftInputWindow extends Dialog { @Override public boolean dispatchTouchEvent(MotionEvent ev) { getWindow().getDecorView().getHitRect(mBounds); final MotionEvent event = clipMotionEvent(ev, mBounds); return super.dispatchTouchEvent(event); if (ev.isWithinBoundsNoHistory(mBounds.left, mBounds.top, mBounds.right - 1, mBounds.bottom - 1)) { return super.dispatchTouchEvent(ev); } else { MotionEvent temp = ev.clampNoHistory(mBounds.left, mBounds.top, mBounds.right - 1, mBounds.bottom - 1); boolean handled = super.dispatchTouchEvent(temp); temp.recycle(); return handled; } } /** Loading Loading @@ -163,48 +172,4 @@ class SoftInputWindow extends Dialog { WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE | WindowManager.LayoutParams.FLAG_DIM_BEHIND); } private static MotionEvent clipMotionEvent(MotionEvent me, Rect bounds) { final int pointerCount = me.getPointerCount(); boolean shouldClip = false; for (int pointerIndex = 0; pointerIndex < pointerCount; pointerIndex++) { final int x = (int)me.getX(pointerIndex); final int y = (int)me.getY(pointerIndex); if (!bounds.contains(x, y)) { shouldClip = true; break; } } if (!shouldClip) return me; if (pointerCount == 1) { final int x = (int)me.getX(); final int y = (int)me.getY(); me.setLocation( Math.max(bounds.left, Math.min(x, bounds.right - 1)), Math.max(bounds.top, Math.min(y, bounds.bottom - 1))); return me; } final int[] pointerIds = new int[pointerCount]; final MotionEvent.PointerCoords[] pointerCoords = new MotionEvent.PointerCoords[pointerCount]; for (int pointerIndex = 0; pointerIndex < pointerCount; pointerIndex++) { pointerIds[pointerIndex] = me.getPointerId(pointerIndex); final MotionEvent.PointerCoords coords = new MotionEvent.PointerCoords(); me.getPointerCoords(pointerIndex, coords); pointerCoords[pointerIndex] = coords; final int x = (int)coords.x; final int y = (int)coords.y; if (!bounds.contains(x, y)) { coords.x = Math.max(bounds.left, Math.min(x, bounds.right - 1)); coords.y = Math.max(bounds.top, Math.min(y, bounds.bottom - 1)); } } return MotionEvent.obtain( me.getDownTime(), me.getEventTime(), me.getAction(), pointerCount, pointerIds, pointerCoords, me.getMetaState(), me.getXPrecision(), me.getYPrecision(), me.getDeviceId(), me.getEdgeFlags(), me.getSource(), me.getFlags()); } }
core/java/android/view/InputDevice.java +9 −1 Original line number Diff line number Diff line Loading @@ -154,6 +154,13 @@ public final class InputDevice implements Parcelable { */ public static final int SOURCE_MOUSE = 0x00002000 | SOURCE_CLASS_POINTER; /** * The input source is a stylus pointing device. * * @see #SOURCE_CLASS_POINTER */ public static final int SOURCE_STYLUS = 0x00004000 | SOURCE_CLASS_POINTER; /** * The input source is a trackball. * Loading Loading @@ -585,6 +592,7 @@ public final class InputDevice implements Parcelable { appendSourceDescriptionIfApplicable(description, SOURCE_DPAD, "dpad"); appendSourceDescriptionIfApplicable(description, SOURCE_TOUCHSCREEN, "touchscreen"); appendSourceDescriptionIfApplicable(description, SOURCE_MOUSE, "mouse"); appendSourceDescriptionIfApplicable(description, SOURCE_STYLUS, "stylus"); appendSourceDescriptionIfApplicable(description, SOURCE_TRACKBALL, "trackball"); appendSourceDescriptionIfApplicable(description, SOURCE_TOUCHPAD, "touchpad"); appendSourceDescriptionIfApplicable(description, SOURCE_JOYSTICK, "joystick"); Loading
core/java/android/view/KeyEvent.java +16 −9 Original line number Diff line number Diff line Loading @@ -2672,15 +2672,22 @@ public class KeyEvent extends InputEvent implements Parcelable { @Override public String toString() { return "KeyEvent{action=" + actionToString(mAction) + " keycode=" + keyCodeToString(mKeyCode) + " scancode=" + mScanCode + " metaState=" + metaStateToString(mMetaState) + " flags=0x" + Integer.toHexString(mFlags) + " repeat=" + mRepeatCount + " device=" + mDeviceId + " source=0x" + Integer.toHexString(mSource) + "}"; StringBuilder msg = new StringBuilder(); msg.append("KeyEvent { action=").append(actionToString(mAction)); msg.append(", keyCode=").append(keyCodeToString(mKeyCode)); msg.append(", scanCode=").append(mScanCode); if (mCharacters != null) { msg.append(", characters=\"").append(mCharacters).append("\""); } msg.append(", metaState=").append(metaStateToString(mMetaState)); msg.append(", flags=0x").append(Integer.toHexString(mFlags)); msg.append(", repeatCount=").append(mRepeatCount); msg.append(", eventTime=").append(mEventTime); msg.append(", downTime=").append(mDownTime); msg.append(", deviceId=").append(mDeviceId); msg.append(", source=0x").append(Integer.toHexString(mSource)); msg.append(" }"); return msg.toString(); } /** Loading
core/java/android/view/MotionEvent.java +852 −168 File changed.Preview size limit exceeded, changes collapsed. Show changes