Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2017 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 = "proto2"; |
| 18 | |
Stefan Lafon | ae2df01 | 2017-11-14 09:17:21 -0800 | [diff] [blame] | 19 | import "frameworks/base/cmds/statsd/src/atoms.proto"; |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 20 | |
| 21 | package android.stats_log_api_gen; |
| 22 | |
| 23 | message IntAtom { |
| 24 | optional int32 field1 = 1; |
| 25 | } |
| 26 | |
| 27 | message AnotherIntAtom { |
| 28 | optional int32 field1 = 1; |
| 29 | } |
| 30 | |
| 31 | message OutOfOrderAtom { |
| 32 | optional int32 field2 = 2; |
| 33 | optional int32 field1 = 1; |
| 34 | } |
| 35 | |
| 36 | enum AnEnum { |
| 37 | VALUE0 = 0; |
| 38 | VALUE1 = 1; |
| 39 | } |
| 40 | |
| 41 | message AllTypesAtom { |
Yangster-mac | 7604aea | 2017-12-11 22:55:49 -0800 | [diff] [blame^] | 42 | optional android.os.statsd.AttributionChain attribution_chain = 1; |
| 43 | optional double double_field = 2; |
| 44 | optional float float_field = 3; |
| 45 | optional int64 int64_field = 4; |
| 46 | optional uint64 uint64_field = 5; |
| 47 | optional int32 int32_field = 6; |
| 48 | optional fixed64 fixed64_field = 7; |
| 49 | optional fixed32 fixed32_field = 8; |
| 50 | optional bool bool_field = 9; |
| 51 | optional string string_field = 10; |
| 52 | optional uint32 uint32_field = 11; |
| 53 | optional AnEnum enum_field = 12; |
| 54 | optional sfixed32 sfixed32_field = 13; |
| 55 | optional sfixed64 sfixed64_field = 14; |
| 56 | optional sint32 sint32_field = 15; |
| 57 | optional sint64 sint64_field = 16; |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 58 | } |
| 59 | |
| 60 | message Event { |
| 61 | oneof event { |
| 62 | OutOfOrderAtom out_of_order_atom = 2; |
| 63 | IntAtom int_atom = 1; |
| 64 | AnotherIntAtom another_int_atom = 3; |
| 65 | AllTypesAtom all_types_atom = 4; |
| 66 | } |
| 67 | } |
| 68 | |
| 69 | message BadTypesAtom { |
| 70 | optional IntAtom bad_int_atom = 1; |
| 71 | optional bytes bad_bytes = 2; |
| 72 | } |
| 73 | |
| 74 | message BadTypesEvent { |
| 75 | oneof event { |
| 76 | BadTypesAtom bad_types_atom = 1; |
| 77 | } |
| 78 | } |
| 79 | |
| 80 | message BadSkippedFieldSingleAtom { |
| 81 | optional int32 field2 = 2; |
| 82 | } |
| 83 | |
| 84 | message BadSkippedFieldSingle { |
| 85 | oneof event { |
| 86 | BadSkippedFieldSingleAtom bad = 1; |
| 87 | } |
| 88 | } |
| 89 | |
| 90 | message BadSkippedFieldMultipleAtom { |
| 91 | optional int32 field1 = 1; |
| 92 | optional int32 field3 = 3; |
| 93 | optional int32 field5 = 5; |
| 94 | } |
| 95 | |
| 96 | message BadSkippedFieldMultiple { |
| 97 | oneof event { |
| 98 | BadSkippedFieldMultipleAtom bad = 1; |
| 99 | } |
| 100 | } |
| 101 | |
Yangster-mac | 7604aea | 2017-12-11 22:55:49 -0800 | [diff] [blame^] | 102 | message BadAttributionChainPositionAtom { |
| 103 | optional int32 field1 = 1; |
| 104 | optional android.os.statsd.AttributionChain attribution = 2; |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 105 | } |
| 106 | |
Yangster-mac | 7604aea | 2017-12-11 22:55:49 -0800 | [diff] [blame^] | 107 | message BadAttributionChainPosition { |
| 108 | oneof event { BadAttributionChainPositionAtom bad = 1; } |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 109 | } |
| 110 | |