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

Commit 483cef51 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Introduce DisplayArea organizer" into rvc-dev am: 7cf2aeac am: e6d91004

Change-Id: I6beaefead1598dc2d8f11e1768c7d3ee1b7dc321
parents 1a13e050 e6d91004
Loading
Loading
Loading
Loading
+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.window.IWindowContainer;

/**
 * Interface for WindowManager to delegate control of display areas.
 * {@hide}
 */
oneway interface IDisplayAreaOrganizer {
    void onDisplayAreaAppeared(in IWindowContainer displayArea);
    void onDisplayAreaVanished(in IWindowContainer displayArea);
}
+26 −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.window.IDisplayAreaOrganizer;

/** @hide */
interface IDisplayAreaOrganizerController {

    /** Register a DisplayAreaOrganizer to manage display areas for a given feature. */
    void registerOrganizer(in IDisplayAreaOrganizer organizer, int displayAreaFeature);
}
+2 −2
Original line number Diff line number Diff line
@@ -25,8 +25,8 @@ import android.window.IWindowContainer;
 * {@hide}
 */
oneway interface ITaskOrganizer {
    void taskAppeared(in ActivityManager.RunningTaskInfo taskInfo);
    void taskVanished(in ActivityManager.RunningTaskInfo taskInfo);
    void onTaskAppeared(in ActivityManager.RunningTaskInfo taskInfo);
    void onTaskVanished(in ActivityManager.RunningTaskInfo taskInfo);

    /**
     * Will fire when core attributes of a Task's info change. Relevant properties include the
+4 −0
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

package android.window;

import android.window.IDisplayAreaOrganizerController;
import android.window.ITaskOrganizerController;
import android.window.IWindowContainerTransactionCallback;
import android.window.WindowContainerTransaction;
@@ -43,4 +44,7 @@ interface IWindowOrganizerController {

    /** @return An interface enabling the management of task organizers. */
    ITaskOrganizerController getTaskOrganizerController();

    /** @return An interface enabling the management of display area organizers. */
    IDisplayAreaOrganizerController getDisplayAreaOrganizerController();
}
+44 −0
Original line number Diff line number Diff line
@@ -152,6 +152,50 @@ public class WindowOrganizer {
                        }
                    }
                };
    }

    /** Class for organizing display areas. */
    public static class DisplayAreaOrganizer {

        public static final int FEATURE_UNDEFINED = -1;
        public static final int FEATURE_SYSTEM_FIRST = 0;
        // The Root display area on a display
        public static final int FEATURE_ROOT = FEATURE_SYSTEM_FIRST;
        // Display area hosting the task container.
        public static final int FEATURE_TASK_CONTAINER = FEATURE_SYSTEM_FIRST + 1;
        // Display area hosting non-activity window tokens.
        public static final int FEATURE_WINDOW_TOKENS = FEATURE_SYSTEM_FIRST + 2;

        public static final int FEATURE_SYSTEM_LAST = 10_000;

        // Vendor specific display area definition can start with this value.
        public static final int FEATURE_VENDOR_FIRST = FEATURE_SYSTEM_LAST + 1;

        /** @hide */
        @RequiresPermission(android.Manifest.permission.MANAGE_ACTIVITY_STACKS)
        public static void registerOrganizer(
                IDisplayAreaOrganizer organizer, int displayAreaFeature) throws RemoteException {
            getController().registerOrganizer(organizer, displayAreaFeature);
        }

        /** @hide */
        private static IDisplayAreaOrganizerController getController() {
            return IDisplayAreaOrganizerControllerSingleton.get();
        }

        private static final Singleton<IDisplayAreaOrganizerController>
                IDisplayAreaOrganizerControllerSingleton =
                new Singleton<IDisplayAreaOrganizerController>() {
                    @Override
                    protected IDisplayAreaOrganizerController create() {
                        try {
                            return getWindowOrganizerController()
                                    .getDisplayAreaOrganizerController();
                        } catch (RemoteException e) {
                            return null;
                        }
                    }
                };

    }
}
Loading