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

Commit d45dba76 authored by Chris Li's avatar Chris Li
Browse files

Remove TaskFragmentAppearedInfo

We don't really have any use case to manipulate TaskFragment leash, and
removing it can reduce chance for related security issue.

Fix: 207061678
Test: pass existing
Change-Id: I24617228991f030335ba74ce7c2ee48b9c33b9d6
parent 4d94c48a
Loading
Loading
Loading
Loading
+1 −7
Original line number Diff line number Diff line
@@ -3204,12 +3204,6 @@ package android.window {
    field @NonNull public static final android.os.Parcelable.Creator<android.window.TaskAppearedInfo> CREATOR;
  }

  public final class TaskFragmentAppearedInfo implements android.os.Parcelable {
    method @NonNull public android.view.SurfaceControl getLeash();
    method @NonNull public android.window.TaskFragmentInfo getTaskFragmentInfo();
    field @NonNull public static final android.os.Parcelable.Creator<android.window.TaskFragmentAppearedInfo> CREATOR;
  }

  public final class TaskFragmentCreationParams implements android.os.Parcelable {
    method @NonNull public android.os.IBinder getFragmentToken();
    method @NonNull public android.graphics.Rect getInitialBounds();
@@ -3246,7 +3240,7 @@ package android.window {
    ctor public TaskFragmentOrganizer(@NonNull java.util.concurrent.Executor);
    method @NonNull public java.util.concurrent.Executor getExecutor();
    method @NonNull public android.window.TaskFragmentOrganizerToken getOrganizerToken();
    method public void onTaskFragmentAppeared(@NonNull android.window.TaskFragmentAppearedInfo);
    method public void onTaskFragmentAppeared(@NonNull android.window.TaskFragmentInfo);
    method public void onTaskFragmentError(@NonNull android.os.IBinder, @NonNull Throwable);
    method public void onTaskFragmentInfoChanged(@NonNull android.window.TaskFragmentInfo);
    method public void onTaskFragmentParentInfoChanged(@NonNull android.os.IBinder, @NonNull android.content.res.Configuration);
+1 −2
Original line number Diff line number Diff line
@@ -19,12 +19,11 @@ package android.window;
import android.content.res.Configuration;
import android.os.Bundle;
import android.os.IBinder;
import android.window.TaskFragmentAppearedInfo;
import android.window.TaskFragmentInfo;

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

+0 −23
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;
+0 −93
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.annotation.TestApi;
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
 */
@TestApi
public final class TaskFragmentAppearedInfo implements Parcelable {

    @NonNull
    private final TaskFragmentInfo mTaskFragmentInfo;

    @NonNull
    private final SurfaceControl mLeash;

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

    @NonNull
    public TaskFragmentInfo getTaskFragmentInfo() {
        return mTaskFragmentInfo;
    }

    @NonNull
    public SurfaceControl getLeash() {
        return mLeash;
    }

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

    /** @hide */
    @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
                + "}";
    }

    /** @hide */
    @Override
    public int describeContents() {
        return 0;
    }
}
+2 −3
Original line number Diff line number Diff line
@@ -120,8 +120,7 @@ public class TaskFragmentOrganizer extends WindowOrganizer {
    }

    /** Called when a TaskFragment is created and organized by this organizer. */
    public void onTaskFragmentAppeared(
            @NonNull TaskFragmentAppearedInfo taskFragmentAppearedInfo) {}
    public void onTaskFragmentAppeared(@NonNull TaskFragmentInfo taskFragmentInfo) {}

    /** Called when the status of an organized TaskFragment is changed. */
    public void onTaskFragmentInfoChanged(@NonNull TaskFragmentInfo taskFragmentInfo) {}
@@ -169,7 +168,7 @@ public class TaskFragmentOrganizer extends WindowOrganizer {

    private final ITaskFragmentOrganizer mInterface = new ITaskFragmentOrganizer.Stub() {
        @Override
        public void onTaskFragmentAppeared(@NonNull TaskFragmentAppearedInfo taskFragmentInfo) {
        public void onTaskFragmentAppeared(@NonNull TaskFragmentInfo taskFragmentInfo) {
            mExecutor.execute(
                    () -> TaskFragmentOrganizer.this.onTaskFragmentAppeared(taskFragmentInfo));
        }
Loading