8.5/ Follow up to comments from previous CLs

Bug: 141886704
Change-Id: Ib583753e35e57eab3b1cc413a0f910cf10142e42
This commit is contained in:
Winson Chung 2019-10-14 15:27:12 -07:00
parent 643598987b
commit 9196cb11a2
5 changed files with 22 additions and 13 deletions

View File

@ -129,10 +129,11 @@ public class TouchInteractionService extends Service implements
public void onInitialize(Bundle bundle) { public void onInitialize(Bundle bundle) {
ISystemUiProxy proxy = ISystemUiProxy.Stub.asInterface( ISystemUiProxy proxy = ISystemUiProxy.Stub.asInterface(
bundle.getBinder(KEY_EXTRA_SYSUI_PROXY)); bundle.getBinder(KEY_EXTRA_SYSUI_PROXY));
MAIN_EXECUTOR.execute(() -> SystemUiProxy.INSTANCE.get(TouchInteractionService.this) MAIN_EXECUTOR.execute(() -> {
.setProxy(proxy)); SystemUiProxy.INSTANCE.get(TouchInteractionService.this).setProxy(proxy);
MAIN_EXECUTOR.execute(TouchInteractionService.this::initInputMonitor); TouchInteractionService.this.initInputMonitor();
MAIN_EXECUTOR.execute(() -> preloadOverview(true /* fromInit */)); preloadOverview(true /* fromInit */);
});
if (TestProtocol.sDebugTracing) { if (TestProtocol.sDebugTracing) {
Log.d(TestProtocol.LAUNCHER_DIDNT_INITIALIZE, "TIS initialized"); Log.d(TestProtocol.LAUNCHER_DIDNT_INITIALIZE, "TIS initialized");
} }
@ -169,15 +170,19 @@ public class TouchInteractionService extends Service implements
@BinderThread @BinderThread
@Override @Override
public void onAssistantAvailable(boolean available) { public void onAssistantAvailable(boolean available) {
MAIN_EXECUTOR.execute(() -> mDeviceState.setAssistantAvailable(available)); MAIN_EXECUTOR.execute(() -> {
MAIN_EXECUTOR.execute(TouchInteractionService.this::onAssistantVisibilityChanged); mDeviceState.setAssistantAvailable(available);
TouchInteractionService.this.onAssistantVisibilityChanged();
});
} }
@BinderThread @BinderThread
@Override @Override
public void onAssistantVisibilityChanged(float visibility) { public void onAssistantVisibilityChanged(float visibility) {
MAIN_EXECUTOR.execute(() -> mDeviceState.setAssistantVisibility(visibility)); MAIN_EXECUTOR.execute(() -> {
MAIN_EXECUTOR.execute(TouchInteractionService.this::onAssistantVisibilityChanged); mDeviceState.setAssistantVisibility(visibility);
TouchInteractionService.this.onAssistantVisibilityChanged();
});
} }
@BinderThread @BinderThread
@ -199,8 +204,10 @@ public class TouchInteractionService extends Service implements
@BinderThread @BinderThread
public void onSystemUiStateChanged(int stateFlags) { public void onSystemUiStateChanged(int stateFlags) {
MAIN_EXECUTOR.execute(() -> mDeviceState.setSystemUiFlags(stateFlags)); MAIN_EXECUTOR.execute(() -> {
MAIN_EXECUTOR.execute(TouchInteractionService.this::onSystemUiFlagsChanged); mDeviceState.setSystemUiFlags(stateFlags);
TouchInteractionService.this.onSystemUiFlagsChanged();
});
} }
@BinderThread @BinderThread

View File

@ -229,7 +229,8 @@ public class WindowTransformSwipeHandler<T extends BaseDraggingActivity>
GestureState gestureState, RunningTaskInfo runningTaskInfo, long touchTimeMs, GestureState gestureState, RunningTaskInfo runningTaskInfo, long touchTimeMs,
OverviewComponentObserver overviewComponentObserver, boolean continuingLastGesture, OverviewComponentObserver overviewComponentObserver, boolean continuingLastGesture,
InputConsumerController inputConsumer, RecentsModel recentsModel) { InputConsumerController inputConsumer, RecentsModel recentsModel) {
super(context, gestureState, overviewComponentObserver, recentsModel, inputConsumer, runningTaskInfo.id); super(context, gestureState, overviewComponentObserver, recentsModel, inputConsumer,
runningTaskInfo.id);
mDeviceState = deviceState; mDeviceState = deviceState;
mGestureState = gestureState; mGestureState = gestureState;
mTouchTimeMs = touchTimeMs; mTouchTimeMs = touchTimeMs;

View File

@ -434,6 +434,7 @@ public class FallbackNoButtonInputConsumer extends
@Override @Override
public void onRecentsAnimationCanceled(ThumbnailData thumbnailData) { public void onRecentsAnimationCanceled(ThumbnailData thumbnailData) {
super.onRecentsAnimationCanceled(thumbnailData);
mRecentsView.setRecentsAnimationTargets(null, null); mRecentsView.setRecentsAnimationTargets(null, null);
setStateOnUiThread(STATE_HANDLER_INVALIDATED); setStateOnUiThread(STATE_HANDLER_INVALIDATED);
} }

View File

@ -33,7 +33,7 @@ public class ActiveGestureLog extends EventLogArray {
*/ */
public static final String INTENT_EXTRA_LOG_TRACE_ID = "INTENT_EXTRA_LOG_TRACE_ID"; public static final String INTENT_EXTRA_LOG_TRACE_ID = "INTENT_EXTRA_LOG_TRACE_ID";
public ActiveGestureLog() { private ActiveGestureLog() {
super("touch_interaction_log", 40); super("touch_interaction_log", 40);
} }
} }

View File

@ -71,7 +71,7 @@ public class RecentsAnimationController {
* currently being animated. * currently being animated.
*/ */
public ThumbnailData screenshotTask(int taskId) { public ThumbnailData screenshotTask(int taskId) {
return mController != null ? mController.screenshotTask(taskId) : null; return mController.screenshotTask(taskId);
} }
/** /**