Merge "storaged: Fix double ownership for HealthInfoCallback."

This commit is contained in:
Treehugger Robot 2022-03-24 17:03:28 +00:00 committed by Gerrit Code Review
commit 3d0143dc62

View file

@ -153,7 +153,7 @@ void storaged_t::init_health_service() {
mUidm.init(is_charger_on(status));
// register listener after init uid_monitor
aidl_health_callback = std::make_shared<HealthInfoCallback>(&mUidm);
aidl_health_callback = ndk::SharedRefBase::make<HealthInfoCallback>(&mUidm);
ret = health->registerCallback(aidl_health_callback);
if (!ret.isOk()) {
LOG(WARNING) << "health: failed to register callback: " << ret.getDescription();