1 // Copyright 2015 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 #ifndef SYSTEM_API_DBUS_POWER_MANAGER_DBUS_CONSTANTS_H_
6 #define SYSTEM_API_DBUS_POWER_MANAGER_DBUS_CONSTANTS_H_
7 
8 namespace power_manager {
9 
10 // powerd
11 const char kPowerManagerInterface[] = "org.chromium.PowerManager";
12 const char kPowerManagerServicePath[] = "/org/chromium/PowerManager";
13 const char kPowerManagerServiceName[] = "org.chromium.PowerManager";
14 
15 // Methods exposed by powerd.
16 const char kSetScreenBrightnessMethod[] = "SetScreenBrightness";
17 const char kDecreaseScreenBrightnessMethod[] = "DecreaseScreenBrightness";
18 const char kIncreaseScreenBrightnessMethod[] = "IncreaseScreenBrightness";
19 const char kGetScreenBrightnessPercentMethod[] = "GetScreenBrightnessPercent";
20 // TODO(derat): Delete this after callers are using SetScreenBrightness.
21 const char kSetScreenBrightnessPercentMethod[] = "SetScreenBrightnessPercent";
22 const char kGetKeyboardBrightnessPercentMethod[] =
23     "GetKeyboardBrightnessPercent";
24 const char kDecreaseKeyboardBrightnessMethod[] = "DecreaseKeyboardBrightness";
25 const char kIncreaseKeyboardBrightnessMethod[] = "IncreaseKeyboardBrightness";
26 const char kRequestRestartMethod[] = "RequestRestart";
27 const char kRequestShutdownMethod[] = "RequestShutdown";
28 const char kRequestSuspendMethod[] = "RequestSuspend";
29 const char kGetPowerSupplyPropertiesMethod[] = "GetPowerSupplyProperties";
30 const char kGetSwitchStatesMethod[] = "GetSwitchStates";
31 const char kHandleUserActivityMethod[] = "HandleUserActivity";
32 const char kHandleVideoActivityMethod[] = "HandleVideoActivity";
33 const char kSetIsProjectingMethod[] = "SetIsProjecting";
34 const char kSetPolicyMethod[] = "SetPolicy";
35 const char kSetPowerSourceMethod[] = "SetPowerSource";
36 const char kSetBacklightsForcedOffMethod[] = "SetBacklightsForcedOff";
37 const char kGetBacklightsForcedOffMethod[] = "GetBacklightsForcedOff";
38 const char kRegisterSuspendDelayMethod[] = "RegisterSuspendDelay";
39 const char kUnregisterSuspendDelayMethod[] = "UnregisterSuspendDelay";
40 const char kHandleSuspendReadinessMethod[] = "HandleSuspendReadiness";
41 const char kRegisterDarkSuspendDelayMethod[] = "RegisterDarkSuspendDelay";
42 const char kUnregisterDarkSuspendDelayMethod[] = "UnregisterDarkSuspendDelay";
43 const char kHandleDarkSuspendReadinessMethod[] = "HandleDarkSuspendReadiness";
44 const char kHandlePowerButtonAcknowledgmentMethod[] =
45     "HandlePowerButtonAcknowledgment";
46 const char kIgnoreNextPowerButtonPressMethod[] = "IgnoreNextPowerButtonPress";
47 const char kRecordDarkResumeWakeReasonMethod[] = "RecordDarkResumeWakeReason";
48 const char kGetInactivityDelaysMethod[] = "GetInactivityDelays";
49 const char kDeferScreenDimMethod[] = "DeferScreenDim";
50 const char kCreateArcTimersMethod[] = "CreateArcTimers";
51 const char kStartArcTimerMethod[] = "StartArcTimer";
52 const char kDeleteArcTimersMethod[] = "DeleteArcTimers";
53 
54 // Signals emitted by powerd.
55 const char kScreenBrightnessChangedSignal[] = "ScreenBrightnessChanged";
56 const char kKeyboardBrightnessChangedSignal[] = "KeyboardBrightnessChanged";
57 const char kPeripheralBatteryStatusSignal[] = "PeripheralBatteryStatus";
58 const char kPowerSupplyPollSignal[] = "PowerSupplyPoll";
59 const char kSuspendImminentSignal[] = "SuspendImminent";
60 const char kDarkSuspendImminentSignal[] = "DarkSuspendImminent";
61 const char kSuspendDoneSignal[] = "SuspendDone";
62 const char kInputEventSignal[] = "InputEvent";
63 const char kScreenDimImminentSignal[] = "ScreenDimImminent";
64 const char kIdleActionImminentSignal[] = "IdleActionImminent";
65 const char kIdleActionDeferredSignal[] = "IdleActionDeferred";
66 const char kScreenIdleStateChangedSignal[] = "ScreenIdleStateChanged";
67 const char kInactivityDelaysChangedSignal[] = "InactivityDelaysChanged";
68 
69 // Values
70 const int kBrightnessTransitionGradual = 1;
71 const int kBrightnessTransitionInstant = 2;
72 enum UserActivityType {
73   USER_ACTIVITY_OTHER = 0,
74   USER_ACTIVITY_BRIGHTNESS_UP_KEY_PRESS = 1,
75   USER_ACTIVITY_BRIGHTNESS_DOWN_KEY_PRESS = 2,
76   USER_ACTIVITY_VOLUME_UP_KEY_PRESS = 3,
77   USER_ACTIVITY_VOLUME_DOWN_KEY_PRESS = 4,
78   USER_ACTIVITY_VOLUME_MUTE_KEY_PRESS = 5,
79 };
80 enum RequestRestartReason {
81   // An explicit user request (e.g. clicking a button).
82   REQUEST_RESTART_FOR_USER = 0,
83   // A system update.
84   REQUEST_RESTART_FOR_UPDATE = 1,
85   // Some other reason.
86   REQUEST_RESTART_OTHER = 2,
87 };
88 enum RequestShutdownReason {
89   // An explicit user request (e.g. clicking a button).
90   REQUEST_SHUTDOWN_FOR_USER = 0,
91   // Some other reason.
92   REQUEST_SHUTDOWN_OTHER = 1,
93 };
94 
95 }  // namespace power_manager
96 
97 #endif  // SYSTEM_API_DBUS_POWER_MANAGER_DBUS_CONSTANTS_H_
98