xref: /aosp_15_r20/external/perfetto/protos/perfetto/trace/android/privacy.proto (revision 6dbdd20afdafa5e3ca9b8809fa73465d530080dc)
1/*
2 * Copyright (C) 2016 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 perfetto.protos;
20
21import "google/protobuf/descriptor.proto";
22
23enum Destination {
24    // Fields or messages annotated with DEST_LOCAL must never be
25    // extracted from the device automatically. They can be accessed
26    // by tools on the developer's workstation or test lab devices.
27    DEST_LOCAL = 0;
28
29    // Fields or messages annotated with DEST_EXPLICIT can be sent
30    // off the device with an explicit user action.
31    DEST_EXPLICIT = 100;
32
33    // Fields or messages annotated with DEST_AUTOMATIC can be sent by
34    // automatic means, without per-sending user consent. The user
35    // still must have previously accepted a consent to share this
36    // information.
37    DEST_AUTOMATIC = 200;
38
39    // This is the default value, which could be overridden by other values.
40    // The reason to pick 255 is it fits into one byte. UNSET fields are treated
41    // as EXPLICIT.
42    DEST_UNSET = 255;
43
44    // Currently use 0, 100, 200 and 255, values in between are reserved for futures.
45}
46
47message PrivacyFlags {
48    optional Destination dest = 1 [ default = DEST_UNSET ];
49
50    // regex to filter pii sensitive info from a string field type.
51    repeated string patterns = 2;
52}
53
54extend google.protobuf.FieldOptions {
55    // Flags used to annotate a field with right privacy level.
56    optional PrivacyFlags privacy = 102672883;
57}
58
59extend google.protobuf.MessageOptions {
60    // Flags used to annotate a message which all its unset primitive fields inhert this tag.
61    optional PrivacyFlags msg_privacy = 102672883;
62}
63
64