Merge "Swipe down on Pixel Launcher expands Notification Shade Bug: 111839343 Test: make -j31 && vendor/google/tools/flashall"

This commit is contained in:
TreeHugger Robot
2018-08-27 21:30:43 +00:00
committed by Android (Google) Code Review
4 changed files with 58 additions and 0 deletions

View File

@@ -17,6 +17,7 @@
package com.android.systemui.shared.recents;
import android.graphics.Rect;
import android.view.MotionEvent;
/**
* Temporary callbacks into SystemUI.
@@ -60,4 +61,14 @@ interface ISystemUiProxy {
* needed from current value
*/
void setBackButtonAlpha(float alpha, boolean animate) = 8;
/**
* Proxies motion events from the homescreen UI to the status bar. Only called when
* swipe down is detected on WORKSPACE. The sender guarantees the following order of events on
* the tracking pointer.
*
* Normal gesture: DOWN, MOVE/POINTER_DOWN/POINTER_UP)*, UP or CANCLE
*/
void onStatusBarMotionEvent(in MotionEvent event) = 9;
}

View File

@@ -32,6 +32,7 @@ import android.os.RemoteException;
import android.os.UserHandle;
import android.provider.Settings;
import android.util.Log;
import android.view.MotionEvent;
import com.android.systemui.OverviewProxyService.OverviewProxyListener;
import com.android.systemui.recents.events.EventBus;
@@ -111,6 +112,21 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis
}
}
public void onStatusBarMotionEvent(MotionEvent event) {
long token = Binder.clearCallingIdentity();
try {
// TODO move this logic to message queue
mHandler.post(()->{
StatusBar bar = SysUiServiceProvider.getComponent(mContext, StatusBar.class);
if (bar != null) {
bar.dispatchNotificationsPanelTouchEvent(event);
}
});
} finally {
Binder.restoreCallingIdentity(token);
}
}
public void onSplitScreenInvoked() {
if (!verifyCaller("onSplitScreenInvoked")) {
return;

View File

@@ -2148,6 +2148,22 @@ public class StatusBar extends SystemUI implements DemoMode,
mStatusBarKeyguardViewManager.readyForKeyguardDone();
}
public void dispatchNotificationsPanelTouchEvent(MotionEvent ev) {
if (!panelsEnabled()) {
return;
}
mNotificationPanel.dispatchTouchEvent(ev);
int action = ev.getAction();
if (action == MotionEvent.ACTION_DOWN) {
// Start ignoring all touch events coming to status bar window.
// TODO: handle case where ACTION_UP is not sent over the binder
mStatusBarWindowController.setNotTouchable(true);
} else if (action == MotionEvent.ACTION_UP || action == MotionEvent.ACTION_CANCEL) {
mStatusBarWindowController.setNotTouchable(false);
}
}
@Override
public void animateExpandNotificationsPanel() {
if (SPEW) Log.d(TAG, "animateExpand: mExpandedVisible=" + mExpandedVisible);

View File

@@ -279,6 +279,7 @@ public class StatusBarWindowController implements Callback, Dumpable, Configurat
applyBrightness(state);
applyHasTopUi(state);
applySleepToken(state);
applyNotTouchable(state);
if (mLp.copyFrom(mLpChanged) != 0) {
mWindowManager.updateViewLayout(mStatusBarView, mLp);
}
@@ -330,6 +331,14 @@ public class StatusBarWindowController implements Callback, Dumpable, Configurat
}
}
private void applyNotTouchable(State state) {
if (state.notTouchable) {
mLpChanged.flags |= LayoutParams.FLAG_NOT_TOUCHABLE;
} else {
mLpChanged.flags &= ~LayoutParams.FLAG_NOT_TOUCHABLE;
}
}
public void setKeyguardShowing(boolean showing) {
mCurrentState.keyguardShowing = showing;
apply(mCurrentState);
@@ -454,6 +463,11 @@ public class StatusBarWindowController implements Callback, Dumpable, Configurat
apply(mCurrentState);
}
public void setNotTouchable(boolean notTouchable) {
mCurrentState.notTouchable = notTouchable;
apply(mCurrentState);
}
public void setStateListener(OtherwisedCollapsedListener listener) {
mListener = listener;
}
@@ -501,6 +515,7 @@ public class StatusBarWindowController implements Callback, Dumpable, Configurat
boolean forceUserActivity;
boolean backdropShowing;
boolean wallpaperSupportsAmbientMode;
boolean notTouchable;
/**
* The {@link StatusBar} state from the status bar.