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
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 @@
|| layoutParamsType == TYPE_SECURE_SYSTEM_OVERLAY;
}
+bool InputWindow::supportsSplitTouch() const {
+ return layoutParamsFlags & InputWindow::FLAG_SPLIT_TOUCH;
+}
+
// --- InputDispatcher ---
@@ -1110,8 +1114,7 @@
}
// 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 @@
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;