Check if /dev/input exists before accessing the path
It is possible that development platforms don't have any input devices,
hence /dev/input directory won't be created. Hence check if /dev/input exists
before adding inotify watch and scanDirLocked for /dev/input.
inotify_add_watch is also added for /dev/input when it is created. for e.g.
during EventHubTest.
Test: atest inputflinger_tests (on a development board with no input
devices)
Signed-off-by: Usama Arif <usama.arif@arm.com>
Change-Id: I8675921280e351dd8885becce79a7cb4a9936c10
Merged-In: I8675921280e351dd8885becce79a7cb4a9936c10
(cherry picked from commit b27c8e63e5b4961c300c50e1c935e0f7cdeea0fa)
2 files changed