mirror of
https://github.com/chararomandroid/android_device_samsung_a20
synced 2026-08-22 12:05:32 -04:00
universal7885: run clang-format based on system-clang-format
* On every *.cpp *.h files Signed-off-by: roynatech2544 <whiteshell2544@naver.com>
This commit is contained in:
parent
6bc1c25485
commit
098179eabb
47 changed files with 1545 additions and 1709 deletions
|
|
@ -36,7 +36,7 @@
|
|||
static const std::vector<std::string> fb_idle_patch = {"/sys/class/drm/card0/device/idle_state",
|
||||
"/sys/class/graphics/fb0/idle_state"};
|
||||
|
||||
InteractionHandler::InteractionHandler(std::shared_ptr<HintManager> const &hint_manager)
|
||||
InteractionHandler::InteractionHandler(std::shared_ptr<HintManager> const& hint_manager)
|
||||
: mState(INTERACTION_STATE_UNINITIALIZED),
|
||||
mWaitMs(100),
|
||||
mMinDurationMs(1400),
|
||||
|
|
@ -50,10 +50,9 @@ InteractionHandler::~InteractionHandler() {
|
|||
|
||||
static int fb_idle_open(void) {
|
||||
int fd;
|
||||
for (auto &path : fb_idle_patch) {
|
||||
for (auto& path : fb_idle_patch) {
|
||||
fd = open(path.c_str(), O_RDONLY);
|
||||
if (fd >= 0)
|
||||
return fd;
|
||||
if (fd >= 0) return fd;
|
||||
}
|
||||
ALOGE("Unable to open fb idle state path (%d)", errno);
|
||||
return -1;
|
||||
|
|
@ -62,8 +61,7 @@ static int fb_idle_open(void) {
|
|||
bool InteractionHandler::Init() {
|
||||
std::lock_guard<std::mutex> lk(mLock);
|
||||
|
||||
if (mState != INTERACTION_STATE_UNINITIALIZED)
|
||||
return true;
|
||||
if (mState != INTERACTION_STATE_UNINITIALIZED) return true;
|
||||
|
||||
mIdleFd = fb_idle_open();
|
||||
|
||||
|
|
@ -84,8 +82,7 @@ bool InteractionHandler::Init() {
|
|||
|
||||
void InteractionHandler::Exit() {
|
||||
std::unique_lock<std::mutex> lk(mLock);
|
||||
if (mState == INTERACTION_STATE_UNINITIALIZED)
|
||||
return;
|
||||
if (mState == INTERACTION_STATE_UNINITIALIZED) return;
|
||||
|
||||
AbortWaitLocked();
|
||||
mState = INTERACTION_STATE_UNINITIALIZED;
|
||||
|
|
@ -186,8 +183,7 @@ void InteractionHandler::Release() {
|
|||
void InteractionHandler::AbortWaitLocked() {
|
||||
uint64_t val = 1;
|
||||
ssize_t ret = write(mEventFd, &val, sizeof(val));
|
||||
if (ret != sizeof(val))
|
||||
ALOGW("Unable to write to event fd (%zd)", ret);
|
||||
if (ret != sizeof(val)) ALOGW("Unable to write to event fd (%zd)", ret);
|
||||
}
|
||||
|
||||
void InteractionHandler::WaitForIdle(int32_t wait_ms, int32_t timeout_ms) {
|
||||
|
|
@ -253,8 +249,7 @@ void InteractionHandler::Routine() {
|
|||
while (true) {
|
||||
lk.lock();
|
||||
mCond.wait(lk, [&] { return mState != INTERACTION_STATE_IDLE; });
|
||||
if (mState == INTERACTION_STATE_UNINITIALIZED)
|
||||
return;
|
||||
if (mState == INTERACTION_STATE_UNINITIALIZED) return;
|
||||
mState = INTERACTION_STATE_WAITING;
|
||||
lk.unlock();
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue