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

Commit 6f08bac3 authored by Chris Li's avatar Chris Li Committed by Automerger Merge Worker
Browse files

Merge changes from topic "task_fragment_organizer" into sc-v2-dev am: f555a8a0 am: a6e7ba91

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14954952

Change-Id: Icb2704845a0f5fc1642297a8460dd3bb9cccff2d
parents d15f7b11 a6e7ba91
Loading
Loading
Loading
Loading
+40 −0
Original line number Diff line number Diff line
/**
 * Copyright (c) 2021 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.content.res.Configuration;
import android.os.IBinder;
import android.window.TaskFragmentAppearedInfo;
import android.window.TaskFragmentInfo;

/** @hide */
oneway interface ITaskFragmentOrganizer {
    void onTaskFragmentAppeared(in TaskFragmentAppearedInfo taskFragmentAppearedInfo);
    void onTaskFragmentInfoChanged(in TaskFragmentInfo taskFragmentInfo);
    void onTaskFragmentVanished(in TaskFragmentInfo taskFragmentInfo);

    /**
     * Called when the parent leaf Task of organized TaskFragments is changed.
     * When the leaf Task is changed, the organizer may want to update the TaskFragments in one
     * transaction.
     *
     * For case like screen size change, it will trigger onTaskFragmentParentInfoChanged with new
     * Task bounds, but may not trigger onTaskFragmentInfoChanged because there can be an override
     * bounds.
     */
    void onTaskFragmentParentInfoChanged(in IBinder fragmentToken, in Configuration parentConfig);
}
+33 −0
Original line number Diff line number Diff line
/**
 * Copyright (c) 2021 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.ITaskFragmentOrganizer;

/** @hide */
interface ITaskFragmentOrganizerController {

    /**
     * Registers a TaskFragmentOrganizer to manage TaskFragments.
     */
    void registerOrganizer(in ITaskFragmentOrganizer organizer);

    /**
     * Unregisters a previously registered TaskFragmentOrganizer.
     */
    void unregisterOrganizer(in ITaskFragmentOrganizer organizer);
}
+4 −0
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@ import android.view.SurfaceControl;

import android.os.IBinder;
import android.window.IDisplayAreaOrganizerController;
import android.window.ITaskFragmentOrganizerController;
import android.window.ITaskOrganizerController;
import android.window.ITransitionPlayer;
import android.window.IWindowContainerTransactionCallback;
@@ -77,6 +78,9 @@ interface IWindowOrganizerController {
    /** @return An interface enabling the management of display area organizers. */
    IDisplayAreaOrganizerController getDisplayAreaOrganizerController();

    /** @return An interface enabling the management of task fragment organizers. */
    ITaskFragmentOrganizerController getTaskFragmentOrganizerController();

    /**
     * Registers a transition player with Core. There is only one of these at a time and calling
     * this will replace the existing one if set.
+23 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2021 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;

/**
 * Data object for the TaskFragment info provided when a TaskFragment is presented to an organizer.
 * @hide
 */
parcelable TaskFragmentAppearedInfo;
+86 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2021 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.os.Parcel;
import android.os.Parcelable;
import android.view.SurfaceControl;

/**
 * Data object for the TaskFragment info provided when a TaskFragment is presented to an organizer.
 * @hide
 */
public final class TaskFragmentAppearedInfo implements Parcelable {

    @NonNull
    private final TaskFragmentInfo mTaskFragmentInfo;

    @NonNull
    private final SurfaceControl mLeash;

    public TaskFragmentAppearedInfo(
            @NonNull TaskFragmentInfo taskFragmentInfo, @NonNull SurfaceControl leash) {
        mTaskFragmentInfo = taskFragmentInfo;
        mLeash = leash;
    }

    public TaskFragmentInfo getTaskFragmentInfo() {
        return mTaskFragmentInfo;
    }

    public SurfaceControl getLeash() {
        return mLeash;
    }

    private TaskFragmentAppearedInfo(Parcel in) {
        mTaskFragmentInfo = in.readTypedObject(TaskFragmentInfo.CREATOR);
        mLeash = in.readTypedObject(SurfaceControl.CREATOR);
    }

    @Override
    public void writeToParcel(@NonNull Parcel dest, int flags) {
        dest.writeTypedObject(mTaskFragmentInfo, flags);
        dest.writeTypedObject(mLeash, flags);
    }

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

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

    @Override
    public String toString() {
        return "TaskFragmentAppearedInfo{"
                + " taskFragmentInfo=" + mTaskFragmentInfo
                + "}";
    }

    @Override
    public int describeContents() {
        return 0;
    }
}
Loading