Merge "Clear command queue of OverviewCommandHelper on home tap" into sc-v2-dev

This commit is contained in:
Tracy Zhou 2021-07-29 19:09:39 +00:00 committed by Android (Google) Code Review
commit 64231c8db1
3 changed files with 22 additions and 0 deletions

View File

@ -64,6 +64,7 @@ import com.android.launcher3.util.DisplayController;
import com.android.launcher3.util.IntSet;
import com.android.launcher3.util.ObjectWrapper;
import com.android.launcher3.util.UiThreadHelper;
import com.android.quickstep.OverviewCommandHelper;
import com.android.quickstep.RecentsModel;
import com.android.quickstep.SysUINavigationMode;
import com.android.quickstep.SysUINavigationMode.Mode;
@ -109,6 +110,7 @@ public abstract class BaseQuickstepLauncher extends Launcher
private OverviewActionsView mActionsView;
private @Nullable TaskbarManager mTaskbarManager;
private @Nullable OverviewCommandHelper mOverviewCommandHelper;
private @Nullable LauncherTaskbarUIController mTaskbarUIController;
private final ServiceConnection mTisBinderConnection = new ServiceConnection() {
@Override
@ -117,6 +119,8 @@ public abstract class BaseQuickstepLauncher extends Launcher
mTaskbarManager.setLauncher(BaseQuickstepLauncher.this);
Log.d(TAG, "TIS service connected");
resetServiceBindRetryState();
mOverviewCommandHelper = ((TISBinder) iBinder).getOverviewCommandHelper();
}
@Override
@ -159,6 +163,15 @@ public abstract class BaseQuickstepLauncher extends Launcher
super.onDestroy();
}
@Override
protected void onNewIntent(Intent intent) {
super.onNewIntent(intent);
if (mOverviewCommandHelper != null) {
mOverviewCommandHelper.clearPendingCommands();
}
}
public QuickstepTransitionManager getAppTransitionManager() {
return mAppTransitionManager;
}

View File

@ -109,6 +109,11 @@ public class OverviewCommandHelper {
MAIN_EXECUTOR.execute(() -> addCommand(cmd));
}
@UiThread
public void clearPendingCommands() {
mPendingCommands.clear();
}
private TaskView getNextTask(RecentsView view) {
final TaskView runningTaskView = view.getRunningTaskView();

View File

@ -297,6 +297,10 @@ public class TouchInteractionService extends Service implements PluginListener<O
public TaskbarManager getTaskbarManager() {
return mTaskbarManager;
}
public OverviewCommandHelper getOverviewCommandHelper() {
return mOverviewCommandHelper;
}
}
private static boolean sConnected = false;