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 
17 #pragma once
18 
19 #include <stddef.h>
20 #include <stdint.h>
21 #include <sys/cdefs.h>
22 
23 __BEGIN_DECLS
24 
25 enum AnnotationIds : uint8_t {
26     /**
27      * Annotation ID constant for logging UID field.
28      *
29      * Introduced in API 31.
30      */
31     ASTATSLOG_ANNOTATION_ID_IS_UID = 1,
32 
33     /**
34      * Annotation ID constant to indicate logged atom event's timestamp should be truncated.
35      *
36      * Introduced in API 31.
37      */
38     ASTATSLOG_ANNOTATION_ID_TRUNCATE_TIMESTAMP = 2,
39 
40     /**
41      * Annotation ID constant for a state atom's primary field.
42      *
43      * Introduced in API 31.
44      */
45     ASTATSLOG_ANNOTATION_ID_PRIMARY_FIELD = 3,
46 
47     /**
48      * Annotation ID constant for state atom's state field.
49      *
50      * Introduced in API 31.
51      */
52     ASTATSLOG_ANNOTATION_ID_EXCLUSIVE_STATE = 4,
53 
54     /**
55      * Annotation ID constant to indicate the first UID in the attribution chain
56      * is a primary field.
57      *
58      * Introduced in API 31.
59      */
60     ASTATSLOG_ANNOTATION_ID_PRIMARY_FIELD_FIRST_UID = 5,
61 
62     /**
63      * Annotation ID constant to indicate which state is default for the state atom.
64      *
65      * Introduced in API 31.
66      */
67     ASTATSLOG_ANNOTATION_ID_DEFAULT_STATE = 6,
68 
69     /**
70      * Annotation ID constant to signal that all states should be reset to the default state.
71      *
72      * Introduced in API 31.
73      */
74     ASTATSLOG_ANNOTATION_ID_TRIGGER_STATE_RESET = 7,
75 
76     /**
77      * Annotation ID constant to indicate state changes need to account for nesting.
78      * This should only be used with binary state atoms.
79      *
80      * Introduced in API 31.
81      */
82     ASTATSLOG_ANNOTATION_ID_STATE_NESTED = 8,
83 
84     /**
85      * Annotation ID constant to indicate the restriction category of an atom.
86      * This annotation must only be attached to the atom id. This is an int annotation.
87      *
88      * Introduced in API 34.
89      */
90     ASTATSLOG_ANNOTATION_ID_RESTRICTION_CATEGORY = 9,
91 
92     /**
93      * Annotation ID to indicate that a field of an atom contains peripheral device info.
94      * This is a bool annotation.
95      *
96      * Introduced in API 34.
97      */
98     ASTATSLOG_ANNOTATION_ID_FIELD_RESTRICTION_PERIPHERAL_DEVICE_INFO = 10,
99 
100     /**
101      * Annotation ID to indicate that a field of an atom contains app usage information.
102      * This is a bool annotation.
103      *
104      * Introduced in API 34.
105      */
106     ASTATSLOG_ANNOTATION_ID_FIELD_RESTRICTION_APP_USAGE = 11,
107 
108     /**
109      * Annotation ID to indicate that a field of an atom contains app activity information.
110      * This is a bool annotation.
111      *
112      * Introduced in API 34.
113      */
114     ASTATSLOG_ANNOTATION_ID_FIELD_RESTRICTION_APP_ACTIVITY = 12,
115 
116     /**
117      * Annotation ID to indicate that a field of an atom contains health connect information.
118      * This is a bool annotation.
119      *
120      * Introduced in API 34.
121      */
122     ASTATSLOG_ANNOTATION_ID_FIELD_RESTRICTION_HEALTH_CONNECT = 13,
123 
124     /**
125      * Annotation ID to indicate that a field of an atom contains accessibility information.
126      * This is a bool annotation.
127      *
128      * Introduced in API 34.
129      */
130     ASTATSLOG_ANNOTATION_ID_FIELD_RESTRICTION_ACCESSIBILITY = 14,
131 
132     /**
133      * Annotation ID to indicate that a field of an atom contains system search information.
134      * This is a bool annotation.
135      *
136      * Introduced in API 34.
137      */
138     ASTATSLOG_ANNOTATION_ID_FIELD_RESTRICTION_SYSTEM_SEARCH = 15,
139 
140     /**
141      * Annotation ID to indicate that a field of an atom contains user engagement information.
142      * This is a bool annotation.
143      *
144      * Introduced in API 34.
145      */
146     ASTATSLOG_ANNOTATION_ID_FIELD_RESTRICTION_USER_ENGAGEMENT = 16,
147 
148     /**
149      * Annotation ID to indicate that a field of an atom contains ambient sensing information.
150      * This is a bool annotation.
151      *
152      * Introduced in API 34.
153      */
154     ASTATSLOG_ANNOTATION_ID_FIELD_RESTRICTION_AMBIENT_SENSING = 17,
155 
156     /**
157      * Annotation ID to indicate that a field of an atom contains demographic classification
158      * information. This is a bool annotation.
159      *
160      * Introduced in API 34.
161      */
162     ASTATSLOG_ANNOTATION_ID_FIELD_RESTRICTION_DEMOGRAPHIC_CLASSIFICATION = 18,
163 };
164 
165 enum AStatsLogRestrictionCategory : uint32_t {
166     /**
167      * Restriction category for atoms about diagnostics.
168      *
169      * Introduced in API 34.
170      */
171     ASTATSLOG_RESTRICTION_CATEGORY_DIAGNOSTIC = 1,
172 
173     /**
174      * Restriction category for atoms about system intelligence.
175      *
176      * Introduced in API 34.
177      */
178     ASTATSLOG_RESTRICTION_CATEGORY_SYSTEM_INTELLIGENCE = 2,
179 
180     /**
181      * Restriction category for atoms about authentication.
182      *
183      * Introduced in API 34.
184      */
185     ASTATSLOG_RESTRICTION_CATEGORY_AUTHENTICATION = 3,
186 
187     /**
188      * Restriction category for atoms about fraud and abuse.
189      *
190      * Introduced in API 34.
191      */
192     ASTATSLOG_RESTRICTION_CATEGORY_FRAUD_AND_ABUSE = 4,
193 
194 };
195 __END_DECLS
196