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.dream;
20
21import "frameworks/proto_logging/stats/atoms.proto";
22import "frameworks/proto_logging/stats/atom_field_options.proto";
23
24extend Atom {
25    optional DreamSettingChanged dream_setting_changed = 705 [(module) = "framework"];
26
27    optional DreamSettingSnapshot dream_setting_snapshot = 10192 [(module) = "framework"];
28}
29
30// Pushed atom for logging dream setting changes.
31message DreamSettingChanged {
32    // Android user id of the user that updated the setting.
33    optional int32 uid = 1 [(is_uid) = true];
34
35    // Configuration for whether dream is enabled.
36    optional bool enabled = 2;
37
38    // Configuration for what dream component to show.
39    optional string dream_component= 3;
40
41    // Configuration for when dream should begin.
42    optional WhenToDream when_to_dream = 4;
43
44    // Configuration for whether to show additional information.
45    optional bool show_additional_info = 5;
46
47    // Configuration for whether to show home controls.
48    optional bool show_home_controls = 6;
49
50    // Which type of dream setting was changed.
51    optional DreamSettingType dream_setting_type = 7;
52}
53
54// Pulled atom for taking a snapshot of dream settings.
55message DreamSettingSnapshot {
56    // Configuration for whether dream is enabled.
57    optional bool enabled = 1;
58
59    // Configuration for what dream component to show.
60    optional string dream_component = 2;
61
62    // Configuration for when dream should begin.
63    optional WhenToDream when_to_dream = 3;
64
65    // Configuration for whether to show additional information.
66    optional bool show_additional_info = 4;
67
68    // Configuration for whether to show home controls.
69    optional bool show_home_controls = 5;
70}
71
72// Configuration for when dream should begin.
73enum WhenToDream{
74    // Unspecified.
75    WHEN_TO_DREAM_UNSPECIFIED = 0;
76
77    // Dream when device is charging.
78    WHEN_TO_DREAM_WHILE_CHARGING_ONLY = 1;
79
80    // Dream when device is docked.
81    WHEN_TO_DREAM_WHILE_DOCKED_ONLY = 2;
82
83    // Dream when device is charging or docked.
84    WHEN_TO_DREAM_EITHER_CHARGING_OR_DOCKED = 3;
85}
86
87// Type of dream setting.
88enum DreamSettingType {
89  // Unspecified.
90  DREAM_SETTING_TYPE_UNSPECIFIED = 0;
91
92  // Setting for whether dream is enabled.
93  DREAM_SETTING_TYPE_ENABLED = 1;
94
95  // Setting for what dream component to show.
96  DREAM_SETTING_TYPE_DREAM_COMPONENT = 2;
97
98  // Setting for when dream should begin.
99  DREAM_SETTING_TYPE_WHEN_TO_DREAM = 3;
100
101  // Setting for whether to show additional information.
102  DREAM_SETTING_TYPE_SHOW_ADDITIONAL_INFO = 4;
103
104  // Setting for whether to show home controls.
105  DREAM_SETTING_TYPE_SHOW_HOME_CONTROLS = 5;
106}
107