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

Commit 2c7efc70 authored by Michael Sun's avatar Michael Sun
Browse files

BatteryStats: explicitly copy the wakeup reasons

As the wakeup reasons received from binder callback are in const
reference, std::move the parameter will result in a copy operation in
order to fulfill the const restriction. Update to reflect this
explicitly.

Test: adb shell dumpsys batterystats --history
Bug: 173165219
Change-Id: I6ab995cc11600b37123651bacc2015a3bf1a4bf6
parent e9226f99
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -124,7 +124,7 @@ public:
        {
            std::unique_lock<std::mutex> reasonsLock(mReasonsMutex, std::defer_lock);
            if (reasonsLock.try_lock() && mWakeupReasons.empty()) {
                mWakeupReasons = std::move(wakeupReasons);
                mWakeupReasons = wakeupReasons;
                reasonsCaptured = true;
            }
        }