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"; 18package android.service; 19 20option java_multiple_files = true; 21option java_outer_classname = "SensorPrivacyServiceProto"; 22 23import "frameworks/base/core/proto/android/privacy.proto"; 24 25message AllSensorPrivacyServiceDumpProto { 26 option (android.msg_privacy).dest = DEST_AUTOMATIC; 27 28 // Is global sensor privacy enabled 29 optional bool is_enabled = 1; 30} 31 32message SensorPrivacyServiceDumpProto { 33 option (android.msg_privacy).dest = DEST_AUTOMATIC; 34 35 // DEPRECATED 36 // Is global sensor privacy enabled 37 optional bool is_enabled = 1; 38 39 // DEPRECATED 40 // Per sensor privacy enabled 41 repeated SensorPrivacyIndividualEnabledSensorProto individual_enabled_sensor = 2; 42 43 // Per user settings for sensor privacy 44 repeated SensorPrivacyUserProto user = 3; 45 46 // Implementation 47 optional string storage_implementation = 4; 48} 49 50message SensorPrivacyUserProto { 51 option (android.msg_privacy).dest = DEST_AUTOMATIC; 52 53 // User id 54 optional int32 user_id = 1; 55 56 // DEPRECATED 57 // Is global sensor privacy enabled 58 optional bool is_enabled = 2; 59 60 // Per sensor privacy enabled 61 // DEPRECATED 62 repeated SensorPrivacyIndividualEnabledSensorProto individual_enabled_sensor = 3; 63 64 // Per toggle type sensor privacy 65 repeated SensorPrivacySensorProto sensors = 4; 66} 67 68message SensorPrivacySensorProto { 69 option (android.msg_privacy).dest = DEST_AUTOMATIC; 70 71 enum Sensor { 72 UNKNOWN = 0; 73 74 MICROPHONE = 1; 75 CAMERA = 2; 76 } 77 78 optional int32 sensor = 1; 79 80 repeated SensorPrivacyIndividualEnabledSensorProto toggles = 2; 81} 82 83message SensorPrivacyIndividualEnabledSensorProto { 84 option (android.msg_privacy).dest = DEST_AUTOMATIC; 85 86 enum ToggleType { 87 SOFTWARE = 1; 88 HARDWARE = 2; 89 } 90 91 enum StateType { 92 ENABLED = 1; 93 DISABLED = 2; 94 } 95 96 // DEPRECATED 97 enum Sensor { 98 UNKNOWN = 0; 99 100 MICROPHONE = 1; 101 CAMERA = 2; 102 } 103 104 // Sensor for which privacy might be enabled 105 optional Sensor sensor = 1; 106 107 // DEPRECATED 108 optional bool is_enabled = 2; 109 110 // Timestamp of the last time the sensor was changed 111 optional int64 last_change = 3; 112 113 // The toggle type for this state 114 optional ToggleType toggle_type = 4; 115 116 // If sensor privacy state for this sensor 117 optional StateType state_type = 5; 118} 119 120message SensorPrivacyToggleSourceProto { 121 option (android.msg_privacy).dest = DEST_AUTOMATIC; 122 123 enum Source { 124 UNKNOWN = 0; 125 126 QS_TILE = 1; 127 SETTINGS = 2; 128 DIALOG = 3; 129 SHELL = 4; 130 OTHER = 5; 131 SAFETY_CENTER = 6; 132 } 133 134 // Source for which sensor privacy was toggled. 135 optional Source source = 1; 136 137}