diff options
author | Jeff Brown <jeffbrown@google.com> | 2014-04-11 03:49:37 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2014-04-11 03:49:37 +0000 |
commit | 337e764debde56b1462fb5f2794b3e917d8a42e2 (patch) | |
tree | 5a2b4e77654a0897408f04e429045e49359a0e4b /libs | |
parent | cd5e3f85fc9228b943ee8dfda0951e068953596c (diff) | |
parent | f24687e2731811fd0e3803b691fd47a659f89329 (diff) | |
download | frameworks_base-337e764debde56b1462fb5f2794b3e917d8a42e2.zip frameworks_base-337e764debde56b1462fb5f2794b3e917d8a42e2.tar.gz frameworks_base-337e764debde56b1462fb5f2794b3e917d8a42e2.tar.bz2 |
am f24687e2: Merge "Plumb display power state through display manager." into klp-modular-dev
* commit 'f24687e2731811fd0e3803b691fd47a659f89329':
Plumb display power state through display manager.
Diffstat (limited to 'libs')
-rw-r--r-- | libs/input/InputDispatcher.cpp | 45 | ||||
-rw-r--r-- | libs/input/InputDispatcher.h | 3 | ||||
-rw-r--r-- | libs/input/tests/InputDispatcher_test.cpp | 4 |
3 files changed, 5 insertions, 47 deletions
diff --git a/libs/input/InputDispatcher.cpp b/libs/input/InputDispatcher.cpp index be85cfc..22d1871 100644 --- a/libs/input/InputDispatcher.cpp +++ b/libs/input/InputDispatcher.cpp @@ -248,10 +248,10 @@ void InputDispatcher::dispatchOnce() { void InputDispatcher::dispatchOnceInnerLocked(nsecs_t* nextWakeupTime) { nsecs_t currentTime = now(); - // Reset the key repeat timer whenever we disallow key events, even if the next event - // is not a key. This is to ensure that we abort a key repeat if the device is just coming - // out of sleep. - if (!mPolicy->isKeyRepeatEnabled()) { + // Reset the key repeat timer whenever normal dispatch is suspended while the + // device is in a non-interactive state. This is to ensure that we abort a key + // repeat if the device is just coming out of sleep. + if (!mDispatchEnabled) { resetKeyRepeatLocked(); } @@ -1135,30 +1135,6 @@ int32_t InputDispatcher::findTouchedWindowTargetsLocked(nsecs_t currentTime, // For security reasons, we defer updating the touch state until we are sure that // event injection will be allowed. - // - // FIXME In the original code, screenWasOff could never be set to true. - // The reason is that the POLICY_FLAG_WOKE_HERE - // and POLICY_FLAG_BRIGHT_HERE flags were set only when preprocessing raw - // EV_KEY, EV_REL and EV_ABS events. As it happens, the touch event was - // actually enqueued using the policyFlags that appeared in the final EV_SYN - // events upon which no preprocessing took place. So policyFlags was always 0. - // In the new native input dispatcher we're a bit more careful about event - // preprocessing so the touches we receive can actually have non-zero policyFlags. - // Unfortunately we obtain undesirable behavior. - // - // Here's what happens: - // - // When the device dims in anticipation of going to sleep, touches - // in windows which have FLAG_TOUCHABLE_WHEN_WAKING cause - // the device to brighten and reset the user activity timer. - // Touches on other windows (such as the launcher window) - // are dropped. Then after a moment, the device goes to sleep. Oops. - // - // Also notice how screenWasOff was being initialized using POLICY_FLAG_BRIGHT_HERE - // instead of POLICY_FLAG_WOKE_HERE... - // - bool screenWasOff = false; // original policy: policyFlags & POLICY_FLAG_BRIGHT_HERE; - int32_t displayId = entry->displayId; int32_t action = entry->action; int32_t maskedAction = action & AMOTION_EVENT_ACTION_MASK; @@ -1243,10 +1219,7 @@ int32_t InputDispatcher::findTouchedWindowTargetsLocked(nsecs_t currentTime, isTouchModal = (flags & (InputWindowInfo::FLAG_NOT_FOCUSABLE | InputWindowInfo::FLAG_NOT_TOUCH_MODAL)) == 0; if (isTouchModal || windowInfo->touchableRegionContainsPoint(x, y)) { - if (! screenWasOff - || (flags & InputWindowInfo::FLAG_TOUCHABLE_WHEN_WAKING)) { - newTouchedWindowHandle = windowHandle; - } + newTouchedWindowHandle = windowHandle; break; // found touched window, exit window loop } } @@ -2409,10 +2382,6 @@ void InputDispatcher::notifyKey(const NotifyKeyArgs* args) { mPolicy->interceptKeyBeforeQueueing(&event, /*byref*/ policyFlags); - if (policyFlags & POLICY_FLAG_WOKE_HERE) { - flags |= AKEY_EVENT_FLAG_WOKE_HERE; - } - bool needWake; { // acquire lock mLock.lock(); @@ -2592,10 +2561,6 @@ int32_t InputDispatcher::injectInputEvent(const InputEvent* event, int32_t displ mPolicy->interceptKeyBeforeQueueing(keyEvent, /*byref*/ policyFlags); } - if (policyFlags & POLICY_FLAG_WOKE_HERE) { - flags |= AKEY_EVENT_FLAG_WOKE_HERE; - } - mLock.lock(); firstInjectedEntry = new KeyEntry(keyEvent->getEventTime(), keyEvent->getDeviceId(), keyEvent->getSource(), diff --git a/libs/input/InputDispatcher.h b/libs/input/InputDispatcher.h index 29854b2..9439124 100644 --- a/libs/input/InputDispatcher.h +++ b/libs/input/InputDispatcher.h @@ -211,9 +211,6 @@ public: /* Gets the input dispatcher configuration. */ virtual void getDispatcherConfiguration(InputDispatcherConfiguration* outConfig) = 0; - /* Returns true if automatic key repeating is enabled. */ - virtual bool isKeyRepeatEnabled() = 0; - /* Filters an input event. * Return true to dispatch the event unmodified, false to consume the event. * A filter can also transform and inject events later by passing POLICY_FLAG_FILTERED diff --git a/libs/input/tests/InputDispatcher_test.cpp b/libs/input/tests/InputDispatcher_test.cpp index fc89a9b..7aac6ed 100644 --- a/libs/input/tests/InputDispatcher_test.cpp +++ b/libs/input/tests/InputDispatcher_test.cpp @@ -65,10 +65,6 @@ private: *outConfig = mConfig; } - virtual bool isKeyRepeatEnabled() { - return true; - } - virtual bool filterInputEvent(const InputEvent* inputEvent, uint32_t policyFlags) { return true; } |