Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f557dcf1 authored by Prabir Pradhan's avatar Prabir Pradhan
Browse files

Negate condition to reduce nesting in InputDispatcher

There was an if condition surrounding the entire method in
InputDispatcher::afterKeyEventLockedInterruptible. This change negates
the if to reduce the nesting level in the method.

Bug: None
Test: None
Change-Id: Ibf2fa99f695a902cd9f0cc7b1991f4750189a0ba
parent d85333dd
Loading
Loading
Loading
Loading
+132 −130
Original line number Diff line number Diff line
@@ -4024,7 +4024,10 @@ void InputDispatcher::doDispatchCycleFinishedLockedInterruptible(

bool InputDispatcher::afterKeyEventLockedInterruptible(const sp<Connection>& connection,
        DispatchEntry* dispatchEntry, KeyEntry* keyEntry, bool handled) {
    if (!(keyEntry->flags & AKEY_EVENT_FLAG_FALLBACK)) {
    if (keyEntry->flags & AKEY_EVENT_FLAG_FALLBACK) {
        return false;
    }

    // Get the fallback key state.
    // Clear it out after dispatching the UP.
    int32_t originalKeyCode = keyEntry->keyCode;
@@ -4191,7 +4194,6 @@ bool InputDispatcher::afterKeyEventLockedInterruptible(const sp<Connection>& con
#endif
        }
    }
    }
    return false;
}