Commit graph

8 commits

Author SHA1 Message Date
Mark Salyzyn
1385725e09 init: switch out keychord id with std::vector match of chords
Drop all references to keychord_id and id and instead use keycodes_
as the id.  The keycodes are a std::vector<int> with an unique
sorted-order emplacement method added in the parser.  Solves the
academic issue with duplicate keychords and trigger all services
that match rather than first match only.

Test: init_tests
Bug: 64114943
Change-Id: I5582779d81458fda393004c551c0d3c03d9471e0
2018-05-29 15:18:38 -07:00
Mark Salyzyn
06aeb41c16 init: turn keychords into a standalone class
Test: init_tests
Bug: 64114943
Change-Id: Ie760e4a3a661260ed2aabb8a92fe65fc93521cb5
2018-05-29 13:46:12 -07:00
Mark Salyzyn
eca2507634 init: refactor keychord for testing
Move things around so that keychords.cpp is independent of service
and init and can be individually tested with few dependencies.
Permits also rolling out the keychords as a class in a future commit.
Improve parser checking.

Test: init_tests
Bug: 64114943
Change-Id: I82570bc6269ed478db784ec38a8bc916da2be2be
2018-05-29 13:20:19 -07:00
Mark Salyzyn
6c6ec7240c init: separate out epoll into a class
Test: init_tests
Bug: 64114943
Change-Id: I5f03314773b02b9e30e8e21895b6bdcfd4909e88
2018-05-21 14:58:03 -07:00
Mark Salyzyn
353bf1f945 init: switch from /dev/keychord to /dev/input/
Replace deprecated /dev/keychord driver with /dev/input/ interface.
Will restrict which nodes are active and relevant, and try to mask
out any unreferenced inputs with EVIOCSMASK if available.

Test: manual, boot, check registered chord works
Bug: 64114943
Change-Id: I2bbf84a6e472d720f02282e10d56795b75ac62d1
2018-05-08 13:19:12 -07:00
Tom Cherry
81f5d3ebef init: create android::init:: namespace
With some small fixups along the way

Test: Boot bullhead
Test: init unit tests
Change-Id: I7beaa473cfa9397f845f810557d1631b4a462d6a
2017-06-23 13:21:20 -07:00
Elliott Hughes
929f407076 Switch init to epoll.
Not just because it's what the cool kids are doing --- it also lets us
simplify the inner loop and decouple it from whatever systems want to
be woken to perform some activity if there's data to be read on some fd.

Currently this is just used to clean up the existing signal handling,
keychord, and property service code.

Change-Id: I4d7541a2c4386957ad877df69e3be08b96a7dec5
2015-04-24 21:13:44 -07:00
Colin Cross
a866695ebe init: Move keychords to keychords.c
Change-Id: I8fba9f5f73439a451fc961f8111612dff4fb5dfd
2010-04-13 22:46:44 -07:00