Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f6a78079 authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Merge cherrypicks of [2467803, 2467786, 2467717, 2467598, 2467823, 2467734,...

Merge cherrypicks of [2467803, 2467786, 2467717, 2467598, 2467823, 2467734, 2467671, 2467718, 2467599, 2467753, 2467672, 2467600, 2467735, 2467841, 2467638, 2467824, 2467736, 2467754, 2467737, 2467674] into oc-release

Change-Id: Iaeea349ef72436af0b5da51537514d4fc64cbce0
parents 509678ce 05807fa1
Loading
Loading
Loading
Loading
+13 −3
Original line number Diff line number Diff line
@@ -36,9 +36,19 @@ void BatteryPropertiesRegistrar::publish(
}

void BatteryPropertiesRegistrar::notifyListeners(const struct BatteryProperties& props) {
    Vector<sp<IBatteryPropertiesListener> > listenersCopy;

    // Binder currently may service an incoming oneway transaction whenever an
    // outbound oneway call is made (if there is already a pending incoming
    // oneway call waiting).  This is considered a bug and may change in the
    // future.  For now, avoid recursive mutex lock while making outbound
    // calls by making a local copy of the current list of listeners.
    {
        Mutex::Autolock _l(mRegistrationLock);
    for (size_t i = 0; i < mListeners.size(); i++) {
        mListeners[i]->batteryPropertiesChanged(props);
        listenersCopy = mListeners;
    }
    for (size_t i = 0; i < listenersCopy.size(); i++) {
        listenersCopy[i]->batteryPropertiesChanged(props);
    }
}