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

Commit c931df6f authored by Chavi Weingarten's avatar Chavi Weingarten Committed by Automerger Merge Worker
Browse files

Merge "Add DisplayAreaInfo" into rvc-dev am: 74aa929f am: 3ddd16c2 am: fe8448f1

Change-Id: I16618a2a077f26f4ed4c0ba1c794f1f499a05f1c
parents 5c4f6190 fe8448f1
Loading
Loading
Loading
Loading
+12 −2
Original line number Diff line number Diff line
@@ -5260,10 +5260,20 @@ package android.widget {

package android.window {

  public final class DisplayAreaInfo implements android.os.Parcelable {
    ctor public DisplayAreaInfo(@NonNull android.window.WindowContainerToken, int);
    method public int describeContents();
    method public void writeToParcel(@NonNull android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.window.DisplayAreaInfo> CREATOR;
    field @NonNull public final android.content.res.Configuration configuration;
    field public final int displayId;
    field @NonNull public final android.window.WindowContainerToken token;
  }

  public class DisplayAreaOrganizer extends android.window.WindowOrganizer {
    ctor public DisplayAreaOrganizer();
    method public void onDisplayAreaAppeared(@NonNull android.window.WindowContainerToken);
    method public void onDisplayAreaVanished(@NonNull android.window.WindowContainerToken);
    method public void onDisplayAreaAppeared(@NonNull android.window.DisplayAreaInfo);
    method public void onDisplayAreaVanished(@NonNull android.window.DisplayAreaInfo);
    method @RequiresPermission(android.Manifest.permission.MANAGE_ACTIVITY_STACKS) public void registerOrganizer(int);
    field public static final int FEATURE_DEFAULT_TASK_CONTAINER = 1; // 0x1
    field public static final int FEATURE_ROOT = 0; // 0x0
+18 −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;

parcelable DisplayAreaInfo;
+87 −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.annotation.NonNull;
import android.annotation.TestApi;
import android.content.res.Configuration;
import android.os.Parcel;
import android.os.Parcelable;

/**
 * Stores information about a particular {@link com.android.server.wm.DisplayArea}. This object will
 * be sent to registered {@link DisplayAreaOrganizer} to provide information when the DisplayArea
 * is added, removed, or changed.
 *
 * @hide
 */
@TestApi
public final class DisplayAreaInfo implements Parcelable {

    @NonNull
    public final WindowContainerToken token;

    @NonNull
    public final Configuration configuration = new Configuration();

    /**
     * The id of the display this display area is associated with.
     */
    public final int displayId;

    public DisplayAreaInfo(@NonNull WindowContainerToken token, int displayId) {
        this.token = token;
        this.displayId = displayId;
    }

    private DisplayAreaInfo(Parcel in) {
        token = WindowContainerToken.CREATOR.createFromParcel(in);
        configuration.readFromParcel(in);
        displayId = in.readInt();
    }

    @Override
    public void writeToParcel(@NonNull Parcel dest, int flags) {
        token.writeToParcel(dest, flags);
        configuration.writeToParcel(dest, flags);
        dest.writeInt(displayId);
    }

    @NonNull
    public static final Creator<DisplayAreaInfo> CREATOR = new Creator<DisplayAreaInfo>() {
        @Override
        public DisplayAreaInfo createFromParcel(Parcel in) {
            return new DisplayAreaInfo(in);
        }

        @Override
        public DisplayAreaInfo[] newArray(int size) {
            return new DisplayAreaInfo[size];
        }
    };

    @Override
    public String toString() {
        return "DisplayAreaInfo{token=" + token
                + " config=" + configuration + "}";
    }

    @Override
    public int describeContents() {
        return 0;
    }
}
+6 −7
Original line number Diff line number Diff line
@@ -52,21 +52,20 @@ public class DisplayAreaOrganizer extends WindowOrganizer {
        }
    }

    public void onDisplayAreaAppeared(@NonNull WindowContainerToken displayArea) {}

    public void onDisplayAreaVanished(@NonNull WindowContainerToken displayArea) {}
    public void onDisplayAreaAppeared(@NonNull DisplayAreaInfo displayAreaInfo) {}

    public void onDisplayAreaVanished(@NonNull DisplayAreaInfo displayAreaInfo) {}

    private final IDisplayAreaOrganizer mInterface = new IDisplayAreaOrganizer.Stub() {

        @Override
        public void onDisplayAreaAppeared(@NonNull WindowContainerToken displayArea) {
            DisplayAreaOrganizer.this.onDisplayAreaAppeared(displayArea);
        public void onDisplayAreaAppeared(@NonNull DisplayAreaInfo displayAreaInfo) {
            DisplayAreaOrganizer.this.onDisplayAreaAppeared(displayAreaInfo);
        }

        @Override
        public void onDisplayAreaVanished(@NonNull WindowContainerToken displayArea) {
            DisplayAreaOrganizer.this.onDisplayAreaVanished(displayArea);
        public void onDisplayAreaVanished(@NonNull DisplayAreaInfo displayAreaInfo) {
            DisplayAreaOrganizer.this.onDisplayAreaVanished(displayAreaInfo);
        }
    };

+3 −3
Original line number Diff line number Diff line
@@ -16,13 +16,13 @@

package android.window;

import android.window.WindowContainerToken;
import android.window.DisplayAreaInfo;

/**
 * Interface for WindowManager to delegate control of display areas.
 * {@hide}
 */
oneway interface IDisplayAreaOrganizer {
    void onDisplayAreaAppeared(in WindowContainerToken displayArea);
    void onDisplayAreaVanished(in WindowContainerToken displayArea);
    void onDisplayAreaAppeared(in DisplayAreaInfo displayAreaInfo);
    void onDisplayAreaVanished(in DisplayAreaInfo displayAreaInfo);
}
Loading