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

am: 18ad7b2cba

Change-Id: I592535b4c8956ea5bbb6135907d56d669a16a761
This commit is contained in:
Tri Vo 2018-10-22 16:28:29 -07:00 committed by android-build-merger
commit 18684e0815

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;
}