aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Erat <derat@chromium.org>2017-03-21 02:45:35 +0000
committerandroid-build-merger <android-build-merger@google.com>2017-03-21 02:45:35 +0000
commit288ea7654a83ebb573ea04755c06899c569fe0d9 (patch)
treef02417e799d537a3aa91855600bde2bf41a9b43b
parent65c1a2282cad9bff22b4ba231ad315af8a98c536 (diff)
parentdc45f4d8880165b4cfc60a71502eec47c289de1e (diff)
downloadsystem_api-288ea7654a83ebb573ea04755c06899c569fe0d9.tar.gz
system_api: Add powerd GetSwitchStates method and proto. am: 47a097813e
am: dc45f4d888 Change-Id: Id7d9a3adcd2f91632920be9e9b36603845b7e08c
-rw-r--r--dbus/power_manager/dbus-constants.h1
-rw-r--r--dbus/power_manager/switch_states.proto28
-rw-r--r--system_api.gyp6
3 files changed, 33 insertions, 2 deletions
diff --git a/dbus/power_manager/dbus-constants.h b/dbus/power_manager/dbus-constants.h
index 0a3dfac..8fa97b3 100644
--- a/dbus/power_manager/dbus-constants.h
+++ b/dbus/power_manager/dbus-constants.h
@@ -21,6 +21,7 @@ const char kRequestRestartMethod[] = "RequestRestart";
const char kRequestShutdownMethod[] = "RequestShutdown";
const char kRequestSuspendMethod[] = "RequestSuspend";
const char kGetPowerSupplyPropertiesMethod[] = "GetPowerSupplyProperties";
+const char kGetSwitchStatesMethod[] = "GetSwitchStates";
const char kHandleUserActivityMethod[] = "HandleUserActivity";
const char kHandleVideoActivityMethod[] = "HandleVideoActivity";
const char kSetIsProjectingMethod[] = "SetIsProjecting";
diff --git a/dbus/power_manager/switch_states.proto b/dbus/power_manager/switch_states.proto
new file mode 100644
index 0000000..e1a827c
--- /dev/null
+++ b/dbus/power_manager/switch_states.proto
@@ -0,0 +1,28 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+syntax = "proto2";
+
+option optimize_for = LITE_RUNTIME;
+
+package power_manager;
+
+// Included in responses to GetSwitchStates method calls to powerd.
+message SwitchStates {
+ // Next ID to use: 3
+
+ enum LidState {
+ OPEN = 0;
+ CLOSED = 1;
+ NOT_PRESENT = 2;
+ }
+ optional LidState lid_state = 1;
+
+ enum TabletMode {
+ ON = 0;
+ OFF = 1;
+ UNSUPPORTED = 2;
+ }
+ optional TabletMode tablet_mode = 2;
+}
diff --git a/system_api.gyp b/system_api.gyp
index 82423f9..b05b95e 100644
--- a/system_api.gyp
+++ b/system_api.gyp
@@ -35,11 +35,12 @@
'proto_out_dir': 'include/power_manager/proto_bindings',
},
'sources': [
- '<(proto_in_dir)/suspend.proto',
'<(proto_in_dir)/input_event.proto',
'<(proto_in_dir)/peripheral_battery_status.proto',
'<(proto_in_dir)/policy.proto',
'<(proto_in_dir)/power_supply_properties.proto',
+ '<(proto_in_dir)/suspend.proto',
+ '<(proto_in_dir)/switch_states.proto',
],
'includes': ['../../platform2/common-mk/protoc.gypi'],
},
@@ -51,11 +52,12 @@
'system_api-power_manager-protos-gen',
],
'sources': [
- '<(SHARED_INTERMEDIATE_DIR)/include/power_manager/proto_bindings/suspend.pb.cc',
'<(SHARED_INTERMEDIATE_DIR)/include/power_manager/proto_bindings/input_event.pb.cc',
'<(SHARED_INTERMEDIATE_DIR)/include/power_manager/proto_bindings/peripheral_battery_status.pb.cc',
'<(SHARED_INTERMEDIATE_DIR)/include/power_manager/proto_bindings/policy.pb.cc',
'<(SHARED_INTERMEDIATE_DIR)/include/power_manager/proto_bindings/power_supply_properties.pb.cc',
+ '<(SHARED_INTERMEDIATE_DIR)/include/power_manager/proto_bindings/suspend.pb.cc',
+ '<(SHARED_INTERMEDIATE_DIR)/include/power_manager/proto_bindings/switch_states.pb.cc',
]
},
{