Refactor AssociatedDevice initialization in EventHub

Since AssociatedDevice contains information from the sysfs classes of a
device that are loaded once when the device is connected, we change the
AssociatedDevice initialization logic to be more functional and easier
to read.

There should be no behaivor change in this CL.

Bug: 243005009
Test: atest inputflinger_tests
Change-Id: I753fb07af9558c844e0c4eb7b8558b4f78b58004
2 files changed