From 4018231a6ccc45824a7d0cff5186e379f1926fef Mon Sep 17 00:00:00 2001 From: Roman Birg Date: Thu, 19 May 2016 20:47:10 -0700 Subject: SystemUI: fix multi touch gestures and extra jank The dejank utils were getting a little ahead of themselves: in between the panel height being set to 0 (could happen often), and the user actively trying to expand the panel, the next layout traversal from the dejank utils would try to collapse the panel, causing bad states. Also in the qs height animator updater, be careful to only actively update the end height when the user did not just peak. Finally, and most importantly, we need to disable motion event splitting in our view that holds our notification panel logic so we can get multi touch gestures in those views properly. Ticket: CYNGNOS-2756 Change-Id: I2cda440d4e0548d3477c6fad88f7dac1cb59d9db Signed-off-by: Roman Birg --- .../src/com/android/systemui/statusbar/phone/NavBarInsetLayout.java | 1 + .../com/android/systemui/statusbar/phone/NotificationPanelView.java | 3 ++- .../SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java | 2 +- .../src/com/android/systemui/statusbar/phone/PhoneStatusBar.java | 2 +- .../src/com/android/systemui/statusbar/phone/PhoneStatusBarView.java | 1 + 5 files changed, 6 insertions(+), 3 deletions(-) (limited to 'packages') diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavBarInsetLayout.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavBarInsetLayout.java index e767ca5..2028132 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavBarInsetLayout.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavBarInsetLayout.java @@ -63,6 +63,7 @@ public class NavBarInsetLayout extends FrameLayout { public NavBarInsetLayout(Context context, AttributeSet attrs) { super(context, attrs); + setMotionEventSplittingEnabled(false); mTransparentSrcPaint.setColor(0); mTransparentSrcPaint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.SRC)); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java index cc98714..4de6271 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java @@ -1086,7 +1086,8 @@ public class NotificationPanelView extends PanelView implements mTwoFingerQsExpandPossible = true; } if (mTwoFingerQsExpandPossible && isOpenQsEvent(event) - && event.getY(event.getActionIndex()) < mStatusBarMinHeight) { + && event.getY(event.getActionIndex()) < mStatusBarMinHeight + && mExpandedHeight < mQsPeekHeight) { MetricsLogger.count(mContext, COUNTER_PANEL_OPEN_QS, 1); mQsExpandImmediate = true; requestPanelHeightUpdate(); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java index e5711b8..ae565ed 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java @@ -94,7 +94,7 @@ public abstract class PanelView extends FrameLayout { public void onLayoutChange(View v, int left, int top, int right, int bottom, int oldLeft, int oldTop, int oldRight, int oldBottom) { // update expand height - if (mHeightAnimator != null && mExpanding && mUpdateExpandOnLayout) { + if (mHeightAnimator != null && mExpanding && mUpdateExpandOnLayout && !mJustPeeked) { final int maxPanelHeight = getMaxPanelHeight(); final PropertyValuesHolder[] values = mHeightAnimator.getValues(); values[0].setFloatValues(maxPanelHeight); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java index cf69cf0..20a195c 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java @@ -2969,7 +2969,7 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, setInteracting(StatusBarManager.WINDOW_STATUS_BAR, true); } } - if (mBrightnessChanged && upOrCancel) { + if (mBrightnessChanged && upOrCancel && !isQsExpanded()) { mBrightnessChanged = false; if (mJustPeeked && mExpandedVisible) { mNotificationPanel.fling(10, false); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarView.java index 3b068d6..8c9daee 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarView.java @@ -111,6 +111,7 @@ public class PhoneStatusBarView extends PanelBar { @Override public void onPanelPeeked() { super.onPanelPeeked(); + removePendingHideExpandedRunnables(); mBar.makeExpandedVisible(false); } -- cgit v1.1