AOD: Enable double tap in AOD
Bug: 30876804 Test: Enable AOD; turn off phone, double tap; receive notification, double tap outside notification; on lockscreen, tap shade, should still bounce Change-Id: Ifb32461432f64c333b3a86a29b5ac51dfc27a43d
This commit is contained in:
@@ -766,16 +766,17 @@ public class NotificationPanelView extends PanelView implements
|
||||
mIsExpansionFromHeadsUp = true;
|
||||
MetricsLogger.count(mContext, COUNTER_PANEL_OPEN_PEEK, 1);
|
||||
}
|
||||
boolean handled = false;
|
||||
if ((!mIsExpanding || mHintAnimationRunning)
|
||||
&& !mQsExpanded
|
||||
&& mStatusBar.getBarState() != StatusBarState.SHADE
|
||||
&& !mDozing) {
|
||||
mAffordanceHelper.onTouchEvent(event);
|
||||
handled |= mAffordanceHelper.onTouchEvent(event);
|
||||
}
|
||||
if (mOnlyAffordanceInThisMotion) {
|
||||
return true;
|
||||
}
|
||||
mHeadsUpTouchHelper.onTouchEvent(event);
|
||||
handled |= mHeadsUpTouchHelper.onTouchEvent(event);
|
||||
|
||||
if (mQsOverscrollExpansionEnabled && !mHeadsUpTouchHelper.isTrackingHeadsUp()
|
||||
&& handleQsTouch(event)) {
|
||||
@@ -784,9 +785,10 @@ public class NotificationPanelView extends PanelView implements
|
||||
if (event.getActionMasked() == MotionEvent.ACTION_DOWN && isFullyCollapsed()) {
|
||||
MetricsLogger.count(mContext, COUNTER_PANEL_OPEN, 1);
|
||||
updateVerticalPanelPosition(event.getX());
|
||||
handled = true;
|
||||
}
|
||||
super.onTouchEvent(event);
|
||||
return true;
|
||||
handled |= super.onTouchEvent(event);
|
||||
return mDozing ? handled : true;
|
||||
}
|
||||
|
||||
private boolean handleQsTouch(MotionEvent event) {
|
||||
|
||||
@@ -4872,7 +4872,7 @@ public class StatusBar extends SystemUI implements DemoMode,
|
||||
}
|
||||
|
||||
public void wakeUpIfDozing(long time, View where) {
|
||||
if (mDozing && mDozeScrimController.isPulsing()) {
|
||||
if (mDozing) {
|
||||
PowerManager pm = (PowerManager) mContext.getSystemService(Context.POWER_SERVICE);
|
||||
pm.wakeUp(time, "com.android.systemui:NODOZE");
|
||||
mWakeUpComingFromTouch = true;
|
||||
|
||||
@@ -34,6 +34,7 @@ import android.media.session.MediaSessionLegacyHelper;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.os.IBinder;
|
||||
import android.os.SystemClock;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.ActionMode;
|
||||
import android.view.InputQueue;
|
||||
@@ -65,6 +66,7 @@ public class StatusBarWindowView extends FrameLayout {
|
||||
public static final boolean DEBUG = StatusBar.DEBUG;
|
||||
|
||||
private DragDownHelper mDragDownHelper;
|
||||
private DoubleTapHelper mDoubleTapHelper;
|
||||
private NotificationStackScrollLayout mStackScrollLayout;
|
||||
private NotificationPanelView mNotificationPanel;
|
||||
private View mBrightnessMirror;
|
||||
@@ -89,6 +91,10 @@ public class StatusBarWindowView extends FrameLayout {
|
||||
mTransparentSrcPaint.setColor(0);
|
||||
mTransparentSrcPaint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.SRC));
|
||||
mFalsingManager = FalsingManager.getInstance(context);
|
||||
mDoubleTapHelper = new DoubleTapHelper(this, active -> {}, () -> {
|
||||
mService.wakeUpIfDozing(SystemClock.uptimeMillis(), this);
|
||||
return true;
|
||||
}, null, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -256,7 +262,7 @@ public class StatusBarWindowView extends FrameLayout {
|
||||
@Override
|
||||
public boolean onInterceptTouchEvent(MotionEvent ev) {
|
||||
if (mService.isDozing() && !mService.isPulsing()) {
|
||||
// Discard all touch events in always-on.
|
||||
// Capture all touch events in always-on.
|
||||
return true;
|
||||
}
|
||||
boolean intercept = false;
|
||||
@@ -282,7 +288,11 @@ public class StatusBarWindowView extends FrameLayout {
|
||||
|
||||
@Override
|
||||
public boolean onTouchEvent(MotionEvent ev) {
|
||||
boolean handled = mService.isDozing() && !mService.isPulsing();
|
||||
boolean handled = false;
|
||||
if (mService.isDozing()) {
|
||||
mDoubleTapHelper.onTouchEvent(ev);
|
||||
handled = true;
|
||||
}
|
||||
if (mService.getBarState() == StatusBarState.KEYGUARD
|
||||
&& (!handled || mDragDownHelper.isDraggingDown())) {
|
||||
// we still want to finish our drag down gesture when locking the screen
|
||||
|
||||
Reference in New Issue
Block a user