diff options
author | Jeff Brown <jeffbrown@google.com> | 2010-11-10 16:53:45 -0800 |
---|---|---|
committer | Jeff Brown <jeffbrown@google.com> | 2010-11-12 14:53:43 -0800 |
commit | 46e75294d540fe807d78aec2582ae02cc38c7d42 (patch) | |
tree | 260678b7532242c8dd31e3aba47710e9516a3c12 /libs | |
parent | 1a22bdb01ac4068c2876fe2d02f3c4c729669a1c (diff) | |
download | frameworks_base-46e75294d540fe807d78aec2582ae02cc38c7d42.zip frameworks_base-46e75294d540fe807d78aec2582ae02cc38c7d42.tar.gz frameworks_base-46e75294d540fe807d78aec2582ae02cc38c7d42.tar.bz2 |
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
Diffstat (limited to 'libs')
-rw-r--r-- | libs/ui/InputDispatcher.cpp | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/libs/ui/InputDispatcher.cpp b/libs/ui/InputDispatcher.cpp index 7ddb3c7..db7d448 100644 --- a/libs/ui/InputDispatcher.cpp +++ b/libs/ui/InputDispatcher.cpp @@ -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; |