Loading packages/SystemUI/shared/src/com/android/systemui/shared/recents/ISystemUiProxy.aidl +7 −0 Original line number Diff line number Diff line Loading @@ -17,6 +17,8 @@ package com.android.systemui.shared.recents; import android.graphics.Rect; import android.view.MotionEvent; import com.android.systemui.shared.system.GraphicBufferCompat; /** Loading Loading @@ -60,4 +62,9 @@ interface ISystemUiProxy { * needed from current value */ void setBackButtonAlpha(float alpha, boolean animate) = 8; /** * Notifies SystemUI that StatusBar is moving. */ void onStatusBarMotionEvent(in MotionEvent event) = 9; } packages/SystemUI/src/com/android/systemui/OverviewProxyService.java +44 −1 Original line number Diff line number Diff line Loading @@ -31,6 +31,7 @@ import android.os.PatternMatcher; import android.os.RemoteException; import android.os.UserHandle; import android.util.Log; import android.view.MotionEvent; import android.view.SurfaceControl; import com.android.systemui.OverviewProxyService.OverviewProxyListener; Loading Loading @@ -81,6 +82,7 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis private int mConnectionBackoffAttempts; private @InteractionType int mInteractionFlags; private boolean mIsEnabled; private MotionEvent mStatusBarGestureDownEvent; private ISystemUiProxy mSysUiProxy = new ISystemUiProxy.Stub() { Loading Loading @@ -172,6 +174,31 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis Binder.restoreCallingIdentity(token); } } public void onStatusBarMotionEvent(MotionEvent motionEvent) { long token = Binder.clearCallingIdentity(); try { mHandler.post(() -> { StatusBar statusBar = ((SystemUIApplication) mContext).getComponent( StatusBar.class); if (statusBar != null) { statusBar.dispatchNotificationsPanelTouchEvent(motionEvent); int actionMasked = motionEvent.getActionMasked(); if (actionMasked == MotionEvent.ACTION_DOWN) { mStatusBarGestureDownEvent = MotionEvent.obtain(motionEvent); } if (actionMasked == MotionEvent.ACTION_UP || actionMasked == MotionEvent.ACTION_CANCEL) { mStatusBarGestureDownEvent.recycle(); mStatusBarGestureDownEvent = null; } motionEvent.recycle(); } }); } finally { Binder.restoreCallingIdentity(token); } } }; private final Runnable mDeferredConnectionCallback = () -> { Loading Loading @@ -252,7 +279,7 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis // This is the death handler for the binder from the launcher service private final IBinder.DeathRecipient mOverviewServiceDeathRcpt = this::startConnectionToCurrentUser; = this::cleanupAfterDeath; public OverviewProxyService(Context context) { mContext = context; Loading @@ -278,6 +305,22 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis } } public void cleanupAfterDeath() { if (mStatusBarGestureDownEvent != null) { mHandler.post(() -> { StatusBar statusBar = ((SystemUIApplication) mContext).getComponent( StatusBar.class); if (statusBar != null) { mStatusBarGestureDownEvent.setAction(MotionEvent.ACTION_CANCEL); statusBar.dispatchNotificationsPanelTouchEvent(mStatusBarGestureDownEvent); mStatusBarGestureDownEvent.recycle(); mStatusBarGestureDownEvent = null; } }); } startConnectionToCurrentUser(); } public void startConnectionToCurrentUser() { if (mHandler.getLooper() != Looper.myLooper()) { mHandler.post(mConnectionRunnable); Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java +12 −0 Original line number Diff line number Diff line Loading @@ -2465,6 +2465,18 @@ public class StatusBar extends SystemUI implements DemoMode, TunerService.Tunabl mStatusBarKeyguardViewManager.readyForKeyguardDone(); } public void dispatchNotificationsPanelTouchEvent(MotionEvent motionEvent) { if (panelsEnabled()) { mNotificationPanel.dispatchTouchEvent(motionEvent); int action = motionEvent.getAction(); if (action == MotionEvent.ACTION_DOWN) { mStatusBarWindowManager.setNotTouchable(true); } else if (action == MotionEvent.ACTION_UP || action == MotionEvent.ACTION_CANCEL) { mStatusBarWindowManager.setNotTouchable(false); } } } @Override public void animateExpandNotificationsPanel() { if (SPEW) Log.d(TAG, "animateExpand: mExpandedVisible=" + mExpandedVisible); Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowManager.java +15 −0 Original line number Diff line number Diff line Loading @@ -268,6 +268,7 @@ public class StatusBarWindowManager implements RemoteInputController.Callback, D applyBrightness(state); applyHasTopUi(state); applySleepToken(state); applyNotTouchable(state); if (mLp.copyFrom(mLpChanged) != 0) { mWindowManager.updateViewLayout(mStatusBarView, mLp); } Loading Loading @@ -311,6 +312,14 @@ public class StatusBarWindowManager implements RemoteInputController.Callback, D mHasTopUiChanged = isExpanded(state); } private void applyNotTouchable(State state) { if (state.notTouchable) { mLpChanged.flags |= WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE; } else { mLpChanged.flags &= ~WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE; } } private void applySleepToken(State state) { if (state.dozing) { mLpChanged.privateFlags |= LayoutParams.PRIVATE_FLAG_ACQUIRES_SLEEP_TOKEN; Loading Loading @@ -443,6 +452,11 @@ public class StatusBarWindowManager implements RemoteInputController.Callback, D apply(mCurrentState); } public void setNotTouchable(boolean notTouchable) { mCurrentState.notTouchable = notTouchable; apply(mCurrentState); } public void setStateListener(OtherwisedCollapsedListener listener) { mListener = listener; } Loading Loading @@ -473,6 +487,7 @@ public class StatusBarWindowManager implements RemoteInputController.Callback, D boolean forceUserActivity; boolean backdropShowing; boolean wallpaperSupportsAmbientMode; boolean notTouchable; /** * The {@link StatusBar} state from the status bar. Loading Loading
packages/SystemUI/shared/src/com/android/systemui/shared/recents/ISystemUiProxy.aidl +7 −0 Original line number Diff line number Diff line Loading @@ -17,6 +17,8 @@ package com.android.systemui.shared.recents; import android.graphics.Rect; import android.view.MotionEvent; import com.android.systemui.shared.system.GraphicBufferCompat; /** Loading Loading @@ -60,4 +62,9 @@ interface ISystemUiProxy { * needed from current value */ void setBackButtonAlpha(float alpha, boolean animate) = 8; /** * Notifies SystemUI that StatusBar is moving. */ void onStatusBarMotionEvent(in MotionEvent event) = 9; }
packages/SystemUI/src/com/android/systemui/OverviewProxyService.java +44 −1 Original line number Diff line number Diff line Loading @@ -31,6 +31,7 @@ import android.os.PatternMatcher; import android.os.RemoteException; import android.os.UserHandle; import android.util.Log; import android.view.MotionEvent; import android.view.SurfaceControl; import com.android.systemui.OverviewProxyService.OverviewProxyListener; Loading Loading @@ -81,6 +82,7 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis private int mConnectionBackoffAttempts; private @InteractionType int mInteractionFlags; private boolean mIsEnabled; private MotionEvent mStatusBarGestureDownEvent; private ISystemUiProxy mSysUiProxy = new ISystemUiProxy.Stub() { Loading Loading @@ -172,6 +174,31 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis Binder.restoreCallingIdentity(token); } } public void onStatusBarMotionEvent(MotionEvent motionEvent) { long token = Binder.clearCallingIdentity(); try { mHandler.post(() -> { StatusBar statusBar = ((SystemUIApplication) mContext).getComponent( StatusBar.class); if (statusBar != null) { statusBar.dispatchNotificationsPanelTouchEvent(motionEvent); int actionMasked = motionEvent.getActionMasked(); if (actionMasked == MotionEvent.ACTION_DOWN) { mStatusBarGestureDownEvent = MotionEvent.obtain(motionEvent); } if (actionMasked == MotionEvent.ACTION_UP || actionMasked == MotionEvent.ACTION_CANCEL) { mStatusBarGestureDownEvent.recycle(); mStatusBarGestureDownEvent = null; } motionEvent.recycle(); } }); } finally { Binder.restoreCallingIdentity(token); } } }; private final Runnable mDeferredConnectionCallback = () -> { Loading Loading @@ -252,7 +279,7 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis // This is the death handler for the binder from the launcher service private final IBinder.DeathRecipient mOverviewServiceDeathRcpt = this::startConnectionToCurrentUser; = this::cleanupAfterDeath; public OverviewProxyService(Context context) { mContext = context; Loading @@ -278,6 +305,22 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis } } public void cleanupAfterDeath() { if (mStatusBarGestureDownEvent != null) { mHandler.post(() -> { StatusBar statusBar = ((SystemUIApplication) mContext).getComponent( StatusBar.class); if (statusBar != null) { mStatusBarGestureDownEvent.setAction(MotionEvent.ACTION_CANCEL); statusBar.dispatchNotificationsPanelTouchEvent(mStatusBarGestureDownEvent); mStatusBarGestureDownEvent.recycle(); mStatusBarGestureDownEvent = null; } }); } startConnectionToCurrentUser(); } public void startConnectionToCurrentUser() { if (mHandler.getLooper() != Looper.myLooper()) { mHandler.post(mConnectionRunnable); Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java +12 −0 Original line number Diff line number Diff line Loading @@ -2465,6 +2465,18 @@ public class StatusBar extends SystemUI implements DemoMode, TunerService.Tunabl mStatusBarKeyguardViewManager.readyForKeyguardDone(); } public void dispatchNotificationsPanelTouchEvent(MotionEvent motionEvent) { if (panelsEnabled()) { mNotificationPanel.dispatchTouchEvent(motionEvent); int action = motionEvent.getAction(); if (action == MotionEvent.ACTION_DOWN) { mStatusBarWindowManager.setNotTouchable(true); } else if (action == MotionEvent.ACTION_UP || action == MotionEvent.ACTION_CANCEL) { mStatusBarWindowManager.setNotTouchable(false); } } } @Override public void animateExpandNotificationsPanel() { if (SPEW) Log.d(TAG, "animateExpand: mExpandedVisible=" + mExpandedVisible); Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowManager.java +15 −0 Original line number Diff line number Diff line Loading @@ -268,6 +268,7 @@ public class StatusBarWindowManager implements RemoteInputController.Callback, D applyBrightness(state); applyHasTopUi(state); applySleepToken(state); applyNotTouchable(state); if (mLp.copyFrom(mLpChanged) != 0) { mWindowManager.updateViewLayout(mStatusBarView, mLp); } Loading Loading @@ -311,6 +312,14 @@ public class StatusBarWindowManager implements RemoteInputController.Callback, D mHasTopUiChanged = isExpanded(state); } private void applyNotTouchable(State state) { if (state.notTouchable) { mLpChanged.flags |= WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE; } else { mLpChanged.flags &= ~WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE; } } private void applySleepToken(State state) { if (state.dozing) { mLpChanged.privateFlags |= LayoutParams.PRIVATE_FLAG_ACQUIRES_SLEEP_TOKEN; Loading Loading @@ -443,6 +452,11 @@ public class StatusBarWindowManager implements RemoteInputController.Callback, D apply(mCurrentState); } public void setNotTouchable(boolean notTouchable) { mCurrentState.notTouchable = notTouchable; apply(mCurrentState); } public void setStateListener(OtherwisedCollapsedListener listener) { mListener = listener; } Loading Loading @@ -473,6 +487,7 @@ public class StatusBarWindowManager implements RemoteInputController.Callback, D boolean forceUserActivity; boolean backdropShowing; boolean wallpaperSupportsAmbientMode; boolean notTouchable; /** * The {@link StatusBar} state from the status bar. Loading