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

Commit 29ba9b8d authored by Jeff Brown's avatar Jeff Brown Committed by Android Git Automerger
Browse files

am 4b255a23: am 03aa28fb: Merge "Improve the input policy handling a bit." into gingerbread

Merge commit '4b255a23041225103a6870e77a236f78c2816eda'

* commit '4b255a23041225103a6870e77a236f78c2816eda':
  Improve the input policy handling a bit.
parents f0164f44 a2e53608
Loading
Loading
Loading
Loading
+6 −8
Original line number Original line Diff line number Diff line
@@ -432,10 +432,9 @@ void InputDispatcher::dropInboundEventLocked(EventEntry* entry, DropReason dropR
    switch (dropReason) {
    switch (dropReason) {
    case DROP_REASON_POLICY:
    case DROP_REASON_POLICY:
#if DEBUG_INBOUND_EVENT_DETAILS
#if DEBUG_INBOUND_EVENT_DETAILS
        LOGD("Dropped event because policy requested that it not be delivered to the application.");
        LOGD("Dropped event because policy consumed it.");
#endif
#endif
        reason = "inbound event was dropped because the policy requested that it not be "
        reason = "inbound event was dropped because the policy consumed it";
                "delivered to the application";
        break;
        break;
    case DROP_REASON_DISABLED:
    case DROP_REASON_DISABLED:
        LOGI("Dropped event because input dispatch is disabled.");
        LOGI("Dropped event because input dispatch is disabled.");
@@ -625,15 +624,13 @@ bool InputDispatcher::dispatchKeyLocked(
        if (*dropReason == DROP_REASON_NOT_DROPPED) {
        if (*dropReason == DROP_REASON_NOT_DROPPED) {
            *dropReason = DROP_REASON_POLICY;
            *dropReason = DROP_REASON_POLICY;
        }
        }
        resetTargetsLocked();
        setInjectionResultLocked(entry, INPUT_EVENT_INJECTION_SUCCEEDED);
        return true;
    }
    }


    // Clean up if dropping the event.
    // Clean up if dropping the event.
    if (*dropReason != DROP_REASON_NOT_DROPPED) {
    if (*dropReason != DROP_REASON_NOT_DROPPED) {
        resetTargetsLocked();
        resetTargetsLocked();
        setInjectionResultLocked(entry, INPUT_EVENT_INJECTION_FAILED);
        setInjectionResultLocked(entry, *dropReason == DROP_REASON_POLICY
                ? INPUT_EVENT_INJECTION_SUCCEEDED : INPUT_EVENT_INJECTION_FAILED);
        return true;
        return true;
    }
    }


@@ -713,7 +710,8 @@ bool InputDispatcher::dispatchMotionLocked(
    // Clean up if dropping the event.
    // Clean up if dropping the event.
    if (*dropReason != DROP_REASON_NOT_DROPPED) {
    if (*dropReason != DROP_REASON_NOT_DROPPED) {
        resetTargetsLocked();
        resetTargetsLocked();
        setInjectionResultLocked(entry, INPUT_EVENT_INJECTION_FAILED);
        setInjectionResultLocked(entry, *dropReason == DROP_REASON_POLICY
                ? INPUT_EVENT_INJECTION_SUCCEEDED : INPUT_EVENT_INJECTION_FAILED);
        return true;
        return true;
    }
    }