Merge "healthd: BatteryPropertiesRegistrar binder service ref count fixup"
This commit is contained in:
commit
36ba2fad01
3 changed files with 5 additions and 4 deletions
|
|
@ -30,8 +30,9 @@
|
||||||
|
|
||||||
namespace android {
|
namespace android {
|
||||||
|
|
||||||
void BatteryPropertiesRegistrar::publish() {
|
void BatteryPropertiesRegistrar::publish(
|
||||||
defaultServiceManager()->addService(String16("batteryproperties"), this);
|
const sp<BatteryPropertiesRegistrar>& service) {
|
||||||
|
defaultServiceManager()->addService(String16("batteryproperties"), service);
|
||||||
}
|
}
|
||||||
|
|
||||||
void BatteryPropertiesRegistrar::notifyListeners(struct BatteryProperties props) {
|
void BatteryPropertiesRegistrar::notifyListeners(struct BatteryProperties props) {
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@ namespace android {
|
||||||
class BatteryPropertiesRegistrar : public BnBatteryPropertiesRegistrar,
|
class BatteryPropertiesRegistrar : public BnBatteryPropertiesRegistrar,
|
||||||
public IBinder::DeathRecipient {
|
public IBinder::DeathRecipient {
|
||||||
public:
|
public:
|
||||||
void publish();
|
void publish(const sp<BatteryPropertiesRegistrar>& service);
|
||||||
void notifyListeners(struct BatteryProperties props);
|
void notifyListeners(struct BatteryProperties props);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
||||||
|
|
@ -58,5 +58,5 @@ void healthd_mode_android_init(struct healthd_config* /*config*/) {
|
||||||
}
|
}
|
||||||
|
|
||||||
gBatteryPropertiesRegistrar = new BatteryPropertiesRegistrar();
|
gBatteryPropertiesRegistrar = new BatteryPropertiesRegistrar();
|
||||||
gBatteryPropertiesRegistrar->publish();
|
gBatteryPropertiesRegistrar->publish(gBatteryPropertiesRegistrar);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue