Merge "Always look for MODE_OPENING during task launch from overview" into tm-dev am: db2c726560
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/17463979 Change-Id: Idba1440fba5a86ec262424f316e1e8aec17c1b36 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -981,7 +981,6 @@ public abstract class AbsSwipeUpHandler<T extends StatefulActivity<S>,
|
|||||||
mStateCallback.setState(STATE_SCALED_CONTROLLER_HOME | STATE_CAPTURE_SCREENSHOT);
|
mStateCallback.setState(STATE_SCALED_CONTROLLER_HOME | STATE_CAPTURE_SCREENSHOT);
|
||||||
// Notify swipe-to-home (recents animation) is finished
|
// Notify swipe-to-home (recents animation) is finished
|
||||||
SystemUiProxy.INSTANCE.get(mContext).notifySwipeToHomeFinished();
|
SystemUiProxy.INSTANCE.get(mContext).notifySwipeToHomeFinished();
|
||||||
LauncherSplitScreenListener.INSTANCE.getNoCreate().notifySwipingToHome();
|
|
||||||
break;
|
break;
|
||||||
case RECENTS:
|
case RECENTS:
|
||||||
mStateCallback.setState(STATE_SCALED_CONTROLLER_RECENTS | STATE_CAPTURE_SCREENSHOT
|
mStateCallback.setState(STATE_SCALED_CONTROLLER_RECENTS | STATE_CAPTURE_SCREENSHOT
|
||||||
|
|||||||
@@ -32,7 +32,6 @@ import androidx.annotation.UiThread;
|
|||||||
import com.android.launcher3.statemanager.StatefulActivity;
|
import com.android.launcher3.statemanager.StatefulActivity;
|
||||||
import com.android.launcher3.util.RunnableList;
|
import com.android.launcher3.util.RunnableList;
|
||||||
import com.android.quickstep.RecentsAnimationCallbacks.RecentsAnimationListener;
|
import com.android.quickstep.RecentsAnimationCallbacks.RecentsAnimationListener;
|
||||||
import com.android.quickstep.util.LauncherSplitScreenListener;
|
|
||||||
import com.android.quickstep.views.RecentsView;
|
import com.android.quickstep.views.RecentsView;
|
||||||
import com.android.quickstep.views.TaskView;
|
import com.android.quickstep.views.TaskView;
|
||||||
import com.android.systemui.shared.recents.model.ThumbnailData;
|
import com.android.systemui.shared.recents.model.ThumbnailData;
|
||||||
@@ -172,7 +171,6 @@ public class OverviewCommandHelper {
|
|||||||
}
|
}
|
||||||
if (cmd.type == TYPE_HOME) {
|
if (cmd.type == TYPE_HOME) {
|
||||||
mService.startActivity(mOverviewComponentObserver.getHomeIntent());
|
mService.startActivity(mOverviewComponentObserver.getHomeIntent());
|
||||||
LauncherSplitScreenListener.INSTANCE.getNoCreate().notifySwipingToHome();
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -191,7 +189,6 @@ public class OverviewCommandHelper {
|
|||||||
return launchTask(recents, getNextTask(recents), cmd);
|
return launchTask(recents, getNextTask(recents), cmd);
|
||||||
case TYPE_HOME:
|
case TYPE_HOME:
|
||||||
recents.startHome();
|
recents.startHome();
|
||||||
LauncherSplitScreenListener.INSTANCE.getNoCreate().notifySwipingToHome();
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -170,11 +170,9 @@ public final class TaskViewUtils {
|
|||||||
boolean isQuickSwitch = v.isEndQuickswitchCuj();
|
boolean isQuickSwitch = v.isEndQuickswitchCuj();
|
||||||
v.setEndQuickswitchCuj(false);
|
v.setEndQuickswitchCuj(false);
|
||||||
|
|
||||||
boolean inLiveTileMode =
|
|
||||||
ENABLE_QUICKSTEP_LIVE_TILE.get() && v.getRecentsView().getRunningTaskIndex() != -1;
|
|
||||||
final RemoteAnimationTargets targets =
|
final RemoteAnimationTargets targets =
|
||||||
new RemoteAnimationTargets(appTargets, wallpaperTargets, nonAppTargets,
|
new RemoteAnimationTargets(appTargets, wallpaperTargets, nonAppTargets,
|
||||||
!ENABLE_SHELL_TRANSITIONS && inLiveTileMode ? MODE_CLOSING : MODE_OPENING);
|
MODE_OPENING);
|
||||||
final RemoteAnimationTargetCompat navBarTarget = targets.getNavBarRemoteAnimationTarget();
|
final RemoteAnimationTargetCompat navBarTarget = targets.getNavBarRemoteAnimationTarget();
|
||||||
|
|
||||||
SurfaceTransactionApplier applier = new SurfaceTransactionApplier(v);
|
SurfaceTransactionApplier applier = new SurfaceTransactionApplier(v);
|
||||||
@@ -276,7 +274,7 @@ public final class TaskViewUtils {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else if (inLiveTileMode) {
|
} else {
|
||||||
// There is no transition animation for app launch from recent in live tile mode so
|
// There is no transition animation for app launch from recent in live tile mode so
|
||||||
// we have to trigger the navigation bar animation from system here.
|
// we have to trigger the navigation bar animation from system here.
|
||||||
final RecentsAnimationController controller =
|
final RecentsAnimationController controller =
|
||||||
|
|||||||
@@ -11,8 +11,6 @@ import com.android.launcher3.util.SplitConfigurationOptions.StagePosition;
|
|||||||
import com.android.launcher3.util.SplitConfigurationOptions.StageType;
|
import com.android.launcher3.util.SplitConfigurationOptions.StageType;
|
||||||
import com.android.launcher3.util.SplitConfigurationOptions.StagedSplitTaskPosition;
|
import com.android.launcher3.util.SplitConfigurationOptions.StagedSplitTaskPosition;
|
||||||
import com.android.quickstep.SystemUiProxy;
|
import com.android.quickstep.SystemUiProxy;
|
||||||
import com.android.systemui.shared.system.TaskStackChangeListener;
|
|
||||||
import com.android.systemui.shared.system.TaskStackChangeListeners;
|
|
||||||
import com.android.wm.shell.splitscreen.ISplitScreenListener;
|
import com.android.wm.shell.splitscreen.ISplitScreenListener;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -20,9 +18,6 @@ import com.android.wm.shell.splitscreen.ISplitScreenListener;
|
|||||||
*
|
*
|
||||||
* Use {@link #getRunningSplitTaskIds()} to determine which tasks, if any, are actively in
|
* Use {@link #getRunningSplitTaskIds()} to determine which tasks, if any, are actively in
|
||||||
* staged split.
|
* staged split.
|
||||||
*
|
|
||||||
* Use {@link #getPersistentSplitIds()} to know if tasks were in split screen before a quickswitch
|
|
||||||
* gesture happened.
|
|
||||||
*/
|
*/
|
||||||
public class LauncherSplitScreenListener extends ISplitScreenListener.Stub {
|
public class LauncherSplitScreenListener extends ISplitScreenListener.Stub {
|
||||||
|
|
||||||
@@ -34,21 +29,6 @@ public class LauncherSplitScreenListener extends ISplitScreenListener.Stub {
|
|||||||
private final StagedSplitTaskPosition mMainStagePosition = new StagedSplitTaskPosition();
|
private final StagedSplitTaskPosition mMainStagePosition = new StagedSplitTaskPosition();
|
||||||
private final StagedSplitTaskPosition mSideStagePosition = new StagedSplitTaskPosition();
|
private final StagedSplitTaskPosition mSideStagePosition = new StagedSplitTaskPosition();
|
||||||
|
|
||||||
private boolean mIsRecentsListFrozen = false;
|
|
||||||
private final TaskStackChangeListener mTaskStackListener = new TaskStackChangeListener() {
|
|
||||||
@Override
|
|
||||||
public void onRecentTaskListFrozenChanged(boolean frozen) {
|
|
||||||
super.onRecentTaskListFrozenChanged(frozen);
|
|
||||||
mIsRecentsListFrozen = frozen;
|
|
||||||
|
|
||||||
if (frozen) {
|
|
||||||
mPersistentGroupedIds = getRunningSplitTaskIds();
|
|
||||||
} else {
|
|
||||||
mPersistentGroupedIds = EMPTY_ARRAY;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets set to current split taskIDs whenever the task list is frozen, and set to empty array
|
* Gets set to current split taskIDs whenever the task list is frozen, and set to empty array
|
||||||
* whenever task list unfreezes. This also gets set to empty array whenever the user swipes to
|
* whenever task list unfreezes. This also gets set to empty array whenever the user swipes to
|
||||||
@@ -68,25 +48,12 @@ public class LauncherSplitScreenListener extends ISplitScreenListener.Stub {
|
|||||||
/** Also call {@link #destroy()} when done. */
|
/** Also call {@link #destroy()} when done. */
|
||||||
public void init() {
|
public void init() {
|
||||||
SystemUiProxy.INSTANCE.getNoCreate().registerSplitScreenListener(this);
|
SystemUiProxy.INSTANCE.getNoCreate().registerSplitScreenListener(this);
|
||||||
TaskStackChangeListeners.getInstance().registerTaskStackListener(mTaskStackListener);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void destroy() {
|
public void destroy() {
|
||||||
SystemUiProxy.INSTANCE.getNoCreate().unregisterSplitScreenListener(this);
|
SystemUiProxy.INSTANCE.getNoCreate().unregisterSplitScreenListener(this);
|
||||||
TaskStackChangeListeners.getInstance().unregisterTaskStackListener(mTaskStackListener);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* This method returns the active split taskIDs that were active if a user quickswitched from
|
|
||||||
* split screen to a fullscreen app as long as the recents task list remains frozen.
|
|
||||||
*/
|
|
||||||
public int[] getPersistentSplitIds() {
|
|
||||||
if (mIsRecentsListFrozen) {
|
|
||||||
return mPersistentGroupedIds;
|
|
||||||
} else {
|
|
||||||
return getRunningSplitTaskIds();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/**
|
/**
|
||||||
* @return index 0 will be task in left/top position, index 1 in right/bottom position.
|
* @return index 0 will be task in left/top position, index 1 in right/bottom position.
|
||||||
* Will return empty array if device is not in staged split
|
* Will return empty array if device is not in staged split
|
||||||
@@ -141,17 +108,6 @@ public class LauncherSplitScreenListener extends ISplitScreenListener.Stub {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Notifies SystemUi to remove any split screen state */
|
|
||||||
public void notifySwipingToHome() {
|
|
||||||
boolean hasSplitTasks = LauncherSplitScreenListener.INSTANCE.getNoCreate()
|
|
||||||
.getPersistentSplitIds().length > 0;
|
|
||||||
if (!hasSplitTasks) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
mPersistentGroupedIds = EMPTY_ARRAY;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void resetTaskId(StagedSplitTaskPosition taskPosition) {
|
private void resetTaskId(StagedSplitTaskPosition taskPosition) {
|
||||||
taskPosition.taskId = -1;
|
taskPosition.taskId = -1;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user