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