From fb067279b9b1d836434d99ae80272ddfc94f108a Mon Sep 17 00:00:00 2001 From: Wei Wang Date: Thu, 22 Oct 2020 16:21:39 -0700 Subject: [PATCH] Power: advertise power headers are deprecated Test: Build Bug: 169065024 Signed-off-by: Wei Wang Change-Id: I3cef3aff4bb2394571a3de13e535283722c308ed --- aidl/power-libperfmgr/InteractionHandler.cpp | 26 ++++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/aidl/power-libperfmgr/InteractionHandler.cpp b/aidl/power-libperfmgr/InteractionHandler.cpp index f73e6da8..256c602c 100644 --- a/aidl/power-libperfmgr/InteractionHandler.cpp +++ b/aidl/power-libperfmgr/InteractionHandler.cpp @@ -66,6 +66,17 @@ static size_t CalcTimespecDiffMs(struct timespec start, struct timespec end) { return diff_in_ms; } +static int FbIdleOpen(void) { + int fd; + for (const auto &path : kDispIdlePath) { + fd = open(path, O_RDONLY); + if (fd >= 0) + return fd; + } + ALOGE("Unable to open fb idle state path (%d)", errno); + return -1; +} + } // namespace InteractionHandler::InteractionHandler(std::shared_ptr const &hint_manager) @@ -77,24 +88,13 @@ InteractionHandler::~InteractionHandler() { Exit(); } -static int fb_idle_open(void) { - int fd; - for (const auto &path : kDispIdlePath) { - fd = open(path, O_RDONLY); - if (fd >= 0) - return fd; - } - ALOGE("Unable to open fb idle state path (%d)", errno); - return -1; -} - bool InteractionHandler::Init() { std::lock_guard lk(mLock); if (mState != INTERACTION_STATE_UNINITIALIZED) return true; - int fd = fb_idle_open(); + int fd = FbIdleOpen(); if (fd < 0) return false; mIdleFd = fd; @@ -261,7 +261,7 @@ void InteractionHandler::WaitForIdle(int32_t wait_ms, int32_t timeout_ms) { } void InteractionHandler::Routine() { - pthread_setname_np(pthread_self(), "DisplayIdleMonitor"); + pthread_setname_np(pthread_self(), "DispIdle"); std::unique_lock lk(mLock, std::defer_lock); while (true) {