Merge "libpower: add error logs" am: 9462a528d1 am: 9f7dc4acfc

am: 6cb451db4d

Change-Id: I4b031ab3969e1bc1c81f180baec9dcd291aea687
This commit is contained in:
Tri Vo 2019-06-04 20:12:54 -07:00 committed by android-build-merger
commit 1de3066350
2 changed files with 5 additions and 2 deletions

View file

@ -44,6 +44,7 @@ int acquire_wake_lock(int, const char* id) {
ATRACE_CALL();
const auto& suspendService = getSystemSuspendServiceOnce();
if (!suspendService) {
LOG(ERROR) << "ISystemSuspend::getService() failed.";
return -1;
}

View file

@ -73,8 +73,10 @@ TEST(LibpowerTest, WakeLockStressTest) {
for (int j = 0; j < numLocks; j++) {
// We want ids to be unique.
std::string id = std::to_string(i) + "/" + std::to_string(j);
ASSERT_EQ(acquire_wake_lock(PARTIAL_WAKE_LOCK, id.c_str()), 0);
ASSERT_EQ(release_wake_lock(id.c_str()), 0);
ASSERT_EQ(acquire_wake_lock(PARTIAL_WAKE_LOCK, id.c_str()), 0)
<< "id: " << id;
ASSERT_EQ(release_wake_lock(id.c_str()), 0)
<< "id: " << id;;
}
});
}