//
// Copyright (C) 2023 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.

// @generated by protoc-gen-es v2.2.2 with parameter "target=ts"
// @generated from file protos/perfetto/trace/android/shell_transition.proto (package perfetto.protos, syntax proto2)
/* eslint-disable */

import type { GenFile, GenMessage } from "@bufbuild/protobuf/codegenv1";
import { fileDesc, messageDesc } from "@bufbuild/protobuf/codegenv1";
import type { Message } from "@bufbuild/protobuf";

/**
 * Describes the file protos/perfetto/trace/android/shell_transition.proto.
 */
export const file_protos_perfetto_trace_android_shell_transition: GenFile = /*@__PURE__*/
  fileDesc("CjRwcm90b3MvcGVyZmV0dG8vdHJhY2UvYW5kcm9pZC9zaGVsbF90cmFuc2l0aW9uLnByb3RvEg9wZXJmZXR0by5wcm90b3MimQQKD1NoZWxsVHJhbnNpdGlvbhIKCgJpZBgBIAEoBRIWCg5jcmVhdGVfdGltZV9ucxgCIAEoAxIUCgxzZW5kX3RpbWVfbnMYAyABKAMSGAoQZGlzcGF0Y2hfdGltZV9ucxgEIAEoAxIVCg1tZXJnZV90aW1lX25zGAUgASgDEh0KFW1lcmdlX3JlcXVlc3RfdGltZV9ucxgGIAEoAxIbChNzaGVsbF9hYm9ydF90aW1lX25zGAcgASgDEhgKEHdtX2Fib3J0X3RpbWVfbnMYCCABKAMSFgoOZmluaXNoX3RpbWVfbnMYCSABKAMSHAoUc3RhcnRfdHJhbnNhY3Rpb25faWQYCiABKAQSHQoVZmluaXNoX3RyYW5zYWN0aW9uX2lkGAsgASgEEg8KB2hhbmRsZXIYDCABKAUSDAoEdHlwZRgNIAEoBRI4Cgd0YXJnZXRzGA4gAygLMicucGVyZmV0dG8ucHJvdG9zLlNoZWxsVHJhbnNpdGlvbi5UYXJnZXQSFAoMbWVyZ2VfdGFyZ2V0GA8gASgFEg0KBWZsYWdzGBAgASgFEiYKHnN0YXJ0aW5nX3dpbmRvd19yZW1vdmVfdGltZV9ucxgRIAEoAxpKCgZUYXJnZXQSDAoEbW9kZRgBIAEoBRIQCghsYXllcl9pZBgCIAEoBRIRCgl3aW5kb3dfaWQYAyABKAUSDQoFZmxhZ3MYBCABKAUiTQoUU2hlbGxIYW5kbGVyTWFwcGluZ3MSNQoHbWFwcGluZxgBIAMoCzIkLnBlcmZldHRvLnByb3Rvcy5TaGVsbEhhbmRsZXJNYXBwaW5nIi8KE1NoZWxsSGFuZGxlck1hcHBpbmcSCgoCaWQYASABKAUSDAoEbmFtZRgCIAEoCQ");

/**
 * ShellTransition messages record information about the shell transitions in
 * the system. This is used to track the animations that are created and execute
 * through the shell transition system.
 *
 * @generated from message perfetto.protos.ShellTransition
 */
