Merge changes Ib809d4c5,I05d69da4 into honeycomb
* changes:
This makes the events at the edge of the screen find the button.
some touch event debugging
diff --git a/core/java/android/view/ViewGroup.java b/core/java/android/view/ViewGroup.java
index 58fadb9..5138442 100644
--- a/core/java/android/view/ViewGroup.java
+++ b/core/java/android/view/ViewGroup.java
@@ -129,6 +129,16 @@
private int[] mTmpPointerIds;
private MotionEvent.PointerCoords[] mTmpPointerCoords;
+ // For debugging only. You can see these in hierarchyviewer.
+ @ViewDebug.ExportedProperty(category = "events")
+ private long mLastTouchDownTime;
+ @ViewDebug.ExportedProperty(category = "events")
+ private int mLastTouchDownIndex = -1;
+ @ViewDebug.ExportedProperty(category = "events")
+ private float mLastTouchDownX;
+ @ViewDebug.ExportedProperty(category = "events")
+ private float mLastTouchDownY;
+
/**
* Internal flags.
*
@@ -1157,6 +1167,10 @@
resetCancelNextUpFlag(child);
if (dispatchTransformedTouchEvent(ev, false, child, idBitsToAssign)) {
// Child wants to receive touch within its bounds.
+ mLastTouchDownTime = ev.getDownTime();
+ mLastTouchDownIndex = i;
+ mLastTouchDownX = ev.getX();
+ mLastTouchDownY = ev.getY();
newTouchTarget = addTouchTarget(child, idBitsToAssign);
alreadyDispatchedToNewTouchTarget = true;
break;
@@ -2805,6 +2819,9 @@
}
children[index] = child;
mChildrenCount++;
+ if (mLastTouchDownIndex >= index) {
+ mLastTouchDownIndex++;
+ }
} else {
throw new IndexOutOfBoundsException("index=" + index + " count=" + count);
}
@@ -2825,6 +2842,12 @@
} else {
throw new IndexOutOfBoundsException();
}
+ if (mLastTouchDownIndex == index) {
+ mLastTouchDownTime = 0;
+ mLastTouchDownIndex = -1;
+ } else if (mLastTouchDownIndex > index) {
+ mLastTouchDownIndex--;
+ }
}
// This method also sets the children's mParent to null
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyButtonView.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyButtonView.java
index 5374957..3a7bd90 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyButtonView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyButtonView.java
@@ -78,6 +78,8 @@
mWindowManager = IWindowManager.Stub.asInterface(
ServiceManager.getService(Context.WINDOW_SERVICE));
+
+ setClickable(true);
}
public boolean onTouchEvent(MotionEvent ev) {