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

Commit 568f9f41 authored by Wale Ogunwale's avatar Wale Ogunwale
Browse files

Introduce WindowOrganizer

WM currently only allows the organization of tasks, however we will soon
be allowing the organization of DisplayAreas. To help with the code
structure, we are introducing WindowOrganizer interface which will
contain common APIs for all types of windows organizers (e.g.
applyTransaction) and also be the interfaece for getting the controller
for other organizers.

Test: they pass!
Bug: 147406652
Bug: 152113464
Bug: 152117221

Change-Id: Id2797b288ce92430206c25345d60e7b0e3be98c8
parent 5794658b
Loading
Loading
Loading
Loading
+0 −19
Original line number Diff line number Diff line
@@ -30,7 +30,6 @@ import android.os.IBinder;
import android.os.RemoteException;
import android.os.ServiceManager;
import android.util.Singleton;
import android.window.ITaskOrganizerController;

import java.util.List;

@@ -159,24 +158,6 @@ public class ActivityTaskManager {
                }
            };

    /** @hide */
    @RequiresPermission(android.Manifest.permission.MANAGE_ACTIVITY_STACKS)
    public static ITaskOrganizerController getTaskOrganizerController() {
        return ITaskOrganizerControllerSingleton.get();
    }

    private static final Singleton<ITaskOrganizerController> ITaskOrganizerControllerSingleton =
            new Singleton<ITaskOrganizerController>() {
                @Override
                protected ITaskOrganizerController create() {
                    try {
                        return getService().getTaskOrganizerController();
                    } catch (RemoteException e) {
                        return null;
                    }
                }
            };

    /**
     * Sets the windowing mode for a specific task. Only works on tasks of type
     * {@link WindowConfiguration#ACTIVITY_TYPE_STANDARD}
+3 −6
Original line number Diff line number Diff line
@@ -29,7 +29,6 @@ import android.app.IProcessObserver;
import android.app.IRequestFinishCallback;
import android.app.IServiceConnection;
import android.app.IStopUserCallback;
import android.window.ITaskOrganizerController;
import android.app.ITaskStackListener;
import android.app.IUiAutomationConnection;
import android.app.IUidObserver;
@@ -69,9 +68,9 @@ import android.os.StrictMode;
import android.os.WorkSource;
import android.service.voice.IVoiceInteractionSession;
import android.view.IRecentsAnimationRunner;
import android.window.ITaskOrganizer;
import android.view.RemoteAnimationDefinition;
import android.view.RemoteAnimationAdapter;
import android.window.IWindowOrganizerController;
import com.android.internal.app.IVoiceInteractor;
import com.android.internal.os.IResultReceiver;
import com.android.internal.policy.IKeyguardDismissCallback;
@@ -340,10 +339,8 @@ interface IActivityTaskManager {
            in Rect tempDockedTaskInsetBounds,
            in Rect tempOtherTaskBounds, in Rect tempOtherTaskInsetBounds);

    /**
     * Returns an interface enabling the management of task organizers.
     */
    ITaskOrganizerController getTaskOrganizerController();
    /** Returns an interface enabling the management of window organizers. */
    IWindowOrganizerController getWindowOrganizerController();

    /**
     * Sets whether we are currently in an interactive split screen resize operation where we
+15 −22
Original line number Diff line number Diff line
/* //device/java/android/android/view/ITaskOrganizer.aidl
**
** Copyright 2019, The Android Open Source Project
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
**     http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
/*
 * Copyright (C) 2019 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package android.window;
@@ -29,12 +28,6 @@ oneway interface ITaskOrganizer {
    void taskAppeared(in ActivityManager.RunningTaskInfo taskInfo);
    void taskVanished(in ActivityManager.RunningTaskInfo taskInfo);

    /**
     * Called upon completion of
     * ActivityTaskManagerService#applyTaskOrganizerTransaction
     */
    void transactionReady(int id, in SurfaceControl.Transaction t);

    /**
     * Will fire when core attributes of a Task's info change. Relevant properties include the
     * {@link WindowConfiguration.ActivityType} and whether it is resizable.
+0 −14
Original line number Diff line number Diff line
@@ -36,20 +36,6 @@ interface ITaskOrganizerController {
     */
    void unregisterTaskOrganizer(ITaskOrganizer organizer);

    /**
     * Apply multiple WindowContainer operations at once.
     * @param organizer If non-null this transaction will use the synchronization
     *        scheme described in BLASTSyncEngine.java. The SurfaceControl transaction
     *        containing the effects of this WindowContainer transaction will be passed
     *        to the organizers Transaction ready callback. If null the transaction
     *        will apply with non particular synchronization constraints (other than
     *        it will all apply at once).
     * @return If organizer was non-null returns an ID for the sync operation which will
     *         later be passed to transactionReady. This lets TaskOrganizer implementations
     *         differentiate overlapping sync operations.
     */
    int applyContainerTransaction(in WindowContainerTransaction t, ITaskOrganizer organizer);

    /** Creates a persistent root task in WM for a particular windowing-mode. */
    ActivityManager.RunningTaskInfo createRootTask(int displayId, int windowingMode);

+28 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2020 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package android.window;

import android.view.SurfaceControl;

/**
 * See WindowOrganizer#applyTransaction.
 * {@hide}
 */
oneway interface IWindowContainerTransactionCallback {
    /** Called upon completion of WindowOrganizer#applyTransaction */
    void transactionReady(int id, in SurfaceControl.Transaction t);
}
Loading