From ba27df4d0fe02be6b0f60bfe0a1cf175e4e5aa91 Mon Sep 17 00:00:00 2001 From: Jin Qian Date: Tue, 28 Mar 2017 15:21:20 -0700 Subject: [PATCH] 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 --- storaged/storaged.cpp | 3 +++ 1 file changed, 3 insertions(+) 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) { } void storaged_t::init_battery_service() { + if (!mConfig.proc_uid_io_available) + return; + sp battery_properties = get_battery_properties_service(); if (battery_properties == NULL) { LOG_TO(SYSTEM, WARNING) << "failed to find batteryproperties service";