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 optional int32 rule_modified_fields = 8; 42 optional int32 policy_modified_fields = 9; 43 optional int32 device_effects_modified_fields = 10; 44 optional android.stats.dnd.ActiveRuleType rule_type = 11; 45} 46 47/** 48 * Message that represents a Do Not Disturb policy, an optional detail proto for DNDModeProto 49 * and DNDStateChanged. 50 */ 51message DNDPolicyProto { 52 optional android.stats.dnd.State calls = 1; 53 optional android.stats.dnd.State repeat_callers = 2; 54 optional android.stats.dnd.State messages = 3; 55 optional android.stats.dnd.State conversations = 4; 56 optional android.stats.dnd.State reminders = 5; 57 optional android.stats.dnd.State events = 6; 58 optional android.stats.dnd.State alarms = 7; 59 optional android.stats.dnd.State media = 8; 60 optional android.stats.dnd.State system = 9; 61 optional android.stats.dnd.State fullscreen = 10; 62 optional android.stats.dnd.State lights = 11; 63 optional android.stats.dnd.State peek = 12; 64 optional android.stats.dnd.State status_bar = 13; 65 optional android.stats.dnd.State badge = 14; 66 optional android.stats.dnd.State ambient = 15; 67 optional android.stats.dnd.State notification_list = 16; 68 69 optional android.stats.dnd.PeopleType allow_calls_from = 17; 70 optional android.stats.dnd.PeopleType allow_messages_from = 18; 71 72 optional android.stats.dnd.ConversationType allow_conversations_from = 19; 73 74 optional android.stats.dnd.ChannelPolicy allow_channels = 20; 75} 76