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
17syntax = "proto2";
18
19package com.android.app.viewcapture.data;
20
21option java_multiple_files = true;
22
23message ExportedData {
24  /* constant; MAGIC_NUMBER = (long) MAGIC_NUMBER_H << 32 | MagicNumber.MAGIC_NUMBER_L
25   (this is needed because enums have to be 32 bits and there's no nice way to put 64bit
26    constants into .proto files. */
27  enum MagicNumber {
28    INVALID = 0;
29    MAGIC_NUMBER_L = 0x65906578;  /* AZAN (ASCII) */
30    MAGIC_NUMBER_H = 0x68658273;  /* DARI (ASCII) */
31  }
32
33  optional fixed64 magic_number = 1;  /* Must be the first field, set to value in MagicNumber */
34  repeated WindowData windowData = 2;
35  optional string package = 3;
36  repeated string classname = 4;
37
38  /* offset between real-time clock and elapsed time clock in nanoseconds.
39     Calculated as: 1000000 * System.currentTimeMillis() - SystemClock.elapsedRealtimeNanos() */
40  optional fixed64 real_to_elapsed_time_offset_nanos = 5;
41}
42
43message WindowData {
44  repeated FrameData frameData = 1;
45  optional string title = 2;
46}
47
48message MotionWindowData {
49  repeated FrameData frameData = 1;
50  repeated string classname = 2;
51}
52
53message FrameData {
54  optional int64 timestamp = 1; // unit is elapsed realtime nanos
55  optional ViewNode node = 2;
56}
57
58message ViewNode {
59  optional int32 classname_index = 1;
60  optional int32 hashcode = 2;
61
62  repeated ViewNode children = 3;
63
64  optional string id = 4;
65  optional int32 left = 5;
66  optional int32 top = 6;
67  optional int32 width = 7;
68  optional int32 height = 8;
69  optional int32 scrollX = 9;
70  optional int32 scrollY = 10;
71
72  optional float translationX = 11;
73  optional float translationY = 12;
74  optional float scaleX = 13 [default = 1];
75  optional float scaleY = 14 [default = 1];
76  optional float alpha = 15 [default = 1];
77
78  optional bool willNotDraw = 16;
79  optional bool clipChildren = 17;
80  optional int32 visibility = 18;
81
82  optional float elevation = 19;
83}
84