summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJin Qian2017-03-28 17:21:20 -0500
committerJin Qian2017-04-03 11:48:44 -0500
commitba27df4d0fe02be6b0f60bfe0a1cf175e4e5aa91 (patch)
treea4e3a6936607aeebf4e8f4f4edc58060095be5e8
parent808f7036096e1f7b4889fe8689702685caa6ccb7 (diff)
downloadplatform-system-core-ba27df4d0fe02be6b0f60bfe0a1cf175e4e5aa91.tar.gz
platform-system-core-ba27df4d0fe02be6b0f60bfe0a1cf175e4e5aa91.tar.xz
platform-system-core-ba27df4d0fe02be6b0f60bfe0a1cf175e4e5aa91.zip
storaged: skip batteryproperties listener if uid_io not available
uid_monitor is the only user of batteryproperties, no need to register a callback if uid_io not enabled. Test: run storaged without uid_io, plug/unplug usb cable Merged-In: If890a93fec155b67c450341c54b44bb18d3aae3d Change-Id: If890a93fec155b67c450341c54b44bb18d3aae3d
-rw-r--r--storaged/storaged.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/storaged/storaged.cpp b/storaged/storaged.cpp
index 72bb6e23d..1770922ef 100644
--- a/storaged/storaged.cpp
+++ b/storaged/storaged.cpp
@@ -170,6 +170,9 @@ void storaged_t::batteryPropertiesChanged(struct BatteryProperties props) {
170} 170}
171 171
172void storaged_t::init_battery_service() { 172void storaged_t::init_battery_service() {
173 if (!mConfig.proc_uid_io_available)
174 return;
175
173 sp<IBatteryPropertiesRegistrar> battery_properties = get_battery_properties_service(); 176 sp<IBatteryPropertiesRegistrar> battery_properties = get_battery_properties_service();
174 if (battery_properties == NULL) { 177 if (battery_properties == NULL) {
175 LOG_TO(SYSTEM, WARNING) << "failed to find batteryproperties service"; 178 LOG_TO(SYSTEM, WARNING) << "failed to find batteryproperties service";