| 1 |
/* |
| 2 |
* Copyright (C) 2022 The Android Open Source Project |
| 3 |
* |
| 4 |
* Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 |
* you may not use this file except in compliance with the License. |
| 6 |
* You may obtain a copy of the License at |
| 7 |
* |
| 8 |
* http://www.apache.org/licenses/LICENSE-2.0 |
| 9 |
* |
| 10 |
* Unless required by applicable law or agreed to in writing, software |
| 11 |
* distributed under the License is distributed on an "AS IS" BASIS, |
| 12 |
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 |
* See the License for the specific language governing permissions and |
| 14 |
* limitations under the License. |
| 15 |
*/ |
| 16 |
|
| 17 |
syntax = "proto3"; |
| 18 |
|
| 19 |
package com.android.server.wm.shell; |
| 20 |
|
| 21 |
import "frameworks/base/core/proto/android/server/windowmanagerservice.proto"; |
| 22 |
|
| 23 |
option java_multiple_files = true; |
| 24 |
|
| 25 |
/* Represents a file full of transition entries. |
| 26 |
Encoded, it should start with 0x9 0x57 0x49 0x4e 0x54 0x52 0x41 0x43 0x45 (.TRNTRACE), such |
| 27 |
that it can be easily identified. */ |
| 28 |
message TransitionTraceProto { |
| 29 |
|
| 30 |
/* constant; MAGIC_NUMBER = (long) MAGIC_NUMBER_H << 32 | MagicNumber.MAGIC_NUMBER_L |
| 31 |
(this is needed because enums have to be 32 bits and there's no nice way to put 64bit |
| 32 |
constants into .proto files. */ |
| 33 |
enum MagicNumber { |
| 34 |
INVALID = 0; |
| 35 |
MAGIC_NUMBER_L = 0x544e5254; /* TRNT (little-endian ASCII) */ |
| 36 |
MAGIC_NUMBER_H = 0x45434152; /* RACE (little-endian ASCII) */ |
| 37 |
} |
| 38 |
|
| 39 |
fixed64 magic_number = 1; /* Must be the first field, set to value in MagicNumber */ |
| 40 |
int64 timestamp = 2; /* The timestamp of when the trace was started. */ |
| 41 |
repeated Transition transition = 3; |
| 42 |
} |
| 43 |
|
| 44 |
message Transition { |
| 45 |
|
| 46 |
enum State { |
| 47 |
COLLECTING = 0; |
| 48 |
PENDING = -1; |
| 49 |
STARTED = 1; |
| 50 |
PLAYING = 2; |
| 51 |
ABORT = 3; |
| 52 |
FINISHED = 4; |
| 53 |
} |
| 54 |
|
| 55 |
int32 id = 1; |
| 56 |
int32 transition_type = 2; |
| 57 |
int64 timestamp = 3; |
| 58 |
State state = 5; |
| 59 |
int32 flags = 6; |
| 60 |
repeated ChangeInfo change = 7; |
| 61 |
uint64 start_transaction_id = 8; |
| 62 |
uint64 finish_transaction_id = 9; |
| 63 |
} |
| 64 |
|
| 65 |
message ChangeInfo { |
| 66 |
com.android.server.wm.IdentifierProto window_identifier = 1; |
| 67 |
int32 transit_mode = 2; |
| 68 |
bool has_changed = 3; |
| 69 |
int32 change_flags = 4; |
| 70 |
} |