Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 66e16856 authored by Wale Ogunwale's avatar Wale Ogunwale
Browse files

taskReturnToType be gone!

The activity hierarchy now maintains visual ordering since most task
have their own stack, so no need for taskReturnToType complexity.
Also, we handle the API FLAG_ACTIVITY_TASK_ON_HOME by moving the
home stack forward whenever a stack with the root task intent with
that flag is movedToFront.

Bug: 64146578
Fixes: 67931573
Test: go/wm-smoke
Test: Existing test pass.
Change-Id: I465df9cb55830ac27bba330b221f730c6f1e9450
parent 7e1f5f56
Loading
Loading
Loading
Loading
+5 −6
Original line number Diff line number Diff line
@@ -69,12 +69,11 @@ message TaskRecordProto {
  optional string real_activity = 6;
  optional string orig_activity = 7;
  optional int32 activity_type = 8;
  optional int32 return_to_type = 9;
  optional int32 resize_mode = 10;
  optional bool fullscreen = 11;
  optional .android.graphics.RectProto bounds = 12;
  optional int32 min_width = 13;
  optional int32 min_height = 14;
  optional int32 resize_mode = 9;
  optional bool fullscreen = 10;
  optional .android.graphics.RectProto bounds = 11;
  optional int32 min_width = 12;
  optional int32 min_height = 13;
}

message ActivityRecordProto {
+2 −6
Original line number Diff line number Diff line
@@ -8082,7 +8082,7 @@ public class ActivityManagerService extends IActivityManager.Stub
                    // Adjust the source bounds by the insets for the transition down
                    final Rect sourceBounds = new Rect(r.pictureInPictureArgs.getSourceRectHint());
                    mStackSupervisor.moveActivityToPinnedStackLocked(r, sourceBounds, aspectRatio,
                            true /* moveHomeStackToFront */, "enterPictureInPictureMode");
                            "enterPictureInPictureMode");
                    final PinnedActivityStack stack = r.getStack();
                    stack.setPictureInPictureAspectRatio(aspectRatio);
                    stack.setPictureInPictureActions(actions);
@@ -10230,11 +10230,7 @@ public class ActivityManagerService extends IActivityManager.Stub
                Slog.e(TAG, "moveTaskToFront: Attempt to violate Lock Task Mode");
                return;
            }
            final ActivityRecord prev = mStackSupervisor.topRunningActivityLocked();
            if (prev != null) {
                task.setTaskToReturnTo(prev);
            }
            mStackSupervisor.findTaskToMoveToFrontLocked(task, flags, options, "moveTaskToFront",
            mStackSupervisor.findTaskToMoveToFront(task, flags, options, "moveTaskToFront",
                    false /* forceNonResizable */);
            final ActivityRecord topActivity = task.getTopActivity();
+1 −0
Original line number Diff line number Diff line
@@ -277,6 +277,7 @@ final class ActivityRecord extends ConfigurationContainer implements AppWindowCo
    ActivityState state;    // current state we are in
    Bundle  icicle;         // last saved activity state
    PersistableBundle persistentState; // last persistently saved activity state
    // TODO: See if this is still needed.
    boolean frontOfTask;    // is this the root activity of its task?
    boolean launchFailed;   // set if a launched failed, to abort on 2nd try
    boolean haveState;      // have we gotten the last activity state?
Loading