Merge "Skip sending user home when the overview command queue is pending." into udc-qpr-dev am: 7a12786c79
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/23754014 Change-Id: I0d6528a551c877f665f6bef953f270ca68be03ab Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
committed by
Automerger Merge Worker
commit
c2c05ae381
@@ -1305,6 +1305,13 @@ public class QuickstepLauncher extends Launcher {
|
||||
: groupTask.mSplitBounds.leftTaskPercent);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCommandQueueEmpty() {
|
||||
OverviewCommandHelper overviewCommandHelper = mTISBindHelper.getOverviewCommandHelper();
|
||||
return super.isCommandQueueEmpty()
|
||||
&& (overviewCommandHelper == null || overviewCommandHelper.isCommandQueueEmpty());
|
||||
}
|
||||
|
||||
private static final class LauncherTaskViewController extends
|
||||
TaskViewTouchController<Launcher> {
|
||||
|
||||
|
||||
@@ -140,6 +140,11 @@ public class OverviewCommandHelper {
|
||||
mPendingCommands.clear();
|
||||
}
|
||||
|
||||
@UiThread
|
||||
public boolean isCommandQueueEmpty() {
|
||||
return mPendingCommands.isEmpty();
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private TaskView getNextTask(RecentsView view) {
|
||||
final TaskView runningTaskView = view.getRunningTaskView();
|
||||
|
||||
@@ -466,4 +466,11 @@ public final class RecentsActivity extends StatefulActivity<RecentsState> {
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCommandQueueEmpty() {
|
||||
OverviewCommandHelper overviewCommandHelper = mTISBindHelper.getOverviewCommandHelper();
|
||||
return super.isCommandQueueEmpty()
|
||||
&& (overviewCommandHelper == null || overviewCommandHelper.isCommandQueueEmpty());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -80,11 +80,16 @@ public class FallbackRecentsView extends RecentsView<RecentsActivity, RecentsSta
|
||||
}
|
||||
|
||||
@Override
|
||||
public void startHome(boolean animated) {
|
||||
protected void handleStartHome(boolean animated) {
|
||||
mActivity.startHome();
|
||||
AbstractFloatingView.closeAllOpenViews(mActivity, mActivity.isStarted());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCommandQueueEmpty() {
|
||||
return mActivity.isCommandQueueEmpty();
|
||||
}
|
||||
|
||||
/**
|
||||
* When starting gesture interaction from home, we add a temporary invisible tile corresponding
|
||||
* to the home task. This allows us to handle quick-switch similarly to a quick-switching
|
||||
|
||||
@@ -82,13 +82,18 @@ public class LauncherRecentsView extends RecentsView<QuickstepLauncher, Launcher
|
||||
}
|
||||
|
||||
@Override
|
||||
public void startHome(boolean animated) {
|
||||
protected void handleStartHome(boolean animated) {
|
||||
StateManager stateManager = mActivity.getStateManager();
|
||||
animated &= stateManager.shouldAnimateStateChange();
|
||||
stateManager.goToState(NORMAL, animated);
|
||||
AbstractFloatingView.closeAllOpenViews(mActivity, animated);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCommandQueueEmpty() {
|
||||
return mActivity.isCommandQueueEmpty();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onTaskLaunchAnimationEnd(boolean success) {
|
||||
if (success) {
|
||||
|
||||
@@ -2366,7 +2366,15 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
|
||||
startHome(mActivity.isStarted());
|
||||
}
|
||||
|
||||
public abstract void startHome(boolean animated);
|
||||
public void startHome(boolean animated) {
|
||||
if (!isCommandQueueEmpty()) return;
|
||||
handleStartHome(animated);
|
||||
}
|
||||
|
||||
protected abstract void handleStartHome(boolean animated);
|
||||
|
||||
/** Returns whether the overview command helper queue is empty. */
|
||||
public abstract boolean isCommandQueueEmpty();
|
||||
|
||||
public void reset() {
|
||||
setCurrentTask(-1);
|
||||
|
||||
@@ -237,4 +237,10 @@ public abstract class StatefulActivity<STATE_TYPE extends BaseState<STATE_TYPE>>
|
||||
* @param leftOrTop if the staged split will be positioned left or top.
|
||||
*/
|
||||
public void enterStageSplitFromRunningApp(boolean leftOrTop) { }
|
||||
|
||||
|
||||
/** Returns whether the overview command helper queue is empty. */
|
||||
public boolean isCommandQueueEmpty() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user