1/* 2 * Copyright (C) 2023 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.os.statsd.dnd; 20 21import "frameworks/proto_logging/stats/atom_field_options.proto"; 22import "frameworks/proto_logging/stats/enums/dnd/dnd_enums.proto"; 23 24option java_package = "com.android.os.dnd"; 25option java_multiple_files = true; 26 27/** 28 * Atom that represents an item in the list of Do Not Disturb rules, pulled from 29 * NotificationManagerService.java. 30 */ 31message DNDModeProto { 32 optional int32 user = 1; // Android user ID (0, 1, 10, ...) 33 optional bool enabled = 2; // true for ROOT_CONFIG if a manualRule is enabled 34 optional bool channels_bypassing = 3; // only valid for ROOT_CONFIG 35 optional android.stats.dnd.ZenMode zen_mode = 4; 36 // id is one of the system default rule IDs, or empty 37 // May also be "MANUAL_RULE" to indicate app-activation of the manual rule. 38 optional string id = 5; 39 optional int32 uid = 6 [(is_uid) = true]; // currently only SYSTEM_UID or 0 for other 40 optional DNDPolicyProto policy = 7 [(log_mode) = MODE_BYTES]; 41} 42 43/** 44 * Message that represents a Do Not Disturb policy, an optional detail proto for DNDModeProto 45 * and DNDStateChanged. 46 */ 47message DNDPolicyProto { 48 optional android.stats.dnd.State calls = 1; 49 optional android.stats.dnd.State repeat_callers = 2; 50 optional android.stats.dnd.State messages = 3; 51 optional android.stats.dnd.State conversations = 4; 52 optional android.stats.dnd.State reminders = 5; 53 optional android.stats.dnd.State events = 6; 54 optional android.stats.dnd.State alarms = 7; 55 optional android.stats.dnd.State media = 8; 56 optional android.stats.dnd.State system = 9; 57 optional android.stats.dnd.State fullscreen = 10; 58 optional android.stats.dnd.State lights = 11; 59 optional android.stats.dnd.State peek = 12; 60 optional android.stats.dnd.State status_bar = 13; 61 optional android.stats.dnd.State badge = 14; 62 optional android.stats.dnd.State ambient = 15; 63 optional android.stats.dnd.State notification_list = 16; 64 65 optional android.stats.dnd.PeopleType allow_calls_from = 17; 66 optional android.stats.dnd.PeopleType allow_messages_from = 18; 67 68 optional android.stats.dnd.ConversationType allow_conversations_from = 19; 69} 70