From 9196cb11a2460b3d8bbe602aa2c18dbb42ac0e72 Mon Sep 17 00:00:00 2001 From: Winson Chung Date: Mon, 14 Oct 2019 15:27:12 -0700 Subject: [PATCH] 8.5/ Follow up to comments from previous CLs Bug: 141886704 Change-Id: Ib583753e35e57eab3b1cc413a0f910cf10142e42 --- .../quickstep/TouchInteractionService.java | 27 ++++++++++++------- .../WindowTransformSwipeHandler.java | 3 ++- .../FallbackNoButtonInputConsumer.java | 1 + .../quickstep/util/ActiveGestureLog.java | 2 +- .../quickstep/RecentsAnimationController.java | 2 +- 5 files changed, 22 insertions(+), 13 deletions(-) diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/TouchInteractionService.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/TouchInteractionService.java index 0eafb44a53..e244e848fc 100644 --- a/quickstep/recents_ui_overrides/src/com/android/quickstep/TouchInteractionService.java +++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/TouchInteractionService.java @@ -129,10 +129,11 @@ public class TouchInteractionService extends Service implements public void onInitialize(Bundle bundle) { ISystemUiProxy proxy = ISystemUiProxy.Stub.asInterface( bundle.getBinder(KEY_EXTRA_SYSUI_PROXY)); - MAIN_EXECUTOR.execute(() -> SystemUiProxy.INSTANCE.get(TouchInteractionService.this) - .setProxy(proxy)); - MAIN_EXECUTOR.execute(TouchInteractionService.this::initInputMonitor); - MAIN_EXECUTOR.execute(() -> preloadOverview(true /* fromInit */)); + MAIN_EXECUTOR.execute(() -> { + SystemUiProxy.INSTANCE.get(TouchInteractionService.this).setProxy(proxy); + TouchInteractionService.this.initInputMonitor(); + preloadOverview(true /* fromInit */); + }); if (TestProtocol.sDebugTracing) { Log.d(TestProtocol.LAUNCHER_DIDNT_INITIALIZE, "TIS initialized"); } @@ -169,15 +170,19 @@ public class TouchInteractionService extends Service implements @BinderThread @Override public void onAssistantAvailable(boolean available) { - MAIN_EXECUTOR.execute(() -> mDeviceState.setAssistantAvailable(available)); - MAIN_EXECUTOR.execute(TouchInteractionService.this::onAssistantVisibilityChanged); + MAIN_EXECUTOR.execute(() -> { + mDeviceState.setAssistantAvailable(available); + TouchInteractionService.this.onAssistantVisibilityChanged(); + }); } @BinderThread @Override public void onAssistantVisibilityChanged(float visibility) { - MAIN_EXECUTOR.execute(() -> mDeviceState.setAssistantVisibility(visibility)); - MAIN_EXECUTOR.execute(TouchInteractionService.this::onAssistantVisibilityChanged); + MAIN_EXECUTOR.execute(() -> { + mDeviceState.setAssistantVisibility(visibility); + TouchInteractionService.this.onAssistantVisibilityChanged(); + }); } @BinderThread @@ -199,8 +204,10 @@ public class TouchInteractionService extends Service implements @BinderThread public void onSystemUiStateChanged(int stateFlags) { - MAIN_EXECUTOR.execute(() -> mDeviceState.setSystemUiFlags(stateFlags)); - MAIN_EXECUTOR.execute(TouchInteractionService.this::onSystemUiFlagsChanged); + MAIN_EXECUTOR.execute(() -> { + mDeviceState.setSystemUiFlags(stateFlags); + TouchInteractionService.this.onSystemUiFlagsChanged(); + }); } @BinderThread diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/WindowTransformSwipeHandler.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/WindowTransformSwipeHandler.java index 1168758dfa..35f8be7461 100644 --- a/quickstep/recents_ui_overrides/src/com/android/quickstep/WindowTransformSwipeHandler.java +++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/WindowTransformSwipeHandler.java @@ -229,7 +229,8 @@ public class WindowTransformSwipeHandler GestureState gestureState, RunningTaskInfo runningTaskInfo, long touchTimeMs, OverviewComponentObserver overviewComponentObserver, boolean continuingLastGesture, InputConsumerController inputConsumer, RecentsModel recentsModel) { - super(context, gestureState, overviewComponentObserver, recentsModel, inputConsumer, runningTaskInfo.id); + super(context, gestureState, overviewComponentObserver, recentsModel, inputConsumer, + runningTaskInfo.id); mDeviceState = deviceState; mGestureState = gestureState; mTouchTimeMs = touchTimeMs; diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/inputconsumers/FallbackNoButtonInputConsumer.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/inputconsumers/FallbackNoButtonInputConsumer.java index 370b48793c..4e01f6f632 100644 --- a/quickstep/recents_ui_overrides/src/com/android/quickstep/inputconsumers/FallbackNoButtonInputConsumer.java +++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/inputconsumers/FallbackNoButtonInputConsumer.java @@ -434,6 +434,7 @@ public class FallbackNoButtonInputConsumer extends @Override public void onRecentsAnimationCanceled(ThumbnailData thumbnailData) { + super.onRecentsAnimationCanceled(thumbnailData); mRecentsView.setRecentsAnimationTargets(null, null); setStateOnUiThread(STATE_HANDLER_INVALIDATED); } diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/util/ActiveGestureLog.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/util/ActiveGestureLog.java index 9a3bb760f1..fabfc4bb51 100644 --- a/quickstep/recents_ui_overrides/src/com/android/quickstep/util/ActiveGestureLog.java +++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/util/ActiveGestureLog.java @@ -33,7 +33,7 @@ public class ActiveGestureLog extends EventLogArray { */ public static final String INTENT_EXTRA_LOG_TRACE_ID = "INTENT_EXTRA_LOG_TRACE_ID"; - public ActiveGestureLog() { + private ActiveGestureLog() { super("touch_interaction_log", 40); } } diff --git a/quickstep/src/com/android/quickstep/RecentsAnimationController.java b/quickstep/src/com/android/quickstep/RecentsAnimationController.java index d938dc5af8..9d5120d90d 100644 --- a/quickstep/src/com/android/quickstep/RecentsAnimationController.java +++ b/quickstep/src/com/android/quickstep/RecentsAnimationController.java @@ -71,7 +71,7 @@ public class RecentsAnimationController { * currently being animated. */ public ThumbnailData screenshotTask(int taskId) { - return mController != null ? mController.screenshotTask(taskId) : null; + return mController.screenshotTask(taskId); } /**