Loading storaged/include/storaged.h +5 −1 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ #include <vector> #include <batteryservice/IBatteryPropertiesListener.h> #include <batteryservice/IBatteryPropertiesRegistrar.h> #include "storaged_info.h" #include "storaged_uid_monitor.h" Loading Loading @@ -245,7 +246,8 @@ struct storaged_config { int event_time_check_usec; // check how much cputime spent in event loop }; class storaged_t : public BnBatteryPropertiesListener { class storaged_t : public BnBatteryPropertiesListener, public IBinder::DeathRecipient { private: time_t mTimer; storaged_config mConfig; Loading @@ -253,6 +255,7 @@ private: disk_stats_monitor mDsm; uid_monitor mUidm; time_t mStarttime; sp<IBatteryPropertiesRegistrar> battery_properties; public: storaged_t(void); ~storaged_t() {} Loading Loading @@ -281,6 +284,7 @@ public: void init_battery_service(); virtual void batteryPropertiesChanged(struct BatteryProperties props); void binderDied(const wp<IBinder>& who); }; // Eventlog tag Loading storaged/storaged.cpp +12 −1 Original line number Diff line number Diff line Loading @@ -173,7 +173,7 @@ void storaged_t::init_battery_service() { if (!mConfig.proc_uid_io_available) return; sp<IBatteryPropertiesRegistrar> battery_properties = get_battery_properties_service(); battery_properties = get_battery_properties_service(); if (battery_properties == NULL) { LOG_TO(SYSTEM, WARNING) << "failed to find batteryproperties service"; return; Loading @@ -185,6 +185,17 @@ void storaged_t::init_battery_service() { // register listener after init uid_monitor battery_properties->registerListener(this); IInterface::asBinder(battery_properties)->linkToDeath(this); } void storaged_t::binderDied(const wp<IBinder>& who) { if (battery_properties != NULL && IInterface::asBinder(battery_properties) == who) { LOG_TO(SYSTEM, ERROR) << "batteryproperties service died, exiting"; exit(1); } else { LOG_TO(SYSTEM, ERROR) << "unknown service died"; } } /* storaged_t */ Loading Loading
storaged/include/storaged.h +5 −1 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ #include <vector> #include <batteryservice/IBatteryPropertiesListener.h> #include <batteryservice/IBatteryPropertiesRegistrar.h> #include "storaged_info.h" #include "storaged_uid_monitor.h" Loading Loading @@ -245,7 +246,8 @@ struct storaged_config { int event_time_check_usec; // check how much cputime spent in event loop }; class storaged_t : public BnBatteryPropertiesListener { class storaged_t : public BnBatteryPropertiesListener, public IBinder::DeathRecipient { private: time_t mTimer; storaged_config mConfig; Loading @@ -253,6 +255,7 @@ private: disk_stats_monitor mDsm; uid_monitor mUidm; time_t mStarttime; sp<IBatteryPropertiesRegistrar> battery_properties; public: storaged_t(void); ~storaged_t() {} Loading Loading @@ -281,6 +284,7 @@ public: void init_battery_service(); virtual void batteryPropertiesChanged(struct BatteryProperties props); void binderDied(const wp<IBinder>& who); }; // Eventlog tag Loading
storaged/storaged.cpp +12 −1 Original line number Diff line number Diff line Loading @@ -173,7 +173,7 @@ void storaged_t::init_battery_service() { if (!mConfig.proc_uid_io_available) return; sp<IBatteryPropertiesRegistrar> battery_properties = get_battery_properties_service(); battery_properties = get_battery_properties_service(); if (battery_properties == NULL) { LOG_TO(SYSTEM, WARNING) << "failed to find batteryproperties service"; return; Loading @@ -185,6 +185,17 @@ void storaged_t::init_battery_service() { // register listener after init uid_monitor battery_properties->registerListener(this); IInterface::asBinder(battery_properties)->linkToDeath(this); } void storaged_t::binderDied(const wp<IBinder>& who) { if (battery_properties != NULL && IInterface::asBinder(battery_properties) == who) { LOG_TO(SYSTEM, ERROR) << "batteryproperties service died, exiting"; exit(1); } else { LOG_TO(SYSTEM, ERROR) << "unknown service died"; } } /* storaged_t */ Loading