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

Commit a28ed766 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Add WindowContainer proto definitions"

parents 609e37b3 04ab4398
Loading
Loading
Loading
Loading
+22 −3
Original line number Diff line number Diff line
@@ -16,20 +16,22 @@

package android.view;

import static android.view.Surface.ROTATION_270;
import static android.view.Surface.ROTATION_90;
import static android.graphics.Matrix.MSCALE_X;
import static android.graphics.Matrix.MSCALE_Y;
import static android.graphics.Matrix.MSKEW_X;
import static android.graphics.Matrix.MSKEW_Y;
import static android.graphics.Matrix.MTRANS_X;
import static android.graphics.Matrix.MTRANS_Y;
import static android.view.Surface.ROTATION_270;
import static android.view.Surface.ROTATION_90;
import static android.view.SurfaceControlProto.HASH_CODE;
import static android.view.SurfaceControlProto.NAME;

import android.annotation.Size;
import android.graphics.Bitmap;
import android.graphics.GraphicBuffer;
import android.graphics.PixelFormat;
import android.graphics.Matrix;
import android.graphics.PixelFormat;
import android.graphics.Point;
import android.graphics.Rect;
import android.graphics.Region;
@@ -40,11 +42,13 @@ import android.os.Process;
import android.os.UserHandle;
import android.util.ArrayMap;
import android.util.Log;
import android.util.proto.ProtoOutputStream;
import android.view.Surface.OutOfResourcesException;

import com.android.internal.annotations.GuardedBy;

import dalvik.system.CloseGuard;

import libcore.util.NativeAllocationRegistry;

import java.io.Closeable;
@@ -628,6 +632,21 @@ public class SurfaceControl implements Parcelable {
        nativeWriteToParcel(mNativeObject, dest);
    }

    /**
     * Write to a protocol buffer output stream. Protocol buffer message definition is at {@link
     * android.view.SurfaceControlProto}.
     *
     * @param proto Stream to write the SurfaceControl object to.
     * @param fieldId Field Id of the SurfaceControl as defined in the parent message.
     * @hide
     */
    public void writeToProto(ProtoOutputStream proto, long fieldId) {
        final long token = proto.start(fieldId);
        proto.write(HASH_CODE, System.identityHashCode(this));
        proto.write(NAME, mName);
        proto.end(token);
    }

    public static final Creator<SurfaceControl> CREATOR
            = new Creator<SurfaceControl>() {
        public SurfaceControl createFromParcel(Parcel in) {
+31 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2018 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.
 */

syntax = "proto2";

import "frameworks/base/core/proto/android/server/surfaceanimator.proto";

package com.android.server.wm.proto;
option java_multiple_files = true;

/**
 * Represents a {@link com.android.server.wm.AppWindowThumbnail} object.
 */
message AppWindowThumbnailProto {
  optional int32 width = 1;
  optional int32 height = 2;
  optional SurfaceAnimatorProto surface_animator = 3;
}
 No newline at end of file
+31 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2018 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.
 */

syntax = "proto2";

import "frameworks/base/core/proto/android/view/surfacecontrol.proto";

package com.android.server.wm.proto;
option java_multiple_files = true;

/**
 * Represents a {@link com.android.server.wm.SurfaceAnimator} object.
 */
message SurfaceAnimatorProto {
  optional string animation_adapter = 1;
  optional .android.view.SurfaceControlProto leash = 2;
  optional bool animation_start_delayed = 3;
}
 No newline at end of file
+34 −0
Original line number Diff line number Diff line
@@ -18,6 +18,8 @@ syntax = "proto2";

import "frameworks/base/core/proto/android/content/configuration.proto";
import "frameworks/base/core/proto/android/graphics/rect.proto";
import "frameworks/base/core/proto/android/server/appwindowthumbnail.proto";
import "frameworks/base/core/proto/android/server/surfaceanimator.proto";
import "frameworks/base/core/proto/android/view/displaycutout.proto";
import "frameworks/base/core/proto/android/view/displayinfo.proto";
import "frameworks/base/core/proto/android/view/windowlayoutparams.proto";
@@ -128,6 +130,12 @@ message StackProto {
  optional bool fills_parent = 4;
  optional .android.graphics.RectProto bounds = 5;
  optional bool animation_background_surface_is_dimming = 6;
  optional bool defer_removal = 7;
  optional float minimize_amount = 8;
  optional bool adjusted_for_ime = 9;
  optional float adjust_ime_amount = 10;
  optional float adjust_divider_amount = 11;
  optional .android.graphics.RectProto adjusted_bounds = 12;
}

/* represents Task */
@@ -138,6 +146,7 @@ message TaskProto {
  optional bool fills_parent = 4;
  optional .android.graphics.RectProto bounds = 5;
  optional .android.graphics.RectProto temp_inset_bounds = 6;
  optional bool defer_removal = 7;
}

/* represents AppWindowToken */
@@ -145,6 +154,27 @@ message AppWindowTokenProto {
  /* obtained from ActivityRecord */
  optional string name = 1;
  optional WindowTokenProto window_token = 2;
  optional bool last_surface_showing = 3;
  optional bool is_waiting_for_transition_start =  4;
  optional bool is_really_animating = 5;
  optional AppWindowThumbnailProto thumbnail = 6;
  optional bool fills_parent = 7;
  optional bool app_stopped = 8;
  optional bool hidden_requested = 9;
  optional bool client_hidden = 10;
  optional bool defer_hiding_client = 11;
  optional bool reported_drawn = 12;
  optional bool reported_visible = 13;
  optional int32 num_interesting_windows = 14;
  optional int32 num_drawn_windows = 15;
  optional bool all_drawn = 16;
  optional bool last_all_drawn = 17;
  optional bool removed = 18;
  optional IdentifierProto starting_window = 19;
  optional bool starting_displayed = 20;
  optional bool starting_moved = 21;
  optional bool hidden_set_from_transferred_starting_window = 22;
  repeated .android.graphics.RectProto frozen_bounds = 23;
}

/* represents WindowToken */
@@ -152,6 +182,9 @@ message WindowTokenProto {
  optional WindowContainerProto window_container = 1;
  optional int32 hash_code = 2;
  repeated WindowStateProto windows = 3;
  optional bool hidden = 4;
  optional bool waiting_to_show = 5;
  optional bool paused = 6;
}

/* represents WindowState */
@@ -234,6 +267,7 @@ message WindowContainerProto {
  optional ConfigurationContainerProto configuration_container = 1;
  optional int32 orientation = 2;
  optional bool visible = 3;
  optional SurfaceAnimatorProto surface_animator = 4;
}

/* represents ConfigurationContainer */
+0 −4
Original line number Diff line number Diff line
@@ -16,11 +16,7 @@

syntax = "proto2";

import "frameworks/base/core/proto/android/content/configuration.proto";
import "frameworks/base/core/proto/android/graphics/rect.proto";
import "frameworks/base/core/proto/android/server/windowmanagerservice.proto";
import "frameworks/base/core/proto/android/view/displayinfo.proto";
import "frameworks/base/core/proto/android/view/windowlayoutparams.proto";

package com.android.server.wm.proto;

Loading