From 23e8ae9cf2793b83e220adec4cf6dec35e090e53 Mon Sep 17 00:00:00 2001 From: Vaibhav Devmurari Date: Thu, 29 Dec 2022 12:07:56 +0000 Subject: Clear applied layout overlay if new layout overlay is null. Need to allow resetting of key character map by setting overlay map to null. This is required when moving from a IME setting that has a KCM to another IME setting that has none. Test: atest KeyboardLayoutChangeTest Bug: 20805588 Change-Id: I62dc65970b61628486aff698a8ab8ccb31c109d6 --- libs/input/KeyCharacterMap.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'libs/input/KeyCharacterMap.cpp') diff --git a/libs/input/KeyCharacterMap.cpp b/libs/input/KeyCharacterMap.cpp index fa5c41f657..6bfac40932 100644 --- a/libs/input/KeyCharacterMap.cpp +++ b/libs/input/KeyCharacterMap.cpp @@ -255,6 +255,13 @@ void KeyCharacterMap::combine(const KeyCharacterMap& overlay) { mLayoutOverlayApplied = true; } +void KeyCharacterMap::clearLayoutOverlay() { + if (mLayoutOverlayApplied) { + reloadBaseFromFile(); + mLayoutOverlayApplied = false; + } +} + KeyCharacterMap::KeyboardType KeyCharacterMap::getKeyboardType() const { return mType; } -- cgit v1.2.3-59-g8ed1b