summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Michael Sun <michaelfsun@google.com> 2020-11-24 06:50:51 +0000
committer Michael Sun <michaelfsun@google.com> 2020-11-24 06:50:51 +0000
commit2c7efc70d710040bf21b81abe18f663d823eb966 (patch)
treec20da7a8ce3d1077dc499b50cbbc1a60fafb9232
parente9226f999fcb4ba816a6c0d7bde01b8c6cb560d1 (diff)
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
-rw-r--r--services/core/jni/com_android_server_am_BatteryStatsService.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/services/core/jni/com_android_server_am_BatteryStatsService.cpp b/services/core/jni/com_android_server_am_BatteryStatsService.cpp
index 0e68f5b89a91..00342866aa30 100644
--- a/services/core/jni/com_android_server_am_BatteryStatsService.cpp
+++ b/services/core/jni/com_android_server_am_BatteryStatsService.cpp
@@ -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;
}
}