6507edfa4093dc25960c984ed2be8c6e4e316f2a
[platform/framework/web/crosswalk.git] / src / third_party / cros_system_api / dbus / power_manager / policy.proto
1 // Copyright (c) 2013 The Chromium OS Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 syntax = "proto2";
6
7 option optimize_for = LITE_RUNTIME;
8
9 package power_manager;
10
11 // Power management policy sent from Chrome to powerd.
12 //
13 // New settings take effect immediately.  For example, if |idle_ms| is
14 // currently set to 15 minutes, the user has been inactive for 12 minutes,
15 // and a message setting |idle_ms| to 10 minutes is received,
16 // |idle_action| will be performed immediately.  If |lid_closed_action| is
17 // DO_NOTHING, the lid is closed, and |lid_closed_action| is then set to
18 // SHUT_DOWN, the system will shut down immediately.
19 //
20 // In the case of an unset field, powerd will restore a default value (as
21 // opposed to continuing to use a value set by a previous message).  An
22 // empty message will restore all settings to their defaults.
23 message PowerManagementPolicy {
24   enum Action {
25     // Suspends the system.  Chrome may lock the screen first depending on
26     // its "Require password to wake from sleep" setting and the type of
27     // user that is logged in.
28     SUSPEND = 0;
29
30     // Ends the current user's session.  Does nothing at the login screen.
31     STOP_SESSION = 1;
32
33     // Shuts the system down.
34     SHUT_DOWN = 2;
35
36     // Does nothing.
37     DO_NOTHING = 3;
38
39     // Next value to use: 4
40   }
41
42   message Delays {
43     // Delay after which |idle_action| is performed, in milliseconds.  The
44     // inactivity timeout is reset in response to things like user activity
45     // (including the lid being opened, the power source changing, an
46     // external display being connected, etc.), resuming from suspend, or
47     // the session state changing.
48     optional int64 idle_ms = 1;
49
50     // Delay after which the screen will be turned off, in milliseconds.  0
51     // disables turning the screen off.  Capped to be less than or equal to
52     // |idle_ms|.  The same events that cause the inactivity timeout to be
53     // reset cause the screen to be turned back on.
54     optional int64 screen_off_ms = 2;
55
56     // Delay after which the screen will be dimmed, in milliseconds.  0
57     // disables dimming.  Capped to be less than or equal to
58     // |screen_off_ms| if |screen_off_ms| is set or less than or equal to
59     // |idle_ms| otherwise.  The same events that cause the inactivity
60     // timeout to be reset cause the screen to be undimmed.
61     optional int64 screen_dim_ms = 3;
62
63     // Delay after which the screen will be locked, in milliseconds.  0
64     // disables locking.  Capped to be less than |idle_ms|.  Note that
65     // lock-on-suspend is implemented within Chrome; this delay is provided
66     // for cases where the screen must be locked a significant amount of
67     // time before the device is suspended.
68     optional int64 screen_lock_ms = 4;
69
70     // Delay after which an IdleActionImminent signal will be emitted, in
71     // milliseconds.  If the inactivity timeout is then reset before the
72     // idle action is performed, an IdleActionDeferred signal will be
73     // emitted.  0 disables the signal.  Capped to be less than or equal to
74     // |idle_ms|.
75     optional int64 idle_warning_ms = 5;
76
77     // Next ID to use: 6
78   }
79
80   // Action to perform when |idle_ms| (see Delays) is reached without any
81   // user activity while the system is on AC power.
82   optional Action ac_idle_action = 1;
83
84   // Idle action when the system is on battery power.
85   optional Action battery_idle_action = 11;
86
87   // Action to perform when the lid is closed.
88   optional Action lid_closed_action = 2;
89
90   // Delays used while the system is on AC power.
91   optional Delays ac_delays = 3;
92
93   // Delays used while the system is on battery power.
94   optional Delays battery_delays = 4;
95
96   // Should audio activity be honored?  If true, audio activity will
97   // prevent |idle_action| from being performed, although the screen
98   // dimming, off, and lock delays will still be in effect.  Once the audio
99   // has stopped, |idle_action| will be performed if no user or audio
100   // activity is observed for |idle_ms|.
101   optional bool use_audio_activity = 5;
102
103   // Should video activity be honored?  If true, video activity will
104   // prevent |idle_action| from being performed and the screen from being
105   // automatically dimmed, turned off, or locked.  All these timeouts will
106   // be reset once the video has stopped.
107   optional bool use_video_activity = 6;
108
109   // Backlight brightness in the range [0.0, 100.0] to use when on AC or battery
110   // power. When a message containing these fields is received, the backlight is
111   // set to the requested brightness. The updated brightness persists until the
112   // user manually changes it or a new policy containing the currently-relevant
113   // field is received.
114   optional double ac_brightness_percent = 13;
115   optional double battery_brightness_percent = 14;
116
117   // Factor by which |screen_dim_ms| will be scaled while the device is in
118   // presentation mode.  Other delays' distances from |screen_dim_ms| are
119   // preserved after scaling.  A value of 1.0 (or less) leaves delays
120   // unchanged. If the conditions used for both this field and
121   // |user_activity_screen_dim_delay_factor| are true, this field takes
122   // precedence.
123   optional double presentation_screen_dim_delay_factor = 10;
124
125   // Factor by which |screen_dim_ms| will be scaled if user activity is
126   // observed while the screen is dimmed or soon after it is turned off.
127   // Other delays' distances from |screen_dim_ms| are preserved after
128   // scaling.  The delays will return to their original values at the end
129   // of the current user session.  A value of 1.0 (or less) or an unset
130   // |screen_dim_ms| delay leaves delays unchanged.
131   optional double user_activity_screen_dim_delay_factor = 9;
132
133   // If true, instructs the power manager not to perform any
134   // delay-triggered actions while in a user session until user activity
135   // has been observed. After activity is seen, the inactivity timeout
136   // starts. The actions are deferred again after a new session starts.
137   // Note that this has no immediate effect if activity has already been
138   // seen within an already-started session (activity that took place
139   // before the policy change is honored) and also that it has no effect at
140   // the login screen.
141   optional bool wait_for_initial_user_activity = 12;
142
143   // Human-readable description of the factors contributing to this policy.
144   // Logged by the power manager to aid in debugging.
145   optional string reason = 8;
146
147   // Next ID to use: 15
148 }