Enable touch splitting for all windows by default.

New default only applies to applications with targetSdkVersion >=
HONEYCOMB.  Old applications default to no touch splitting for
their windows.

In addition, enabled split touch for various system windows.

Bug: 3049580
Change-Id: Idc8da9baa2cd8e1e4e76af8967d7b6a5ccb94427
This commit is contained in:
Jeff Brown 2010-11-10 16:53:45 -08:00
parent ead98b9cae
commit e33a9ecc25
2 changed files with 10 additions and 10 deletions

View File

@ -219,6 +219,8 @@ struct InputWindow {
* motion events to be delivered to them with AMOTION_EVENT_FLAG_WINDOW_IS_OBSCURED.
*/
bool isTrustedOverlay() const;
bool supportsSplitTouch() const;
};
@ -946,7 +948,7 @@ private:
struct TouchedWindow {
const InputWindow* window;
int32_t targetFlags;
BitSet32 pointerIds;
BitSet32 pointerIds; // zero unless target flag FLAG_SPLIT is set
sp<InputChannel> channel;
};
struct TouchState {

View File

@ -157,6 +157,10 @@ bool InputWindow::isTrustedOverlay() const {
|| layoutParamsType == TYPE_SECURE_SYSTEM_OVERLAY;
}
bool InputWindow::supportsSplitTouch() const {
return layoutParamsFlags & InputWindow::FLAG_SPLIT_TOUCH;
}
// --- InputDispatcher ---
@ -1110,8 +1114,7 @@ int32_t InputDispatcher::findTouchedWindowTargetsLocked(nsecs_t currentTime,
}
// Figure out whether splitting will be allowed for this window.
if (newTouchedWindow
&& (newTouchedWindow->layoutParamsFlags & InputWindow::FLAG_SPLIT_TOUCH)) {
if (newTouchedWindow && newTouchedWindow->supportsSplitTouch()) {
// New window supports splitting.
isSplit = true;
} else if (isSplit) {
@ -2648,13 +2651,8 @@ bool InputDispatcher::transferTouchFocus(const sp<InputChannel>& fromChannel,
mTouchState.windows.removeAt(i);
int32_t newTargetFlags = 0;
if (oldTargetFlags & InputTarget::FLAG_FOREGROUND) {
newTargetFlags |= InputTarget::FLAG_FOREGROUND;
if (toWindow->layoutParamsFlags & InputWindow::FLAG_SPLIT_TOUCH) {
newTargetFlags |= InputTarget::FLAG_SPLIT;
}
}
int32_t newTargetFlags = oldTargetFlags
& (InputTarget::FLAG_FOREGROUND | InputTarget::FLAG_SPLIT);
mTouchState.addOrUpdateWindow(toWindow, newTargetFlags, pointerIds);
found = true;