Loading quickstep/recents_ui_overrides/src/com/android/quickstep/AppToOverviewAnimationProvider.java +7 −5 Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ import static com.android.systemui.shared.system.RemoteAnimationTargetCompat.MOD import android.animation.Animator; import android.animation.AnimatorSet; import android.app.ActivityManager.RunningTaskInfo; import android.util.Log; import android.view.animation.Interpolator; Loading Loading @@ -52,17 +53,17 @@ final class AppToOverviewAnimationProvider<T extends StatefulActivity<?>> extend private final BaseActivityInterface<?, T> mActivityInterface; // The id of the currently running task that is transitioning to overview. private final int mTargetTaskId; private final RunningTaskInfo mTargetTask; private final RecentsAnimationDeviceState mDeviceState; private T mActivity; private RecentsView mRecentsView; AppToOverviewAnimationProvider( BaseActivityInterface<?, T> activityInterface, int targetTaskId, BaseActivityInterface<?, T> activityInterface, RunningTaskInfo targetTask, RecentsAnimationDeviceState deviceState) { mActivityInterface = activityInterface; mTargetTaskId = targetTaskId; mTargetTask = targetTask; mDeviceState = deviceState; } Loading @@ -73,7 +74,7 @@ final class AppToOverviewAnimationProvider<T extends StatefulActivity<?>> extend * @param wasVisible true if it was visible before */ boolean onActivityReady(T activity, Boolean wasVisible) { activity.<RecentsView>getOverviewPanel().showCurrentTask(mTargetTaskId); activity.<RecentsView>getOverviewPanel().showCurrentTask(mTargetTask); AbstractFloatingView.closeAllOpenViews(activity, wasVisible); BaseActivityInterface.AnimationFactory factory = mActivityInterface.prepareRecentsUI( mDeviceState, Loading Loading @@ -122,7 +123,8 @@ final class AppToOverviewAnimationProvider<T extends StatefulActivity<?>> extend wallpaperTargets, MODE_CLOSING); // Use the top closing app to determine the insets for the animation RemoteAnimationTargetCompat runningTaskTarget = targets.findTask(mTargetTaskId); RemoteAnimationTargetCompat runningTaskTarget = mTargetTask == null ? null : targets.findTask(mTargetTask.taskId); if (runningTaskTarget == null) { Log.e(TAG, "No closing app"); return pa.buildAnim(); Loading quickstep/recents_ui_overrides/src/com/android/quickstep/BaseSwipeUpHandlerV2.java +1 −1 Original line number Diff line number Diff line Loading @@ -421,7 +421,7 @@ public abstract class BaseSwipeUpHandlerV2<T extends StatefulActivity<?>, Q exte } protected void notifyGestureAnimationStartToRecents() { mRecentsView.onGestureAnimationStart(mGestureState.getRunningTaskId()); mRecentsView.onGestureAnimationStart(mGestureState.getRunningTask()); } private void launcherFrameDrawn() { Loading quickstep/recents_ui_overrides/src/com/android/quickstep/OverviewCommandHelper.java +1 −1 Original line number Diff line number Diff line Loading @@ -165,7 +165,7 @@ public class OverviewCommandHelper { mActivityInterface = mOverviewComponentObserver.getActivityInterface(); mCreateTime = SystemClock.elapsedRealtime(); mAnimationProvider = new AppToOverviewAnimationProvider<>(mActivityInterface, RecentsModel.getRunningTaskId(), mDeviceState); ActivityManagerWrapper.getInstance().getRunningTask(), mDeviceState); // Preload the plan mRecentsModel.getTasks(null); Loading quickstep/recents_ui_overrides/src/com/android/quickstep/fallback/FallbackRecentsView.java +5 −4 Original line number Diff line number Diff line Loading @@ -76,7 +76,7 @@ public class FallbackRecentsView extends RecentsView<RecentsActivity> */ public void onGestureAnimationStartOnHome(RunningTaskInfo homeTaskInfo) { mHomeTaskInfo = homeTaskInfo; onGestureAnimationStart(homeTaskInfo == null ? -1 : homeTaskInfo.taskId); onGestureAnimationStart(homeTaskInfo); } /** Loading Loading @@ -107,14 +107,15 @@ public class FallbackRecentsView extends RecentsView<RecentsActivity> } @Override protected boolean shouldAddDummyTaskView(int runningTaskId) { if (mHomeTaskInfo != null && mHomeTaskInfo.taskId == runningTaskId protected boolean shouldAddDummyTaskView(RunningTaskInfo runningTaskInfo) { if (mHomeTaskInfo != null && runningTaskInfo != null && mHomeTaskInfo.taskId == runningTaskInfo.taskId && getTaskViewCount() == 0) { // Do not add a dummy task if we are running over home with empty recents, so that we // show the empty recents message instead of showing a dummy task and later removing it. return false; } return super.shouldAddDummyTaskView(runningTaskId); return super.shouldAddDummyTaskView(runningTaskInfo); } @Override Loading quickstep/recents_ui_overrides/src/com/android/quickstep/views/RecentsView.java +12 −13 Original line number Diff line number Diff line Loading @@ -56,6 +56,7 @@ import android.animation.ObjectAnimator; import android.animation.ValueAnimator; import android.annotation.TargetApi; import android.app.ActivityManager; import android.app.ActivityManager.RunningTaskInfo; import android.content.ComponentName; import android.content.Context; import android.content.Intent; Loading Loading @@ -135,6 +136,7 @@ import com.android.quickstep.util.TransformParams; import com.android.systemui.plugins.ResourceProvider; import com.android.systemui.shared.recents.IPinnedStackAnimationListener; import com.android.systemui.shared.recents.model.Task; import com.android.systemui.shared.recents.model.Task.TaskKey; import com.android.systemui.shared.recents.model.ThumbnailData; import com.android.systemui.shared.system.ActivityManagerWrapper; import com.android.systemui.shared.system.LauncherEventUtil; Loading @@ -147,7 +149,7 @@ import java.util.function.Consumer; /** * A list of recent tasks. */ @TargetApi(Build.VERSION_CODES.P) @TargetApi(Build.VERSION_CODES.R) public abstract class RecentsView<T extends StatefulActivity> extends PagedView implements Insettable, TaskThumbnailCache.HighResLoadingState.HighResLoadingStateChangedCallback, InvariantDeviceProfile.OnIDPChangeListener, TaskVisualsChangeListener, Loading Loading @@ -1039,10 +1041,10 @@ public abstract class RecentsView<T extends StatefulActivity> extends PagedView /** * Called when a gesture from an app is starting. */ public void onGestureAnimationStart(int runningTaskId) { public void onGestureAnimationStart(RunningTaskInfo runningTaskInfo) { // This needs to be called before the other states are set since it can create the task view mOrientationState.setGestureActive(true); showCurrentTask(runningTaskId); showCurrentTask(runningTaskInfo); setEnableFreeScroll(false); setEnableDrawingLiveTile(false); setRunningTaskHidden(true); Loading Loading @@ -1120,8 +1122,8 @@ public abstract class RecentsView<T extends StatefulActivity> extends PagedView /** * Returns true if we should add a dummy taskView for the running task id */ protected boolean shouldAddDummyTaskView(int runningTaskId) { return getTaskView(runningTaskId) == null; protected boolean shouldAddDummyTaskView(RunningTaskInfo runningTaskInfo) { return runningTaskInfo != null && getTaskView(runningTaskInfo.taskId) == null; } /** Loading @@ -1130,8 +1132,8 @@ public abstract class RecentsView<T extends StatefulActivity> extends PagedView * All subsequent calls to reload will keep the task as the first item until {@link #reset()} * is called. Also scrolls the view to this task. */ public void showCurrentTask(int runningTaskId) { if (shouldAddDummyTaskView(runningTaskId)) { public void showCurrentTask(RunningTaskInfo runningTaskInfo) { if (shouldAddDummyTaskView(runningTaskInfo)) { boolean wasEmpty = getChildCount() == 0; // Add an empty view for now until the task plan is loaded and applied final TaskView taskView = mTaskViewPool.getView(); Loading @@ -1141,10 +1143,7 @@ public abstract class RecentsView<T extends StatefulActivity> extends PagedView } // The temporary running task is only used for the duration between the start of the // gesture and the task list is loaded and applied mTmpRunningTask = new Task(new Task.TaskKey(runningTaskId, 0, new Intent(), new ComponentName(getContext(), getClass()), 0, 0), null, null, "", "", 0, 0, false, true, false, false, new ActivityManager.TaskDescription(), 0, new ComponentName("", ""), false); mTmpRunningTask = Task.from(new TaskKey(runningTaskInfo), runningTaskInfo, false); taskView.bind(mTmpRunningTask, mOrientationState); // Measure and layout immediately so that the scroll values is updated instantly Loading @@ -1155,7 +1154,7 @@ public abstract class RecentsView<T extends StatefulActivity> extends PagedView } boolean runningTaskTileHidden = mRunningTaskTileHidden; setCurrentTask(runningTaskId); setCurrentTask(runningTaskInfo == null ? -1 : runningTaskInfo.taskId); setCurrentPage(getRunningTaskIndex()); setRunningTaskViewShowScreenshot(false); setRunningTaskHidden(runningTaskTileHidden); Loading Loading @@ -1673,7 +1672,7 @@ public abstract class RecentsView<T extends StatefulActivity> extends PagedView : View.LAYOUT_DIRECTION_RTL); mClearAllButton.setRotation(mOrientationHandler.getDegreesRotated()); mActivity.getDragLayer().recreateControllers(); boolean isInLandscape = mOrientationState.getTouchRotation() != 0 boolean isInLandscape = mOrientationState.getTouchRotation() != ROTATION_0 || mOrientationState.getRecentsActivityRotation() != ROTATION_0; mActionsView.updateHiddenFlags(HIDDEN_NON_ZERO_ROTATION, !mOrientationState.canRecentsActivityRotate() && isInLandscape); Loading Loading
quickstep/recents_ui_overrides/src/com/android/quickstep/AppToOverviewAnimationProvider.java +7 −5 Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ import static com.android.systemui.shared.system.RemoteAnimationTargetCompat.MOD import android.animation.Animator; import android.animation.AnimatorSet; import android.app.ActivityManager.RunningTaskInfo; import android.util.Log; import android.view.animation.Interpolator; Loading Loading @@ -52,17 +53,17 @@ final class AppToOverviewAnimationProvider<T extends StatefulActivity<?>> extend private final BaseActivityInterface<?, T> mActivityInterface; // The id of the currently running task that is transitioning to overview. private final int mTargetTaskId; private final RunningTaskInfo mTargetTask; private final RecentsAnimationDeviceState mDeviceState; private T mActivity; private RecentsView mRecentsView; AppToOverviewAnimationProvider( BaseActivityInterface<?, T> activityInterface, int targetTaskId, BaseActivityInterface<?, T> activityInterface, RunningTaskInfo targetTask, RecentsAnimationDeviceState deviceState) { mActivityInterface = activityInterface; mTargetTaskId = targetTaskId; mTargetTask = targetTask; mDeviceState = deviceState; } Loading @@ -73,7 +74,7 @@ final class AppToOverviewAnimationProvider<T extends StatefulActivity<?>> extend * @param wasVisible true if it was visible before */ boolean onActivityReady(T activity, Boolean wasVisible) { activity.<RecentsView>getOverviewPanel().showCurrentTask(mTargetTaskId); activity.<RecentsView>getOverviewPanel().showCurrentTask(mTargetTask); AbstractFloatingView.closeAllOpenViews(activity, wasVisible); BaseActivityInterface.AnimationFactory factory = mActivityInterface.prepareRecentsUI( mDeviceState, Loading Loading @@ -122,7 +123,8 @@ final class AppToOverviewAnimationProvider<T extends StatefulActivity<?>> extend wallpaperTargets, MODE_CLOSING); // Use the top closing app to determine the insets for the animation RemoteAnimationTargetCompat runningTaskTarget = targets.findTask(mTargetTaskId); RemoteAnimationTargetCompat runningTaskTarget = mTargetTask == null ? null : targets.findTask(mTargetTask.taskId); if (runningTaskTarget == null) { Log.e(TAG, "No closing app"); return pa.buildAnim(); Loading
quickstep/recents_ui_overrides/src/com/android/quickstep/BaseSwipeUpHandlerV2.java +1 −1 Original line number Diff line number Diff line Loading @@ -421,7 +421,7 @@ public abstract class BaseSwipeUpHandlerV2<T extends StatefulActivity<?>, Q exte } protected void notifyGestureAnimationStartToRecents() { mRecentsView.onGestureAnimationStart(mGestureState.getRunningTaskId()); mRecentsView.onGestureAnimationStart(mGestureState.getRunningTask()); } private void launcherFrameDrawn() { Loading
quickstep/recents_ui_overrides/src/com/android/quickstep/OverviewCommandHelper.java +1 −1 Original line number Diff line number Diff line Loading @@ -165,7 +165,7 @@ public class OverviewCommandHelper { mActivityInterface = mOverviewComponentObserver.getActivityInterface(); mCreateTime = SystemClock.elapsedRealtime(); mAnimationProvider = new AppToOverviewAnimationProvider<>(mActivityInterface, RecentsModel.getRunningTaskId(), mDeviceState); ActivityManagerWrapper.getInstance().getRunningTask(), mDeviceState); // Preload the plan mRecentsModel.getTasks(null); Loading
quickstep/recents_ui_overrides/src/com/android/quickstep/fallback/FallbackRecentsView.java +5 −4 Original line number Diff line number Diff line Loading @@ -76,7 +76,7 @@ public class FallbackRecentsView extends RecentsView<RecentsActivity> */ public void onGestureAnimationStartOnHome(RunningTaskInfo homeTaskInfo) { mHomeTaskInfo = homeTaskInfo; onGestureAnimationStart(homeTaskInfo == null ? -1 : homeTaskInfo.taskId); onGestureAnimationStart(homeTaskInfo); } /** Loading Loading @@ -107,14 +107,15 @@ public class FallbackRecentsView extends RecentsView<RecentsActivity> } @Override protected boolean shouldAddDummyTaskView(int runningTaskId) { if (mHomeTaskInfo != null && mHomeTaskInfo.taskId == runningTaskId protected boolean shouldAddDummyTaskView(RunningTaskInfo runningTaskInfo) { if (mHomeTaskInfo != null && runningTaskInfo != null && mHomeTaskInfo.taskId == runningTaskInfo.taskId && getTaskViewCount() == 0) { // Do not add a dummy task if we are running over home with empty recents, so that we // show the empty recents message instead of showing a dummy task and later removing it. return false; } return super.shouldAddDummyTaskView(runningTaskId); return super.shouldAddDummyTaskView(runningTaskInfo); } @Override Loading
quickstep/recents_ui_overrides/src/com/android/quickstep/views/RecentsView.java +12 −13 Original line number Diff line number Diff line Loading @@ -56,6 +56,7 @@ import android.animation.ObjectAnimator; import android.animation.ValueAnimator; import android.annotation.TargetApi; import android.app.ActivityManager; import android.app.ActivityManager.RunningTaskInfo; import android.content.ComponentName; import android.content.Context; import android.content.Intent; Loading Loading @@ -135,6 +136,7 @@ import com.android.quickstep.util.TransformParams; import com.android.systemui.plugins.ResourceProvider; import com.android.systemui.shared.recents.IPinnedStackAnimationListener; import com.android.systemui.shared.recents.model.Task; import com.android.systemui.shared.recents.model.Task.TaskKey; import com.android.systemui.shared.recents.model.ThumbnailData; import com.android.systemui.shared.system.ActivityManagerWrapper; import com.android.systemui.shared.system.LauncherEventUtil; Loading @@ -147,7 +149,7 @@ import java.util.function.Consumer; /** * A list of recent tasks. */ @TargetApi(Build.VERSION_CODES.P) @TargetApi(Build.VERSION_CODES.R) public abstract class RecentsView<T extends StatefulActivity> extends PagedView implements Insettable, TaskThumbnailCache.HighResLoadingState.HighResLoadingStateChangedCallback, InvariantDeviceProfile.OnIDPChangeListener, TaskVisualsChangeListener, Loading Loading @@ -1039,10 +1041,10 @@ public abstract class RecentsView<T extends StatefulActivity> extends PagedView /** * Called when a gesture from an app is starting. */ public void onGestureAnimationStart(int runningTaskId) { public void onGestureAnimationStart(RunningTaskInfo runningTaskInfo) { // This needs to be called before the other states are set since it can create the task view mOrientationState.setGestureActive(true); showCurrentTask(runningTaskId); showCurrentTask(runningTaskInfo); setEnableFreeScroll(false); setEnableDrawingLiveTile(false); setRunningTaskHidden(true); Loading Loading @@ -1120,8 +1122,8 @@ public abstract class RecentsView<T extends StatefulActivity> extends PagedView /** * Returns true if we should add a dummy taskView for the running task id */ protected boolean shouldAddDummyTaskView(int runningTaskId) { return getTaskView(runningTaskId) == null; protected boolean shouldAddDummyTaskView(RunningTaskInfo runningTaskInfo) { return runningTaskInfo != null && getTaskView(runningTaskInfo.taskId) == null; } /** Loading @@ -1130,8 +1132,8 @@ public abstract class RecentsView<T extends StatefulActivity> extends PagedView * All subsequent calls to reload will keep the task as the first item until {@link #reset()} * is called. Also scrolls the view to this task. */ public void showCurrentTask(int runningTaskId) { if (shouldAddDummyTaskView(runningTaskId)) { public void showCurrentTask(RunningTaskInfo runningTaskInfo) { if (shouldAddDummyTaskView(runningTaskInfo)) { boolean wasEmpty = getChildCount() == 0; // Add an empty view for now until the task plan is loaded and applied final TaskView taskView = mTaskViewPool.getView(); Loading @@ -1141,10 +1143,7 @@ public abstract class RecentsView<T extends StatefulActivity> extends PagedView } // The temporary running task is only used for the duration between the start of the // gesture and the task list is loaded and applied mTmpRunningTask = new Task(new Task.TaskKey(runningTaskId, 0, new Intent(), new ComponentName(getContext(), getClass()), 0, 0), null, null, "", "", 0, 0, false, true, false, false, new ActivityManager.TaskDescription(), 0, new ComponentName("", ""), false); mTmpRunningTask = Task.from(new TaskKey(runningTaskInfo), runningTaskInfo, false); taskView.bind(mTmpRunningTask, mOrientationState); // Measure and layout immediately so that the scroll values is updated instantly Loading @@ -1155,7 +1154,7 @@ public abstract class RecentsView<T extends StatefulActivity> extends PagedView } boolean runningTaskTileHidden = mRunningTaskTileHidden; setCurrentTask(runningTaskId); setCurrentTask(runningTaskInfo == null ? -1 : runningTaskInfo.taskId); setCurrentPage(getRunningTaskIndex()); setRunningTaskViewShowScreenshot(false); setRunningTaskHidden(runningTaskTileHidden); Loading Loading @@ -1673,7 +1672,7 @@ public abstract class RecentsView<T extends StatefulActivity> extends PagedView : View.LAYOUT_DIRECTION_RTL); mClearAllButton.setRotation(mOrientationHandler.getDegreesRotated()); mActivity.getDragLayer().recreateControllers(); boolean isInLandscape = mOrientationState.getTouchRotation() != 0 boolean isInLandscape = mOrientationState.getTouchRotation() != ROTATION_0 || mOrientationState.getRecentsActivityRotation() != ROTATION_0; mActionsView.updateHiddenFlags(HIDDEN_NON_ZERO_ROTATION, !mOrientationState.canRecentsActivityRotate() && isInLandscape); Loading