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

Commit 7aeb7ef1 authored by Tadashi G. Takaoka's avatar Tadashi G. Takaoka Committed by Android (Google) Code Review
Browse files

Merge "Fix Keyboard.getKey as thread safe"

parents 7b40c682 8f6c603b
Loading
Loading
Loading
Loading
+12 −10
Original line number Diff line number Diff line
@@ -185,6 +185,7 @@ public class Keyboard {
        if (code == CODE_UNSPECIFIED) {
            return null;
        }
        synchronized (mKeyCache) {
            final int index = mKeyCache.indexOfKey(code);
            if (index >= 0) {
                return mKeyCache.valueAt(index);
@@ -199,6 +200,7 @@ public class Keyboard {
            mKeyCache.put(code, null);
            return null;
        }
    }

    public boolean hasKey(Key aKey) {
        if (mKeyCache.indexOfValue(aKey) >= 0) {