am 6cbd3c3d: am 15445a65: Merge "Provide a way for a stylus to access the quick settings menu" into mnc-dev

* commit '6cbd3c3d678e6cdda0eba4c77a06eb12b0bb6e00':
  Provide a way for a stylus to access the quick settings menu
This commit is contained in:
Mady Mellor
2015-05-11 17:52:36 +00:00
committed by Android Git Automerger

View File

@@ -729,7 +729,8 @@ public class NotificationPanelView extends PanelView implements
} }
private boolean handleQsTouch(MotionEvent event) { private boolean handleQsTouch(MotionEvent event) {
if (event.getActionMasked() == MotionEvent.ACTION_DOWN && getExpandedFraction() == 1f final int action = event.getActionMasked();
if (action == MotionEvent.ACTION_DOWN && getExpandedFraction() == 1f
&& mStatusBar.getBarState() != StatusBarState.KEYGUARD && !mQsExpanded && mStatusBar.getBarState() != StatusBarState.KEYGUARD && !mQsExpanded
&& mQsExpansionEnabled) { && mQsExpansionEnabled) {
@@ -750,16 +751,21 @@ public class NotificationPanelView extends PanelView implements
return true; return true;
} }
} }
if (event.getActionMasked() == MotionEvent.ACTION_CANCEL if (action == MotionEvent.ACTION_CANCEL || action == MotionEvent.ACTION_UP) {
|| event.getActionMasked() == MotionEvent.ACTION_UP) {
mConflictingQsExpansionGesture = false; mConflictingQsExpansionGesture = false;
} }
if (event.getActionMasked() == MotionEvent.ACTION_DOWN && isFullyCollapsed() if (action == MotionEvent.ACTION_DOWN && isFullyCollapsed()
&& mQsExpansionEnabled) { && mQsExpansionEnabled) {
mTwoFingerQsExpandPossible = true; mTwoFingerQsExpandPossible = true;
} }
if (mTwoFingerQsExpandPossible && event.getActionMasked() == MotionEvent.ACTION_POINTER_DOWN final int pointerCount = event.getPointerCount();
&& event.getPointerCount() == 2 final boolean twoFingerDrag = action == MotionEvent.ACTION_POINTER_DOWN
&& pointerCount == 2;
final boolean stylusClickDrag = action == MotionEvent.ACTION_DOWN
&& pointerCount == 1 && event.getToolType(0) == MotionEvent.TOOL_TYPE_STYLUS
&& (event.isButtonPressed(MotionEvent.BUTTON_SECONDARY)
|| event.isButtonPressed(MotionEvent.BUTTON_TERTIARY));
if (mTwoFingerQsExpandPossible && (twoFingerDrag || stylusClickDrag)
&& event.getY(event.getActionIndex()) < mStatusBarMinHeight) { && event.getY(event.getActionIndex()) < mStatusBarMinHeight) {
MetricsLogger.count(mContext, COUNTER_PANEL_OPEN_QS, 1); MetricsLogger.count(mContext, COUNTER_PANEL_OPEN_QS, 1);
mQsExpandImmediate = true; mQsExpandImmediate = true;