Fix led meta state can't be cleared by another keyboard

Currently, the led meta state of CapsLock, NumLock and ScrollLock would
be stored in to a global state. If we connected with multiple keyboards,
and some keyboard changed the led state, others should clear their local
led state frist then update it by the global state so we could clear the
state per device properly.

Bug: 194465459
Test: atest inputflinger_tests
Change-Id: I5965cf951a5ebcadc69541b9a036fb38fd428d30
diff --git a/services/inputflinger/reader/mapper/KeyboardInputMapper.cpp b/services/inputflinger/reader/mapper/KeyboardInputMapper.cpp
index 1d63c0e..2ac8178 100644
--- a/services/inputflinger/reader/mapper/KeyboardInputMapper.cpp
+++ b/services/inputflinger/reader/mapper/KeyboardInputMapper.cpp
@@ -428,6 +428,8 @@
 }
 
 void KeyboardInputMapper::updateLedState(bool reset) {
+    // Clear the local led state then union the global led state.
+    mMetaState &= ~(AMETA_CAPS_LOCK_ON | AMETA_NUM_LOCK_ON | AMETA_SCROLL_LOCK_ON);
     mMetaState |= getContext()->getLedMetaState();
 
     constexpr int32_t META_NUM = 3;