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

Commit 6a506057 authored by Vaibhav Devmurari's avatar Vaibhav Devmurari
Browse files

[1/n native] Disable key remapping for virtual keyboards

Test: atest CtsHardwareTestCases
Bug: 402596982
Flag: com.android.hardware.input.disable_settings_for_virtual_devices
Change-Id: Ia58fb211561f79d9ffa3a14578d4e0d6a0757966
parent 2a39e4ba
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -399,10 +399,11 @@ std::list<NotifyArgs> InputDevice::configureInternal(nsecs_t when,
        }

        if (!changes.any() || changes.test(InputReaderConfiguration::Change::KEY_REMAPPING)) {
            const bool isFullKeyboard =
                    (mSources & AINPUT_SOURCE_KEYBOARD) == AINPUT_SOURCE_KEYBOARD &&
                    mKeyboardType == KeyboardType::ALPHABETIC;
            if (isFullKeyboard) {
            const bool isKeyboard =
                    (mSources & AINPUT_SOURCE_KEYBOARD) == AINPUT_SOURCE_KEYBOARD;
            const bool isFullKeyboard = isKeyboard && (mKeyboardType == KeyboardType::ALPHABETIC);
            const bool isPhysicalKeyboard = isKeyboard && !mIsVirtualDevice;
            if (isPhysicalKeyboard && isFullKeyboard) {
                for_each_subdevice([&readerConfig](auto& context) {
                    context.setKeyRemapping(readerConfig.keyRemapping);
                });