summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTodd Poynor2013-09-10 14:40:00 -0500
committerTodd Poynor2013-09-17 16:41:07 -0500
commitc7464c9150eb63ad277cc5b5f704f4fd5e6678c5 (patch)
tree06aff1135a7ef66a7a3b64f1c478fe010f696ac6 /healthd/BatteryMonitor.cpp
parent98c23d82f03fede6f434ad8800a7b3bb9175e348 (diff)
downloadplatform-system-core-c7464c9150eb63ad277cc5b5f704f4fd5e6678c5.tar.gz
platform-system-core-c7464c9150eb63ad277cc5b5f704f4fd5e6678c5.tar.xz
platform-system-core-c7464c9150eb63ad277cc5b5f704f4fd5e6678c5.zip
healthd: move Android communication code to separate source
* add ops for different "modes" of healthd operation: android vs. recovery * recovery mode selected by runstring options -r * binder/Android communication moved to android mode * recovery mode ops avoiding binder service registration * "no service manager" flag removed; now handled by android vs. other modes Change-Id: I3d8c89bf96a18a6a00cc85306f9a07d3f408f2a0
Diffstat (limited to 'healthd/BatteryMonitor.cpp')
-rw-r--r--healthd/BatteryMonitor.cpp12
1 files changed, 2 insertions, 10 deletions
diff --git a/healthd/BatteryMonitor.cpp b/healthd/BatteryMonitor.cpp
index 424d180cd..f641077f3 100644
--- a/healthd/BatteryMonitor.cpp
+++ b/healthd/BatteryMonitor.cpp
@@ -18,7 +18,6 @@
18 18
19#include "healthd.h" 19#include "healthd.h"
20#include "BatteryMonitor.h" 20#include "BatteryMonitor.h"
21#include "BatteryPropertiesRegistrar.h"
22 21
23#include <dirent.h> 22#include <dirent.h>
24#include <errno.h> 23#include <errno.h>
@@ -266,9 +265,7 @@ bool BatteryMonitor::update(void) {
266 props.chargerWirelessOnline ? "w" : ""); 265 props.chargerWirelessOnline ? "w" : "");
267 } 266 }
268 267
269 if (mBatteryPropertiesRegistrar != NULL) 268 healthd_mode_ops->battery_update(&props);
270 mBatteryPropertiesRegistrar->notifyListeners(props);
271
272 return props.chargerAcOnline | props.chargerUsbOnline | 269 return props.chargerAcOnline | props.chargerUsbOnline |
273 props.chargerWirelessOnline; 270 props.chargerWirelessOnline;
274} 271}
@@ -317,7 +314,7 @@ status_t BatteryMonitor::getProperty(int id, struct BatteryProperty *val) {
317 return ret; 314 return ret;
318} 315}
319 316
320void BatteryMonitor::init(struct healthd_config *hc, bool nosvcmgr) { 317void BatteryMonitor::init(struct healthd_config *hc) {
321 String8 path; 318 String8 path;
322 319
323 mHealthdConfig = hc; 320 mHealthdConfig = hc;
@@ -467,11 +464,6 @@ void BatteryMonitor::init(struct healthd_config *hc, bool nosvcmgr) {
467 KLOG_WARNING(LOG_TAG, "BatteryTemperaturePath not found\n"); 464 KLOG_WARNING(LOG_TAG, "BatteryTemperaturePath not found\n");
468 if (mHealthdConfig->batteryTechnologyPath.isEmpty()) 465 if (mHealthdConfig->batteryTechnologyPath.isEmpty())
469 KLOG_WARNING(LOG_TAG, "BatteryTechnologyPath not found\n"); 466 KLOG_WARNING(LOG_TAG, "BatteryTechnologyPath not found\n");
470
471 if (nosvcmgr == false) {
472 mBatteryPropertiesRegistrar = new BatteryPropertiesRegistrar();
473 mBatteryPropertiesRegistrar->publish();
474 }
475} 467}
476 468
477}; // namespace android 469}; // namespace android