summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2019-12-13 22:19:07 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2019-12-13 22:19:07 +0000
commit3e00f5dcbfa6a96599e615cb765fe5febead275e (patch)
tree45981421176863f275b30da624f3ebd3a1deaadb /modules
parent54b86ebd8b275960141b3d10f03164fd3ed8a50b (diff)
parentd8e047e20d72c78985274355906be323699321b7 (diff)
Merge "Update for increased SW input codes." am: 028d49fd02 am: e8b375fb86 am: d8e047e20d
Change-Id: Ief54d9216855c32cf61b95a35a4ea1961879b95a
Diffstat (limited to 'modules')
-rw-r--r--modules/input/evdev/SwitchInputMapper.cpp17
-rw-r--r--modules/input/evdev/SwitchInputMapper.h4
2 files changed, 17 insertions, 4 deletions
diff --git a/modules/input/evdev/SwitchInputMapper.cpp b/modules/input/evdev/SwitchInputMapper.cpp
index bb79d01e..1b2e749f 100644
--- a/modules/input/evdev/SwitchInputMapper.cpp
+++ b/modules/input/evdev/SwitchInputMapper.cpp
@@ -47,13 +47,26 @@ static struct {
{SW_FRONT_PROXIMITY, INPUT_USAGE_SWITCH_UNKNOWN},
{SW_ROTATE_LOCK, INPUT_USAGE_SWITCH_UNKNOWN},
{SW_LINEIN_INSERT, INPUT_USAGE_SWITCH_UNKNOWN},
- {0x0e /* unused */, INPUT_USAGE_SWITCH_UNKNOWN},
+ {SW_MUTE_DEVICE, INPUT_USAGE_SWITCH_UNKNOWN},
+ {SW_PEN_INSERTED, INPUT_USAGE_SWITCH_UNKNOWN},
+ {SW_HPHL_OVERCURRENT, INPUT_USAGE_SWITCH_UNKNOWN},
+ {SW_HPHR_OVERCURRENT, INPUT_USAGE_SWITCH_UNKNOWN},
+ {SW_UNSUPPORT_INSERT, INPUT_USAGE_SWITCH_UNKNOWN},
+ {0x13 /* unused */, INPUT_USAGE_SWITCH_UNKNOWN},
+ {0x14 /* unused */, INPUT_USAGE_SWITCH_UNKNOWN},
+ {0x15 /* unused */, INPUT_USAGE_SWITCH_UNKNOWN},
+ {0x16 /* unused */, INPUT_USAGE_SWITCH_UNKNOWN},
+ {0x17 /* unused */, INPUT_USAGE_SWITCH_UNKNOWN},
+ {0x18 /* unused */, INPUT_USAGE_SWITCH_UNKNOWN},
+ {0x19 /* unused */, INPUT_USAGE_SWITCH_UNKNOWN},
{SW_MAX, INPUT_USAGE_SWITCH_UNKNOWN},
};
SwitchInputMapper::SwitchInputMapper()
: InputMapper() {
- static_assert(SW_CNT <= 32, "More than 32 switches defined in linux/input.h");
+ // If this gets larger than 64, then the mSwitchValues and mUpdatedSwitchMask
+ // variables need to be changed to support more than 64 bits.
+ static_assert(SW_CNT <= 64, "More than 64 switches defined in linux/input.h");
}
bool SwitchInputMapper::configureInputReport(InputDeviceNode* devNode,
diff --git a/modules/input/evdev/SwitchInputMapper.h b/modules/input/evdev/SwitchInputMapper.h
index e25c3a59..dbd5a031 100644
--- a/modules/input/evdev/SwitchInputMapper.h
+++ b/modules/input/evdev/SwitchInputMapper.h
@@ -39,8 +39,8 @@ private:
void processSwitch(int32_t switchCode, int32_t switchValue);
void sync(nsecs_t when);
- BitSet32 mSwitchValues;
- BitSet32 mUpdatedSwitchMask;
+ BitSet64 mSwitchValues;
+ BitSet64 mUpdatedSwitchMask;
};
} // namespace android