Loading packages/SystemUI/src/com/android/systemui/OverviewProxyService.java +35 −1 Original line number Original line Diff line number Diff line Loading @@ -17,6 +17,10 @@ package com.android.systemui; package com.android.systemui; import static android.content.pm.PackageManager.MATCH_DIRECT_BOOT_UNAWARE; import static android.content.pm.PackageManager.MATCH_DIRECT_BOOT_UNAWARE; import static android.view.MotionEvent.ACTION_DOWN; import static android.view.MotionEvent.ACTION_UP; import static android.view.MotionEvent.ACTION_CANCEL; import static com.android.systemui.shared.system.NavigationBarCompat.FLAG_DISABLE_SWIPE_UP; import static com.android.systemui.shared.system.NavigationBarCompat.FLAG_DISABLE_SWIPE_UP; import static com.android.systemui.shared.system.NavigationBarCompat.FLAG_SHOW_OVERVIEW_BUTTON; import static com.android.systemui.shared.system.NavigationBarCompat.FLAG_SHOW_OVERVIEW_BUTTON; import static com.android.systemui.shared.system.NavigationBarCompat.InteractionType; import static com.android.systemui.shared.system.NavigationBarCompat.InteractionType; Loading Loading @@ -86,6 +90,7 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis private boolean mIsEnabled; private boolean mIsEnabled; private int mCurrentBoundedUserId = -1; private int mCurrentBoundedUserId = -1; private float mBackButtonAlpha; private float mBackButtonAlpha; private MotionEvent mStatusBarGestureDownEvent; private ISystemUiProxy mSysUiProxy = new ISystemUiProxy.Stub() { private ISystemUiProxy mSysUiProxy = new ISystemUiProxy.Stub() { Loading @@ -108,6 +113,9 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis } } public void onStatusBarMotionEvent(MotionEvent event) { public void onStatusBarMotionEvent(MotionEvent event) { if (!verifyCaller("onStatusBarMotionEvent")) { return; } long token = Binder.clearCallingIdentity(); long token = Binder.clearCallingIdentity(); try { try { // TODO move this logic to message queue // TODO move this logic to message queue Loading @@ -115,6 +123,16 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis StatusBar bar = SysUiServiceProvider.getComponent(mContext, StatusBar.class); StatusBar bar = SysUiServiceProvider.getComponent(mContext, StatusBar.class); if (bar != null) { if (bar != null) { bar.dispatchNotificationsPanelTouchEvent(event); bar.dispatchNotificationsPanelTouchEvent(event); int action = event.getActionMasked(); if (action == ACTION_DOWN) { mStatusBarGestureDownEvent = MotionEvent.obtain(event); } if (action == ACTION_UP || action == ACTION_CANCEL) { mStatusBarGestureDownEvent.recycle(); mStatusBarGestureDownEvent = null; } event.recycle(); } } }); }); } finally { } finally { Loading Loading @@ -298,7 +316,7 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis // This is the death handler for the binder from the launcher service // This is the death handler for the binder from the launcher service private final IBinder.DeathRecipient mOverviewServiceDeathRcpt private final IBinder.DeathRecipient mOverviewServiceDeathRcpt = this::startConnectionToCurrentUser; = this::cleanupAfterDeath; public OverviewProxyService(Context context) { public OverviewProxyService(Context context) { mContext = context; mContext = context; Loading Loading @@ -328,6 +346,22 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis return mBackButtonAlpha; return mBackButtonAlpha; } } public void cleanupAfterDeath() { if (mStatusBarGestureDownEvent != null) { mHandler.post(()-> { StatusBar bar = SysUiServiceProvider.getComponent(mContext, StatusBar.class); if (bar != null) { System.out.println("MERONG dispatchNotificationPanelTouchEvent"); mStatusBarGestureDownEvent.setAction(MotionEvent.ACTION_CANCEL); bar.dispatchNotificationsPanelTouchEvent(mStatusBarGestureDownEvent); mStatusBarGestureDownEvent.recycle(); mStatusBarGestureDownEvent = null; } }); } startConnectionToCurrentUser(); } public void startConnectionToCurrentUser() { public void startConnectionToCurrentUser() { if (mHandler.getLooper() != Looper.myLooper()) { if (mHandler.getLooper() != Looper.myLooper()) { mHandler.post(mConnectionRunnable); mHandler.post(mConnectionRunnable); Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java +1 −0 Original line number Original line Diff line number Diff line Loading @@ -2852,6 +2852,7 @@ public class StatusBar extends SystemUI implements DemoMode, } } } } else if (Intent.ACTION_SCREEN_OFF.equals(action)) { else if (Intent.ACTION_SCREEN_OFF.equals(action)) { mStatusBarWindowController.setNotTouchable(false); finishBarAnimations(); finishBarAnimations(); resetUserExpandedStates(); resetUserExpandedStates(); } } Loading Loading
packages/SystemUI/src/com/android/systemui/OverviewProxyService.java +35 −1 Original line number Original line Diff line number Diff line Loading @@ -17,6 +17,10 @@ package com.android.systemui; package com.android.systemui; import static android.content.pm.PackageManager.MATCH_DIRECT_BOOT_UNAWARE; import static android.content.pm.PackageManager.MATCH_DIRECT_BOOT_UNAWARE; import static android.view.MotionEvent.ACTION_DOWN; import static android.view.MotionEvent.ACTION_UP; import static android.view.MotionEvent.ACTION_CANCEL; import static com.android.systemui.shared.system.NavigationBarCompat.FLAG_DISABLE_SWIPE_UP; import static com.android.systemui.shared.system.NavigationBarCompat.FLAG_DISABLE_SWIPE_UP; import static com.android.systemui.shared.system.NavigationBarCompat.FLAG_SHOW_OVERVIEW_BUTTON; import static com.android.systemui.shared.system.NavigationBarCompat.FLAG_SHOW_OVERVIEW_BUTTON; import static com.android.systemui.shared.system.NavigationBarCompat.InteractionType; import static com.android.systemui.shared.system.NavigationBarCompat.InteractionType; Loading Loading @@ -86,6 +90,7 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis private boolean mIsEnabled; private boolean mIsEnabled; private int mCurrentBoundedUserId = -1; private int mCurrentBoundedUserId = -1; private float mBackButtonAlpha; private float mBackButtonAlpha; private MotionEvent mStatusBarGestureDownEvent; private ISystemUiProxy mSysUiProxy = new ISystemUiProxy.Stub() { private ISystemUiProxy mSysUiProxy = new ISystemUiProxy.Stub() { Loading @@ -108,6 +113,9 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis } } public void onStatusBarMotionEvent(MotionEvent event) { public void onStatusBarMotionEvent(MotionEvent event) { if (!verifyCaller("onStatusBarMotionEvent")) { return; } long token = Binder.clearCallingIdentity(); long token = Binder.clearCallingIdentity(); try { try { // TODO move this logic to message queue // TODO move this logic to message queue Loading @@ -115,6 +123,16 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis StatusBar bar = SysUiServiceProvider.getComponent(mContext, StatusBar.class); StatusBar bar = SysUiServiceProvider.getComponent(mContext, StatusBar.class); if (bar != null) { if (bar != null) { bar.dispatchNotificationsPanelTouchEvent(event); bar.dispatchNotificationsPanelTouchEvent(event); int action = event.getActionMasked(); if (action == ACTION_DOWN) { mStatusBarGestureDownEvent = MotionEvent.obtain(event); } if (action == ACTION_UP || action == ACTION_CANCEL) { mStatusBarGestureDownEvent.recycle(); mStatusBarGestureDownEvent = null; } event.recycle(); } } }); }); } finally { } finally { Loading Loading @@ -298,7 +316,7 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis // This is the death handler for the binder from the launcher service // This is the death handler for the binder from the launcher service private final IBinder.DeathRecipient mOverviewServiceDeathRcpt private final IBinder.DeathRecipient mOverviewServiceDeathRcpt = this::startConnectionToCurrentUser; = this::cleanupAfterDeath; public OverviewProxyService(Context context) { public OverviewProxyService(Context context) { mContext = context; mContext = context; Loading Loading @@ -328,6 +346,22 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis return mBackButtonAlpha; return mBackButtonAlpha; } } public void cleanupAfterDeath() { if (mStatusBarGestureDownEvent != null) { mHandler.post(()-> { StatusBar bar = SysUiServiceProvider.getComponent(mContext, StatusBar.class); if (bar != null) { System.out.println("MERONG dispatchNotificationPanelTouchEvent"); mStatusBarGestureDownEvent.setAction(MotionEvent.ACTION_CANCEL); bar.dispatchNotificationsPanelTouchEvent(mStatusBarGestureDownEvent); mStatusBarGestureDownEvent.recycle(); mStatusBarGestureDownEvent = null; } }); } startConnectionToCurrentUser(); } public void startConnectionToCurrentUser() { public void startConnectionToCurrentUser() { if (mHandler.getLooper() != Looper.myLooper()) { if (mHandler.getLooper() != Looper.myLooper()) { mHandler.post(mConnectionRunnable); mHandler.post(mConnectionRunnable); Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java +1 −0 Original line number Original line Diff line number Diff line Loading @@ -2852,6 +2852,7 @@ public class StatusBar extends SystemUI implements DemoMode, } } } } else if (Intent.ACTION_SCREEN_OFF.equals(action)) { else if (Intent.ACTION_SCREEN_OFF.equals(action)) { mStatusBarWindowController.setNotTouchable(false); finishBarAnimations(); finishBarAnimations(); resetUserExpandedStates(); resetUserExpandedStates(); } } Loading