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

Commit 92674516 authored by Louis Chang's avatar Louis Chang Committed by Android (Google) Code Review
Browse files

Merge "Create Task Builder"

parents a1f25269 d00a379a
Loading
Loading
Loading
Loading
+9 −5
Original line number Diff line number Diff line
@@ -2664,14 +2664,18 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub {
                                    + ainfo.applicationInfo.uid + ", calling uid=" + callingUid);
                }

                final Task stack = r.getRootTask();
                final Task task = stack.getDisplayArea().createRootTask(stack.getWindowingMode(),
                        stack.getActivityType(), !ON_TOP, ainfo, intent,
                        false /* createdByOrganizer */);
                final Task rootTask = r.getRootTask();
                final Task task = new Task.Builder(this)
                        .setWindowingMode(rootTask.getWindowingMode())
                        .setActivityType(rootTask.getActivityType())
                        .setActivityInfo(ainfo)
                        .setParent(rootTask.getDisplayArea())
                        .setIntent(intent)
                        .build();

                if (!mRecentTasks.addToBottom(task)) {
                    // The app has too many tasks already and we can't add any more
                    stack.removeChild(task, "addAppTask");
                    rootTask.removeChild(task, "addAppTask");
                    return INVALID_TASK_ID;
                }
                task.getTaskDescription().copyFrom(description);
+7 −3
Original line number Diff line number Diff line
@@ -2152,9 +2152,13 @@ class RootWindowContainer extends WindowContainer<DisplayContent>
            } else {
                // In the case of multiple activities, we will create a new task for it and then
                // move the PIP activity into the task.
                rootTask = taskDisplayArea.createRootTask(WINDOWING_MODE_UNDEFINED,
                        r.getActivityType(), ON_TOP, r.info, r.intent,
                        false /* createdByOrganizer */);
                rootTask = new Task.Builder(mService)
                        .setActivityType(r.getActivityType())
                        .setOnTop(true)
                        .setActivityInfo(r.info)
                        .setParent(taskDisplayArea)
                        .setIntent(r.intent)
                        .build();
                // It's possible the task entering PIP is in freeform, so save the last
                // non-fullscreen bounds. Then when this new PIP task exits PIP, it can restore
                // to its previous freeform bounds.
+415 −55

File changed.

Preview size limit exceeded, changes collapsed.

+28 −107

File changed.

Preview size limit exceeded, changes collapsed.

+8 −4
Original line number Diff line number Diff line
@@ -16,7 +16,6 @@

package com.android.server.wm;

import static android.app.WindowConfiguration.ACTIVITY_TYPE_UNDEFINED;
import static android.app.WindowConfiguration.WINDOWING_MODE_FREEFORM;
import static android.app.WindowConfiguration.WINDOWING_MODE_UNDEFINED;

@@ -480,9 +479,14 @@ class TaskOrganizerController extends ITaskOrganizerController.Stub {
        // We want to defer the task appear signal until the task is fully created and attached to
        // to the hierarchy so that the complete starting configuration is in the task info we send
        // over to the organizer.
        final Task task = display.getDefaultTaskDisplayArea().createRootTask(windowingMode,
                ACTIVITY_TYPE_UNDEFINED, false /* onTop */, null /* info */, new Intent(),
                true /* createdByOrganizer */, true /* deferTaskAppear */, launchCookie);
        final Task task = new Task.Builder(mService)
                .setWindowingMode(windowingMode)
                .setIntent(new Intent())
                .setCreatedByOrganizer(true)
                .setDeferTaskAppear(true)
                .setLaunchCookie(launchCookie)
                .setParent(display.getDefaultTaskDisplayArea())
                .build();
        task.setDeferTaskAppear(false /* deferTaskAppear */);
        return task;
    }
Loading