Merge "healthd: BatteryPropertiesRegistrar binder service ref count fixup" am: 36ba2fad01

am: 4a129d5a45

* commit '4a129d5a45241345934107cea3662fa72721d383':
  healthd: BatteryPropertiesRegistrar binder service ref count fixup
This commit is contained in:
Todd Poynor 2016-01-28 21:38:32 +00:00 committed by android-build-merger
commit d054a9517c
3 changed files with 5 additions and 4 deletions

View File

@ -30,8 +30,9 @@
namespace android {
void BatteryPropertiesRegistrar::publish() {
defaultServiceManager()->addService(String16("batteryproperties"), this);
void BatteryPropertiesRegistrar::publish(
const sp<BatteryPropertiesRegistrar>& service) {
defaultServiceManager()->addService(String16("batteryproperties"), service);
}
void BatteryPropertiesRegistrar::notifyListeners(struct BatteryProperties props) {

View File

@ -30,7 +30,7 @@ namespace android {
class BatteryPropertiesRegistrar : public BnBatteryPropertiesRegistrar,
public IBinder::DeathRecipient {
public:
void publish();
void publish(const sp<BatteryPropertiesRegistrar>& service);
void notifyListeners(struct BatteryProperties props);
private:

View File

@ -58,5 +58,5 @@ void healthd_mode_android_init(struct healthd_config* /*config*/) {
}
gBatteryPropertiesRegistrar = new BatteryPropertiesRegistrar();
gBatteryPropertiesRegistrar->publish();
gBatteryPropertiesRegistrar->publish(gBatteryPropertiesRegistrar);
}