Loading packages/SystemUI/shared/src/com/android/systemui/shared/recents/IOverviewProxy.aidl +6 −6 Original line number Diff line number Diff line Loading @@ -36,25 +36,25 @@ oneway interface IOverviewProxy { /** * Sent when a user has quickly flinged on the nav bar to switch tasks. Once this event is sent * the caller will stop sending any motion events. * the caller will stop sending any motion events and will no longer preemptively cancel any * recents animations started as a part of the motion event handling. */ void onQuickSwitch(); /** * Sent when the user starts to actively scrub the nav bar to switch tasks. Once this event is * sent the caller will stop sending any motion events. * sent the caller will stop sending any motion events and will no longer preemptively cancel * any recents animations started as a part of the motion event handling. */ void onQuickScrubStart(); /** * Sent when the user stops actively scrubbing the nav bar to switch tasks. Once this event is * sent the caller will stop sending any motion events. * Sent when the user stops actively scrubbing the nav bar to switch tasks. */ void onQuickScrubEnd(); /** * Sent for each movement over the nav bar while the user is scrubbing it to switch tasks. Once * this event is sent the caller will stop sending any motion events. * Sent for each movement over the nav bar while the user is scrubbing it to switch tasks. */ void onQuickScrubProgress(float progress); } packages/SystemUI/src/com/android/systemui/OverviewProxyService.java +1 −3 Original line number Diff line number Diff line Loading @@ -99,9 +99,7 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis public void onRecentsAnimationStarted() { long token = Binder.clearCallingIdentity(); try { mHandler.post(() -> { notifyRecentsAnimationStarted(); }); mHandler.post(OverviewProxyService.this::notifyRecentsAnimationStarted); } finally { Binder.restoreCallingIdentity(token); } Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarGestureHelper.java +12 −18 Original line number Diff line number Diff line Loading @@ -28,7 +28,6 @@ import android.content.res.Resources; import android.graphics.Canvas; import android.graphics.Matrix; import android.graphics.Rect; import android.os.Handler; import android.os.RemoteException; import android.util.Log; import android.view.MotionEvent; Loading Loading @@ -159,25 +158,19 @@ public class NavigationBarGestureHelper implements TunerService.Tunable, Gesture mRecentsAnimationStarted = false; break; } case MotionEvent.ACTION_UP: { // If the overview proxy service has not started the recents animation then clean up // after it to ensure that the nav bar buttons still work if (mOverviewProxyService.getProxy() != null && !mRecentsAnimationStarted) { try { ActivityManager.getService().cancelRecentsAnimation(); } catch (RemoteException e) { Log.e(TAG, "Could not cancel recents animation", e); } } break; } } if (mStatusBar.isPresenterFullyCollapsed() && !mQuickScrubController.onInterceptTouchEvent(event)) { boolean handledByQuickscrub = mQuickScrubController.onInterceptTouchEvent(event); if (mStatusBar.isPresenterFullyCollapsed() && !handledByQuickscrub) { // Proxy motion events until we start intercepting for quickscrub proxyMotionEvents(event); return false; } return (mDockWindowEnabled && interceptDockWindowEvent(event)) || mRecentsAnimationStarted; boolean result = handledByQuickscrub; result |= mRecentsAnimationStarted; if (mDockWindowEnabled) { result |= interceptDockWindowEvent(event); } return result; } public boolean onTouchEvent(MotionEvent event) { Loading @@ -188,10 +181,11 @@ public class NavigationBarGestureHelper implements TunerService.Tunable, Gesture && (mQuickScrubController.onTouchEvent(event) || ignoreProxyDownEvent || proxyMotionEvents(event)); result |= mRecentsAnimationStarted; if (mDockWindowEnabled) { result |= handleDockWindowEvent(event); } return result || mRecentsAnimationStarted; return result; } public void onDraw(Canvas canvas) { Loading packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyButtonView.java +10 −0 Original line number Diff line number Diff line Loading @@ -27,10 +27,12 @@ import android.media.AudioManager; import android.metrics.LogMaker; import android.os.AsyncTask; import android.os.Bundle; import android.os.RemoteException; import android.os.SystemClock; import android.os.VibrationEffect; import android.os.Vibrator; import android.util.AttributeSet; import android.util.Log; import android.util.TypedValue; import android.view.HapticFeedbackConstants; import android.view.InputDevice; Loading @@ -55,6 +57,7 @@ import static android.view.accessibility.AccessibilityNodeInfo.ACTION_CLICK; import static android.view.accessibility.AccessibilityNodeInfo.ACTION_LONG_CLICK; public class KeyButtonView extends ImageView implements ButtonInterface { private static final String TAG = KeyButtonView.class.getSimpleName(); private final boolean mPlaySounds; private int mContentDescriptionRes; Loading Loading @@ -264,6 +267,13 @@ public class KeyButtonView extends ImageView implements ButtonInterface { } if (mCode != 0) { if (doIt) { // If there was a pending remote recents animation, then we need to // cancel the animation now before we handle the button itself try { ActivityManager.getService().cancelRecentsAnimation(); } catch (RemoteException e) { Log.e(TAG, "Could not cancel recents animation", e); } sendEvent(KeyEvent.ACTION_UP, 0); sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_CLICKED); } else { Loading Loading
packages/SystemUI/shared/src/com/android/systemui/shared/recents/IOverviewProxy.aidl +6 −6 Original line number Diff line number Diff line Loading @@ -36,25 +36,25 @@ oneway interface IOverviewProxy { /** * Sent when a user has quickly flinged on the nav bar to switch tasks. Once this event is sent * the caller will stop sending any motion events. * the caller will stop sending any motion events and will no longer preemptively cancel any * recents animations started as a part of the motion event handling. */ void onQuickSwitch(); /** * Sent when the user starts to actively scrub the nav bar to switch tasks. Once this event is * sent the caller will stop sending any motion events. * sent the caller will stop sending any motion events and will no longer preemptively cancel * any recents animations started as a part of the motion event handling. */ void onQuickScrubStart(); /** * Sent when the user stops actively scrubbing the nav bar to switch tasks. Once this event is * sent the caller will stop sending any motion events. * Sent when the user stops actively scrubbing the nav bar to switch tasks. */ void onQuickScrubEnd(); /** * Sent for each movement over the nav bar while the user is scrubbing it to switch tasks. Once * this event is sent the caller will stop sending any motion events. * Sent for each movement over the nav bar while the user is scrubbing it to switch tasks. */ void onQuickScrubProgress(float progress); }
packages/SystemUI/src/com/android/systemui/OverviewProxyService.java +1 −3 Original line number Diff line number Diff line Loading @@ -99,9 +99,7 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis public void onRecentsAnimationStarted() { long token = Binder.clearCallingIdentity(); try { mHandler.post(() -> { notifyRecentsAnimationStarted(); }); mHandler.post(OverviewProxyService.this::notifyRecentsAnimationStarted); } finally { Binder.restoreCallingIdentity(token); } Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarGestureHelper.java +12 −18 Original line number Diff line number Diff line Loading @@ -28,7 +28,6 @@ import android.content.res.Resources; import android.graphics.Canvas; import android.graphics.Matrix; import android.graphics.Rect; import android.os.Handler; import android.os.RemoteException; import android.util.Log; import android.view.MotionEvent; Loading Loading @@ -159,25 +158,19 @@ public class NavigationBarGestureHelper implements TunerService.Tunable, Gesture mRecentsAnimationStarted = false; break; } case MotionEvent.ACTION_UP: { // If the overview proxy service has not started the recents animation then clean up // after it to ensure that the nav bar buttons still work if (mOverviewProxyService.getProxy() != null && !mRecentsAnimationStarted) { try { ActivityManager.getService().cancelRecentsAnimation(); } catch (RemoteException e) { Log.e(TAG, "Could not cancel recents animation", e); } } break; } } if (mStatusBar.isPresenterFullyCollapsed() && !mQuickScrubController.onInterceptTouchEvent(event)) { boolean handledByQuickscrub = mQuickScrubController.onInterceptTouchEvent(event); if (mStatusBar.isPresenterFullyCollapsed() && !handledByQuickscrub) { // Proxy motion events until we start intercepting for quickscrub proxyMotionEvents(event); return false; } return (mDockWindowEnabled && interceptDockWindowEvent(event)) || mRecentsAnimationStarted; boolean result = handledByQuickscrub; result |= mRecentsAnimationStarted; if (mDockWindowEnabled) { result |= interceptDockWindowEvent(event); } return result; } public boolean onTouchEvent(MotionEvent event) { Loading @@ -188,10 +181,11 @@ public class NavigationBarGestureHelper implements TunerService.Tunable, Gesture && (mQuickScrubController.onTouchEvent(event) || ignoreProxyDownEvent || proxyMotionEvents(event)); result |= mRecentsAnimationStarted; if (mDockWindowEnabled) { result |= handleDockWindowEvent(event); } return result || mRecentsAnimationStarted; return result; } public void onDraw(Canvas canvas) { Loading
packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyButtonView.java +10 −0 Original line number Diff line number Diff line Loading @@ -27,10 +27,12 @@ import android.media.AudioManager; import android.metrics.LogMaker; import android.os.AsyncTask; import android.os.Bundle; import android.os.RemoteException; import android.os.SystemClock; import android.os.VibrationEffect; import android.os.Vibrator; import android.util.AttributeSet; import android.util.Log; import android.util.TypedValue; import android.view.HapticFeedbackConstants; import android.view.InputDevice; Loading @@ -55,6 +57,7 @@ import static android.view.accessibility.AccessibilityNodeInfo.ACTION_CLICK; import static android.view.accessibility.AccessibilityNodeInfo.ACTION_LONG_CLICK; public class KeyButtonView extends ImageView implements ButtonInterface { private static final String TAG = KeyButtonView.class.getSimpleName(); private final boolean mPlaySounds; private int mContentDescriptionRes; Loading Loading @@ -264,6 +267,13 @@ public class KeyButtonView extends ImageView implements ButtonInterface { } if (mCode != 0) { if (doIt) { // If there was a pending remote recents animation, then we need to // cancel the animation now before we handle the button itself try { ActivityManager.getService().cancelRecentsAnimation(); } catch (RemoteException e) { Log.e(TAG, "Could not cancel recents animation", e); } sendEvent(KeyEvent.ACTION_UP, 0); sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_CLICKED); } else { Loading