Usb: Optimize uevent handling

uevent_event() is used to process all uevents from the kernel
and check for the various USB events we are interested in:
Type-C, power_supply (for moisture detection), and new devices
added to the USB host bus. However the current implementation
is very inefficient as it performs various string comparisons
and regex matching in a loop over each string in the uevent which
consumes a lot of CPU cycles.

Improve it by checking only the first string in the uevent to
decide whether it is a Type-C, power_supply, or USB bus event.
From there we can then split off into separate handlers which
will only parse the rest of the uevent as needed, otherwise we
abort the loop as early as possible once we have the information
we need.

Also remove the log when moisture contamination is not detected
which avoids spamming in the normal case.

Change-Id: Ia486202e583d1d8a0ec21eb53a6e4c20a33f0f9b
1 file changed
tree: 601928b9af0d8d87530bb46a1eea7d53eaa8b6f6
  1. etc/
  2. hal/
  3. vendor_product.mk