From 872db4f11e407accccba9d37c335ef7e3597eba4 Mon Sep 17 00:00:00 2001 From: Michael Wright Date: Tue, 22 Apr 2014 15:03:51 -0700 Subject: Move key attribute information out of native. Native doesn't ever actually care about the attributes of keys, so move all of it up into the managed layer and move all of the key names down so they're defined once. Change-Id: Ic8ded13ce050b2b98744735ff50d11e8d882d7d5 --- services/inputflinger/InputDispatcher.cpp | 12 ------------ services/inputflinger/InputReader.cpp | 9 ++++----- 2 files changed, 4 insertions(+), 17 deletions(-) (limited to 'services/inputflinger') diff --git a/services/inputflinger/InputDispatcher.cpp b/services/inputflinger/InputDispatcher.cpp index f219f95..0bae399 100644 --- a/services/inputflinger/InputDispatcher.cpp +++ b/services/inputflinger/InputDispatcher.cpp @@ -2360,18 +2360,6 @@ void InputDispatcher::notifyKey(const NotifyKeyArgs* args) { policyFlags |= POLICY_FLAG_VIRTUAL; flags |= AKEY_EVENT_FLAG_VIRTUAL_HARD_KEY; } - if (policyFlags & POLICY_FLAG_ALT) { - metaState |= AMETA_ALT_ON | AMETA_ALT_LEFT_ON; - } - if (policyFlags & POLICY_FLAG_ALT_GR) { - metaState |= AMETA_ALT_ON | AMETA_ALT_RIGHT_ON; - } - if (policyFlags & POLICY_FLAG_SHIFT) { - metaState |= AMETA_SHIFT_ON | AMETA_SHIFT_LEFT_ON; - } - if (policyFlags & POLICY_FLAG_CAPS_LOCK) { - metaState |= AMETA_CAPS_LOCK_ON; - } if (policyFlags & POLICY_FLAG_FUNCTION) { metaState |= AMETA_FUNCTION_ON; } diff --git a/services/inputflinger/InputReader.cpp b/services/inputflinger/InputReader.cpp index f27ba96..8295c4c 100644 --- a/services/inputflinger/InputReader.cpp +++ b/services/inputflinger/InputReader.cpp @@ -2167,9 +2167,8 @@ void KeyboardInputMapper::processKey(nsecs_t when, bool down, int32_t keyCode, // For internal keyboards, the key layout file should specify the policy flags for // each wake key individually. // TODO: Use the input device configuration to control this behavior more finely. - if (down && getDevice()->isExternal() - && !(policyFlags & (POLICY_FLAG_WAKE | POLICY_FLAG_WAKE_DROPPED))) { - policyFlags |= POLICY_FLAG_WAKE_DROPPED; + if (down && getDevice()->isExternal()) { + policyFlags |= POLICY_FLAG_WAKE; } if (mParameters.handlesKeyRepeat) { @@ -2510,7 +2509,7 @@ void CursorInputMapper::sync(nsecs_t when) { // TODO: Use the input device configuration to control this behavior more finely. uint32_t policyFlags = 0; if ((buttonsPressed || moved || scrolled) && getDevice()->isExternal()) { - policyFlags |= POLICY_FLAG_WAKE_DROPPED; + policyFlags |= POLICY_FLAG_WAKE; } // Synthesize key down from buttons if needed. @@ -3787,7 +3786,7 @@ void TouchInputMapper::sync(nsecs_t when) { } if (mParameters.wake) { - policyFlags |= POLICY_FLAG_WAKE_DROPPED; + policyFlags |= POLICY_FLAG_WAKE; } } -- cgit v1.1