• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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/atoms.proto";
22import "frameworks/proto_logging/stats/atoms/dnd/dnd_atoms.proto";
23import "frameworks/proto_logging/stats/atom_field_options.proto";
24import "frameworks/proto_logging/stats/enums/dnd/dnd_enums.proto";
25
26option java_package = "com.android.os.dnd";
27option java_multiple_files = true;
28
29extend Atom {
30  optional DNDStateChanged dnd_state_changed = 657 [(module) = "framework"];
31}
32
33/**
34 * Logs when the state of Do Not Disturb on the device has changed.
35 * This may be due to DND turning on or off or due to a policy change.
36 *
37 * Logged from:
38 *   frameworks/base/services/core/java/com/android/server/notification/ZenMode*.java
39 */
40message DNDStateChanged {
41  // event_id (as for UiEventReported).
42  optional int32 event_id = 1;
43
44  // Mode after this event.
45  optional android.stats.dnd.ZenMode new_mode = 2;
46
47  // Mode before this event. May be the same as the mode after the event if
48  // only the policy has changed.
49  optional android.stats.dnd.ZenMode previous_mode = 3;
50
51  // Which type of rule is associated with this state change?
52  optional android.stats.dnd.RuleType rule_type = 4;
53
54  // Number of rules currently active once this change takes effect.
55  optional int32 num_rules_active = 5;
56
57  // Was this change triggered by a user action, or was it automatic?
58  optional bool user_action = 6;
59
60  // Package UID of the automatic rule or triggerer of manual rule, if applicable.
61  optional int32 package_uid = 7 [(is_uid) = true];
62
63  // Full policy in effect at the time of the event. Depending on what rules are active,
64  // this may be a consolidation of several sets of rules.
65  optional DNDPolicyProto current_policy = 8 [(log_mode) = MODE_BYTES];
66
67  // Whether any app notification channels are permitted to bypass DND.
68  optional bool are_channels_bypassing = 9;
69
70  // The types of rules that are currently active.
71  repeated android.stats.dnd.ActiveRuleType active_rule_types = 10;
72}
73