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

Commit 28bcfd4e authored by nao's avatar nao
Browse files

modify the device to enable to get the state as slide-open/slide-close.

This modify is for the devices which have a slidable H/W keyboard with backlight.

For example of current issues:
 - Backlight of H/W keyboard doesn't turn on when the device starts up with slide-open.
 - Home screen doesn't display with proper orientation when the device starts up with slide-open.

Change-Id: I6a6a18d0b09d0ba484ca992c9fb34f24de9bf21b
parent 1a1b70fb
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -547,9 +547,9 @@ int32_t InputReader::getState(int32_t deviceId, uint32_t sourceMask, int32_t cod
            for (size_t i = 0; i < numDevices; i++) {
                InputDevice* device = mDevices.valueAt(i);
                if (! device->isIgnored() && sourcesMatchMask(device->getSources(), sourceMask)) {
                    result = (device->*getStateFunc)(sourceMask, code);
                    if (result >= AKEY_STATE_DOWN) {
                        return result;
                    int32_t state = (device->*getStateFunc)(sourceMask, code);
                    if (state > result) {
                        result = state;
                    }
                }
            }
@@ -737,9 +737,9 @@ int32_t InputDevice::getState(uint32_t sourceMask, int32_t code, GetStateFunc ge
    for (size_t i = 0; i < numMappers; i++) {
        InputMapper* mapper = mMappers[i];
        if (sourcesMatchMask(mapper->getSources(), sourceMask)) {
            result = (mapper->*getStateFunc)(sourceMask, code);
            if (result >= AKEY_STATE_DOWN) {
                return result;
            int32_t state = (mapper->*getStateFunc)(sourceMask, code);
            if (state > result) {
                result = state;
            }
        }
    }