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

Commit 468b7c01 authored by wilsonshih's avatar wilsonshih
Browse files

Fix display id would be ignored if app been launched from pending activity queue.

For those app which might be launched from pending activity queue,
display id would be ignored since it doesn't set ActivityOptions for
ActivityStarter.startResolvedActivity.

Bug:110962502
Test: atest CtsActivityManagerDeviceTestCases

Change-Id: Id8fedca160f35ea3ab229f3382932494067bcde3
parent a15511e9
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -67,6 +67,7 @@ message ActivityStackSupervisorProto {
    // Whether or not the home activity is the recents activity. This is needed for the CTS tests to
    // know what activity types to check for when invoking splitscreen multi-window.
    optional bool is_home_recents_component = 6;
    repeated .com.android.server.wm.IdentifierProto pending_activities = 7;
}

/* represents ActivityStackSupervisor.ActivityDisplay */
+2 −0
Original line number Diff line number Diff line
@@ -95,6 +95,7 @@ import static com.android.server.am.ActivityStackSupervisorProto.DISPLAYS;
import static com.android.server.am.ActivityStackSupervisorProto.FOCUSED_STACK_ID;
import static com.android.server.am.ActivityStackSupervisorProto.IS_HOME_RECENTS_COMPONENT;
import static com.android.server.am.ActivityStackSupervisorProto.KEYGUARD_CONTROLLER;
import static com.android.server.am.ActivityStackSupervisorProto.PENDING_ACTIVITIES;
import static com.android.server.am.ActivityStackSupervisorProto.RESUMED_ACTIVITY;
import static android.view.WindowManager.TRANSIT_DOCK_TASK_FROM_RECENTS;

@@ -3993,6 +3994,7 @@ public class ActivityStackSupervisor extends ConfigurationContainer implements D
        }
        proto.write(IS_HOME_RECENTS_COMPONENT,
                mRecentTasks.isRecentsComponentHomeActivity(mCurrentUser));
        mService.getActivityStartController().writeToProto(proto, PENDING_ACTIVITIES);
        proto.end(token);
    }

+8 −1
Original line number Diff line number Diff line
@@ -40,6 +40,7 @@ import android.os.Message;
import android.os.UserHandle;
import android.provider.Settings;
import android.util.Slog;
import android.util.proto.ProtoOutputStream;
import android.view.RemoteAnimationAdapter;

import com.android.internal.annotations.VisibleForTesting;
@@ -404,7 +405,7 @@ public class ActivityStartController {
                    "pendingActivityLaunch");
            try {
                starter.startResolvedActivity(pal.r, pal.sourceRecord, null, null, pal.startFlags,
                        resume, null, null, null /* outRecords */);
                        resume, pal.r.pendingOptions, null, null /* outRecords */);
            } catch (Exception e) {
                Slog.e(TAG, "Exception during pending activity launch pal=" + pal, e);
                pal.sendErrorResult(e.getMessage());
@@ -472,4 +473,10 @@ public class ActivityStartController {
            pw.println("(nothing)");
        }
    }

    public void writeToProto(ProtoOutputStream proto, long fieldId) {
        for (PendingActivityLaunch activity: mPendingActivityLaunches) {
            activity.r.writeIdentifierToProto(proto, fieldId);
        }
    }
}