Merge "libpower: pass static-duration strong pointer as const reference." am: 18ad7b2cba

am: 18684e0815

Change-Id: I726359fd0a1fd3cf9e00676460a0e267807f3a5e
This commit is contained in:
Tri Vo 2018-10-22 17:09:27 -07:00 committed by android-build-merger
commit 755c3eb98e

View file

@ -35,14 +35,14 @@ using android::system::suspend::V1_0::WakeLockType;
static std::mutex gLock;
static std::unordered_map<std::string, sp<IWakeLock>> gWakeLockMap;
static sp<ISystemSuspend> getSystemSuspendServiceOnce() {
static const sp<ISystemSuspend>& getSystemSuspendServiceOnce() {
static sp<ISystemSuspend> suspendService = ISystemSuspend::getService();
return suspendService;
}
int acquire_wake_lock(int, const char* id) {
ATRACE_CALL();
sp<ISystemSuspend> suspendService = getSystemSuspendServiceOnce();
const auto& suspendService = getSystemSuspendServiceOnce();
if (!suspendService) {
return -1;
}