1/* 2 * Copyright (C) 2020 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 19import "frameworks/base/core/proto/android/server/accessibility.proto"; 20import "frameworks/base/core/proto/android/server/windowmanagerservice.proto"; 21 22package com.android.server.accessibility; 23 24option java_multiple_files = true; 25 26/* represents a file full of accessibility trace entries. 27 Encoded, it should start with 0x9 0x41 0x31 0x31 0x59 0x54 0x52 0x41 0x43 (.A11YTRAC), such 28 that they can be easily identified. */ 29message AccessibilityTraceFileProto { 30 31 /* constant; MAGIC_NUMBER = (long) MAGIC_NUMBER_H << 32 | MagicNumber.MAGIC_NUMBER_L 32 (this is needed because enums have to be 32 bits and there's no nice way to put 64bit 33 constants into .proto files. */ 34 enum MagicNumber { 35 INVALID = 0; 36 MAGIC_NUMBER_L = 0x59313141; /* A11Y (little-endian ASCII) */ 37 MAGIC_NUMBER_H = 0x43415254; /* TRAC (little-endian ASCII) */ 38 } 39 40 optional fixed64 magic_number = 1; /* Must be the first field, set to value in MagicNumber */ 41 repeated AccessibilityTraceProto entry = 2; 42 43 /* offset between real-time clock and elapsed time clock in nanoseconds. 44 Calculated as: 1000000 * System.currentTimeMillis() - SystemClock.elapsedRealtimeNanos() */ 45 optional fixed64 real_to_elapsed_time_offset_nanos = 3; 46} 47 48/* one accessibility trace entry. */ 49message AccessibilityTraceProto { 50 /* required: elapsed realtime in nanos since boot of when this entry was logged */ 51 optional fixed64 elapsed_realtime_nanos = 1; 52 optional string calendar_time = 2; 53 repeated string logging_type = 3; 54 optional string process_name = 4; 55 optional string thread_id_name = 5; 56 57 /* where the trace originated */ 58 optional string where = 6; 59 60 optional string calling_pkg = 7; 61 optional string calling_params = 8; 62 optional string calling_stacks = 9; 63 64 optional AccessibilityDumpProto accessibility_service = 10; 65 optional com.android.server.wm.WindowManagerServiceDumpProto window_manager_service = 11; 66 optional string cpu_stats = 12; 67} 68