diff options
Diffstat (limited to 'core/java')
3 files changed, 54 insertions, 15 deletions
diff --git a/core/java/android/service/notification/StatusBarNotification.java b/core/java/android/service/notification/StatusBarNotification.java index e8cc24b..19f8678 100644 --- a/core/java/android/service/notification/StatusBarNotification.java +++ b/core/java/android/service/notification/StatusBarNotification.java @@ -190,13 +190,13 @@ public class StatusBarNotification implements Parcelable { return pkg; } - /** The id supplied to {@link android.app.NotificationManager#notify}. */ + /** The id supplied to {@link android.app.NotificationManager#notify(int,Notification)}. */ public int getId() { return id; } - /** The tag supplied to {@link android.app.NotificationManager#notify}, or null if no tag - * was specified. */ + /** The tag supplied to {@link android.app.NotificationManager#notify(int,Notification)}, + * or null if no tag was specified. */ public String getTag() { return tag; } @@ -217,7 +217,7 @@ public class StatusBarNotification implements Parcelable { } /** The {@link android.app.Notification} supplied to - * {@link android.app.NotificationManager#notify}. */ + * {@link android.app.NotificationManager#notify(int,Notification)}. */ public Notification getNotification() { return notification; } diff --git a/core/java/android/widget/NumberPicker.java b/core/java/android/widget/NumberPicker.java index 2ac5a12..4a98f66 100644 --- a/core/java/android/widget/NumberPicker.java +++ b/core/java/android/widget/NumberPicker.java @@ -2185,7 +2185,10 @@ public class NumberPicker extends LinearLayout { mScrollX + (mRight - mLeft), mTopSelectionDividerTop + mSelectionDividerHeight); case VIRTUAL_VIEW_ID_INPUT: - return createAccessibiltyNodeInfoForInputText(); + return createAccessibiltyNodeInfoForInputText(mScrollX, + mTopSelectionDividerTop + mSelectionDividerHeight, + mScrollX + (mRight - mLeft), + mBottomSelectionDividerBottom - mSelectionDividerHeight); case VIRTUAL_VIEW_ID_INCREMENT: return createAccessibilityNodeInfoForVirtualButton(VIRTUAL_VIEW_ID_INCREMENT, getVirtualIncrementButtonText(), mScrollX, @@ -2446,7 +2449,8 @@ public class NumberPicker extends LinearLayout { } } - private AccessibilityNodeInfo createAccessibiltyNodeInfoForInputText() { + private AccessibilityNodeInfo createAccessibiltyNodeInfoForInputText( + int left, int top, int right, int bottom) { AccessibilityNodeInfo info = mInputText.createAccessibilityNodeInfo(); info.setSource(NumberPicker.this, VIRTUAL_VIEW_ID_INPUT); if (mAccessibilityFocusedView != VIRTUAL_VIEW_ID_INPUT) { @@ -2455,6 +2459,15 @@ public class NumberPicker extends LinearLayout { if (mAccessibilityFocusedView == VIRTUAL_VIEW_ID_INPUT) { info.addAction(AccessibilityNodeInfo.ACTION_CLEAR_ACCESSIBILITY_FOCUS); } + Rect boundsInParent = mTempRect; + boundsInParent.set(left, top, right, bottom); + info.setVisibleToUser(isVisibleToUser(boundsInParent)); + info.setBoundsInParent(boundsInParent); + Rect boundsInScreen = boundsInParent; + int[] locationOnScreen = mTempArray; + getLocationOnScreen(locationOnScreen); + boundsInScreen.offset(locationOnScreen[0], locationOnScreen[1]); + info.setBoundsInScreen(boundsInScreen); return info; } diff --git a/core/java/com/android/internal/widget/PointerLocationView.java b/core/java/com/android/internal/widget/PointerLocationView.java index 34cdd93..f10a2e8 100644 --- a/core/java/com/android/internal/widget/PointerLocationView.java +++ b/core/java/com/android/internal/widget/PointerLocationView.java @@ -61,6 +61,13 @@ public class PointerLocationView extends View implements InputDeviceListener { private float mAltXVelocity; private float mAltYVelocity; + // Current bounding box, if any + private boolean mHasBoundingBox; + private float mBoundingLeft; + private float mBoundingTop; + private float mBoundingRight; + private float mBoundingBottom; + // Position estimator. private VelocityTracker.Estimator mEstimator = new VelocityTracker.Estimator(); private VelocityTracker.Estimator mAltEstimator = new VelocityTracker.Estimator(); @@ -388,6 +395,12 @@ public class PointerLocationView extends View implements InputDeviceListener { ps.mCoords.x + orientationVectorX * tiltScale, ps.mCoords.y + orientationVectorY * tiltScale, 3.0f, mPaint); + + // Draw the current bounding box + if (ps.mHasBoundingBox) { + canvas.drawRect(ps.mBoundingLeft, ps.mBoundingTop, + ps.mBoundingRight, ps.mBoundingBottom, mPaint); + } } } } @@ -400,20 +413,20 @@ public class PointerLocationView extends View implements InputDeviceListener { for (int i = 0; i < NI; i++) { final int id = event.getPointerId(i); event.getHistoricalPointerCoords(i, historyPos, mTempCoords); - logCoords(type, action, i, mTempCoords, id, - event.getToolType(i), event.getButtonState()); + logCoords(type, action, i, mTempCoords, id, event); } } for (int i = 0; i < NI; i++) { final int id = event.getPointerId(i); event.getPointerCoords(i, mTempCoords); - logCoords(type, action, i, mTempCoords, id, - event.getToolType(i), event.getButtonState()); + logCoords(type, action, i, mTempCoords, id, event); } } private void logCoords(String type, int action, int index, - MotionEvent.PointerCoords coords, int id, int toolType, int buttonState) { + MotionEvent.PointerCoords coords, int id, MotionEvent event) { + final int toolType = event.getToolType(index); + final int buttonState = event.getButtonState(); final String prefix; switch (action & MotionEvent.ACTION_MASK) { case MotionEvent.ACTION_DOWN: @@ -483,6 +496,12 @@ public class PointerLocationView extends View implements InputDeviceListener { .append(" Distance=").append(coords.getAxisValue(MotionEvent.AXIS_DISTANCE), 1) .append(" VScroll=").append(coords.getAxisValue(MotionEvent.AXIS_VSCROLL), 1) .append(" HScroll=").append(coords.getAxisValue(MotionEvent.AXIS_HSCROLL), 1) + .append(" BoundingBox=[(") + .append(event.getAxisValue(MotionEvent.AXIS_GENERIC_1), 3) + .append(", ").append(event.getAxisValue(MotionEvent.AXIS_GENERIC_2), 3).append(")") + .append(", (").append(event.getAxisValue(MotionEvent.AXIS_GENERIC_3), 3) + .append(", ").append(event.getAxisValue(MotionEvent.AXIS_GENERIC_4), 3) + .append(")]") .append(" ToolType=").append(MotionEvent.toolTypeToString(toolType)) .append(" ButtonState=").append(MotionEvent.buttonStateToString(buttonState)) .toString()); @@ -530,6 +549,8 @@ public class PointerLocationView extends View implements InputDeviceListener { final PointerState ps = mPointers.get(id); ps.mCurDown = true; + ps.mHasBoundingBox = (InputDevice.getDevice(event.getDeviceId()). + getMotionRange(MotionEvent.AXIS_GENERIC_1) != null); } final int NI = event.getPointerCount(); @@ -549,8 +570,7 @@ public class PointerLocationView extends View implements InputDeviceListener { final PointerCoords coords = ps != null ? ps.mCoords : mTempCoords; event.getHistoricalPointerCoords(i, historyPos, coords); if (mPrintCoords) { - logCoords("Pointer", action, i, coords, id, - event.getToolType(i), event.getButtonState()); + logCoords("Pointer", action, i, coords, id, event); } if (ps != null) { ps.addTrace(coords.x, coords.y); @@ -563,8 +583,7 @@ public class PointerLocationView extends View implements InputDeviceListener { final PointerCoords coords = ps != null ? ps.mCoords : mTempCoords; event.getPointerCoords(i, coords); if (mPrintCoords) { - logCoords("Pointer", action, i, coords, id, - event.getToolType(i), event.getButtonState()); + logCoords("Pointer", action, i, coords, id, event); } if (ps != null) { ps.addTrace(coords.x, coords.y); @@ -577,6 +596,13 @@ public class PointerLocationView extends View implements InputDeviceListener { mAltVelocity.getEstimator(id, ps.mAltEstimator); } ps.mToolType = event.getToolType(i); + + if (ps.mHasBoundingBox) { + ps.mBoundingLeft = event.getAxisValue(MotionEvent.AXIS_GENERIC_1, i); + ps.mBoundingTop = event.getAxisValue(MotionEvent.AXIS_GENERIC_2, i); + ps.mBoundingRight = event.getAxisValue(MotionEvent.AXIS_GENERIC_3, i); + ps.mBoundingBottom = event.getAxisValue(MotionEvent.AXIS_GENERIC_4, i); + } } } |