summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Erat2015-09-30 15:49:15 -0500
committerDaniel Erat2015-09-30 15:49:15 -0500
commit3f50a39b1ede67eb5846f38a486780efd35ebc30 (patch)
tree0da89c86b634a4605529a5ac58b4b6c28153717d /services/powermanager/IPowerManager.cpp
parent28b1d678a4721e9f02b7b9498492fb3d623f21be (diff)
downloadframeworks-native-3f50a39b1ede67eb5846f38a486780efd35ebc30.tar.gz
frameworks-native-3f50a39b1ede67eb5846f38a486780efd35ebc30.tar.xz
frameworks-native-3f50a39b1ede67eb5846f38a486780efd35ebc30.zip
Add more methods to IPowerManager.
Add the full list of transaction IDs from IPowerManager.aidl to IPowerManager.h and make BpPowerManager support calling goToSleep, reboot, shutdown, and crash. These are currently needed by or likely to be needed by Brillo. Bug: 22122485 Change-Id: I19abd3587c9d53b28ec150210e07f97517ee4ff4
Diffstat (limited to 'services/powermanager/IPowerManager.cpp')
-rw-r--r--services/powermanager/IPowerManager.cpp38
1 files changed, 38 insertions, 0 deletions
diff --git a/services/powermanager/IPowerManager.cpp b/services/powermanager/IPowerManager.cpp
index 0a4244ffa..bff871916 100644
--- a/services/powermanager/IPowerManager.cpp
+++ b/services/powermanager/IPowerManager.cpp
@@ -95,6 +95,44 @@ public:
95 // This FLAG_ONEWAY is in the .aidl, so there is no way to disable it 95 // This FLAG_ONEWAY is in the .aidl, so there is no way to disable it
96 return remote()->transact(POWER_HINT, data, &reply, IBinder::FLAG_ONEWAY); 96 return remote()->transact(POWER_HINT, data, &reply, IBinder::FLAG_ONEWAY);
97 } 97 }
98
99 virtual status_t goToSleep(int64_t event_time_ms, int reason, int flags)
100 {
101 Parcel data, reply;
102 data.writeInterfaceToken(IPowerManager::getInterfaceDescriptor());
103 data.writeInt64(event_time_ms);
104 data.writeInt32(reason);
105 data.writeInt32(flags);
106 return remote()->transact(GO_TO_SLEEP, data, &reply, 0);
107 }
108
109 virtual status_t reboot(bool confirm, const String16& reason, bool wait)
110 {
111 Parcel data, reply;
112 data.writeInterfaceToken(IPowerManager::getInterfaceDescriptor());
113 data.writeInt32(confirm);
114 data.writeString16(reason);
115 data.writeInt32(wait);
116 return remote()->transact(REBOOT, data, &reply, 0);
117 }
118
119 virtual status_t shutdown(bool confirm, const String16& reason, bool wait)
120 {
121 Parcel data, reply;
122 data.writeInterfaceToken(IPowerManager::getInterfaceDescriptor());
123 data.writeInt32(confirm);
124 data.writeString16(reason);
125 data.writeInt32(wait);
126 return remote()->transact(SHUTDOWN, data, &reply, 0);
127 }
128
129 virtual status_t crash(const String16& message)
130 {
131 Parcel data, reply;
132 data.writeInterfaceToken(IPowerManager::getInterfaceDescriptor());
133 data.writeString16(message);
134 return remote()->transact(CRASH, data, &reply, 0);
135 }
98}; 136};
99 137
100IMPLEMENT_META_INTERFACE(PowerManager, "android.os.IPowerManager"); 138IMPLEMENT_META_INTERFACE(PowerManager, "android.os.IPowerManager");