export type ShellTransition = Message<"perfetto.protos.ShellTransition"> & {
  /**
   * The unique identifier of the transition.
   *
   * @generated from field: optional int32 id = 1;
   */
  id: number;

  /**
   * The time the transition was created on the WM side
   * (using SystemClock.elapsedRealtimeNanos())
   *
   * @generated from field: optional int64 create_time_ns = 2;
   */
  createTimeNs: bigint;

  /**
   * The time the transition was sent from the WM side to shell
   * (using SystemClock.elapsedRealtimeNanos())
   *
   * @generated from field: optional int64 send_time_ns = 3;
   */
  sendTimeNs: bigint;

  /**
   * The time the transition was dispatched by shell to execute
   * (using SystemClock.elapsedRealtimeNanos())
   *
   * @generated from field: optional int64 dispatch_time_ns = 4;
   */
  dispatchTimeNs: bigint;

  /**
   * If the transition merge was accepted by the transition handler, this
   * contains the time the transition was merged into transition with id
   * `merge_target`.
   * (using SystemClock.elapsedRealtimeNanos())
   *
   * @generated from field: optional int64 merge_time_ns = 5;
   */
  mergeTimeNs: bigint;

  /**
   * The time shell proposed the transition should be merged to the transition
   * handler into transition with id `merge_target`.
   * (using SystemClock.elapsedRealtimeNanos()).
   *
   * @generated from field: optional int64 merge_request_time_ns = 6;
   */
  mergeRequestTimeNs: bigint;

  /**
   * If the transition was aborted on the shell side, this is the time that
   * occurred.
   * (using SystemClock.elapsedRealtimeNanos())
   *
   * @generated from field: optional int64 shell_abort_time_ns = 7;
   */
  shellAbortTimeNs: bigint;

  /**
   * If the transition was aborted on the wm side, this is the time that
   * occurred.
   * (using SystemClock.elapsedRealtimeNanos())
   *
   * @generated from field: optional int64 wm_abort_time_ns = 8;
   */
  wmAbortTimeNs: bigint;

  /**
   * The time WM considers the transition to be complete.
   * (using SystemClock.elapsedRealtimeNanos())
   *
   * @generated from field: optional int64 finish_time_ns = 9;
   */
  finishTimeNs: bigint;

  /**
   * The id of the transaction that WM proposed to use as the starting
   * transaction. It contains all the layer changes required to setup the
   * transition and should be executed right at the start of the transition
   * by the transition handler.
   *
   * @generated from field: optional uint64 start_transaction_id = 10;
   */
  startTransactionId: bigint;

  /**
   * The if of the transaction that WM proposed to use as the finish
   * transaction. It contains all the layer changes required to set the final
   * state of the transition.
   *
   * @generated from field: optional uint64 finish_transaction_id = 11;
   */
  finishTransactionId: bigint;

  /**
   * The id of the handler that executed the transition. A HandlerMappings
   * message in the trace will contain the mapping of id to a string
   * representation of the handler.
   *
   * @generated from field: optional int32 handler = 12;
   */
  handler: number;

  /**
   * The transition type of this transition (e.g. TO_FRONT, OPEN, CLOSE).
   *
   * @generated from field: optional int32 type = 13;
   */
  type: number;

  /**
   * The list of targets that are part of this transition.
   *
   * @generated from field: repeated perfetto.protos.ShellTransition.Target targets = 14;
   */
  targets: ShellTransition_Target[];

  /**
   * The id of the transition we have requested to merge or have merged this
   * transition into.
   *
   * @generated from field: optional int32 merge_target = 15;
   */
  mergeTarget: number;

  /**
   * The flags set on this transition.
   *
   * @generated from field: optional int32 flags = 16;
   */
  flags: number;

  /**
   * The time the starting window was removed. Tracked because this can
   * happen after the transition finishes, but the app may not yet be visible
   * until the starting window is removed. So in a sense the transition is not
   * finished until the starting window is removed. (b/284302118)
   * (using SystemClock.elapsedRealtimeNanos())
   *
   * @generated from field: optional int64 starting_window_remove_time_ns = 17;
   */
  startingWindowRemoveTimeNs: bigint;
};

/**
 * Describes the message perfetto.protos.ShellTransition.
 * Use `create(ShellTransitionSchema)` to create a new message.
 */
export const ShellTransitionSchema: GenMessage<ShellTransition> = /*@__PURE__*/
  messageDesc(file_protos_perfetto_trace_android_shell_transition, 0);

/**
 * Contains the information about the windows targeted in a transition.
 *
 * @generated from message perfetto.protos.ShellTransition.Target
 */
export type ShellTransition_Target = Message<"perfetto.protos.ShellTransition.Target"> & {
  /**
   * The transition mode of this target (e.g. TO_FRONT, CLOSE...)
   *
   * @generated from field: optional int32 mode = 1;
   */
  mode: number;

  /**
   * The layer id of this target.
   *
   * @generated from field: optional int32 layer_id = 2;
   */
  layerId: number;

  /**
   * The window id of this target.
   *
   * @generated from field: optional int32 window_id = 3;
   */
  windowId: number;

  /**
   * The flags set on this target.
   *
   * @generated from field: optional int32 flags = 4;
   */
  flags: number;
};

/**
 * Describes the message perfetto.protos.ShellTransition.Target.
 * Use `create(ShellTransition_TargetSchema)` to create a new message.
 */
export const ShellTransition_TargetSchema: GenMessage<ShellTransition_Target> = /*@__PURE__*/
  messageDesc(file_protos_perfetto_trace_android_shell_transition, 0, 0);

/**
 * Contains mappings from handler ids to string representation of the handlers.
 *
 * @generated from message perfetto.protos.ShellHandlerMappings
 */
export type ShellHandlerMappings = Message<"perfetto.protos.ShellHandlerMappings"> & {
  /**
   * @generated from field: repeated perfetto.protos.ShellHandlerMapping mapping = 1;
   */
  mapping: ShellHandlerMapping[];
};

/**
 * Describes the message perfetto.protos.ShellHandlerMappings.
 * Use `create(ShellHandlerMappingsSchema)` to create a new message.
 */
export const ShellHandlerMappingsSchema: GenMessage<ShellHandlerMappings> = /*@__PURE__*/
  messageDesc(file_protos_perfetto_trace_android_shell_transition, 1);

/**
 * @generated from message perfetto.protos.ShellHandlerMapping
 */
export type ShellHandlerMapping = Message<"perfetto.protos.ShellHandlerMapping"> & {
  /**
   * The id of the handler used in the ShellTransition message.
   *
   * @generated from field: optional int32 id = 1;
   */
  id: number;

  /**
   * A human readable and meaningful string representation of the handler.
   *
   * @generated from field: optional string name = 2;
   */
  name: string;
};

/**
 * Describes the message perfetto.protos.ShellHandlerMapping.
 * Use `create(ShellHandlerMappingSchema)` to create a new message.
 */
export const ShellHandlerMappingSchema: GenMessage<ShellHandlerMapping> = /*@__PURE__*/
  messageDesc(file_protos_perfetto_trace_android_shell_transition, 2);

