Handle device change actions in mist udev rules.

This CL modifies the mist udev rules to also handle device change
actions such that, in absence of an add action, we can still perform
appropriate actions on a supported device upon receving the first change
action on the device.

BUG=chromium:275952
TEST=Tested the following:
1. Build and run unit tests.
2. Insert a supported 3G dongle and verify that mist is invoked to
   switch the dongle into a modem. Also verify using the following
   command that udev sets MIST_SUPPORTED_DEVICE=1 on the dongle device
   when it's added to the system and after it's switched to a modem:

   udevadm monitor --property --subsystem-match=usb/usb_device

(cherry picked from commit 556df81458029dbd31916e8d2d628c5c9fcd0ef9)

Change-Id: Ice4615754041262e7abd147b4fa7868b8a6b3514
Reviewed-on: https://gerrit.chromium.org/gerrit/66623
Commit-Queue: Ben Chan <benchan@chromium.org>
Reviewed-by: Ben Chan <benchan@chromium.org>
Tested-by: Ben Chan <benchan@chromium.org>
1 file changed
tree: 2a787c7c9626d8bfb215da6fb3cff5c579dcb99a
  1. proto/
  2. 51-mist.rules
  3. common.mk
  4. config_loader.cc
  5. config_loader.h
  6. config_loader_unittest.cc
  7. context.cc
  8. context.h
  9. default.conf
  10. event_dispatcher.cc
  11. event_dispatcher.h
  12. event_dispatcher_unittest.cc
  13. LICENSE
  14. main.cc
  15. Makefile
  16. mist.cc
  17. mist.h
  18. mock_config_loader.cc
  19. mock_config_loader.h
  20. mock_context.cc
  21. mock_context.h
  22. mock_udev.cc
  23. mock_udev.h
  24. mock_udev_device.cc
  25. mock_udev_device.h
  26. mock_udev_enumerate.cc
  27. mock_udev_enumerate.h
  28. mock_udev_list_entry.cc
  29. mock_udev_list_entry.h
  30. mock_udev_monitor.cc
  31. mock_udev_monitor.h
  32. mock_usb_device_event_observer.cc
  33. mock_usb_device_event_observer.h
  34. OWNERS
  35. README
  36. testrunner.cc
  37. udev.cc
  38. udev.h
  39. udev_device.cc
  40. udev_device.h
  41. udev_enumerate.cc
  42. udev_enumerate.h
  43. udev_list_entry.cc
  44. udev_list_entry.h
  45. udev_monitor.cc
  46. udev_monitor.h
  47. usb_bulk_transfer.cc
  48. usb_bulk_transfer.h
  49. usb_config_descriptor.cc
  50. usb_config_descriptor.h
  51. usb_config_descriptor_unittest.cc
  52. usb_constants.cc
  53. usb_constants.h
  54. usb_constants_unittest.cc
  55. usb_device.cc
  56. usb_device.h
  57. usb_device_descriptor.cc
  58. usb_device_descriptor.h
  59. usb_device_descriptor_unittest.cc
  60. usb_device_event_notifier.cc
  61. usb_device_event_notifier.h
  62. usb_device_event_notifier_unittest.cc
  63. usb_device_event_observer.h
  64. usb_endpoint_descriptor.cc
  65. usb_endpoint_descriptor.h
  66. usb_endpoint_descriptor_unittest.cc
  67. usb_error.cc
  68. usb_error.h
  69. usb_error_unittest.cc
  70. usb_interface.cc
  71. usb_interface.h
  72. usb_interface_descriptor.cc
  73. usb_interface_descriptor.h
  74. usb_interface_descriptor_unittest.cc
  75. usb_manager.cc
  76. usb_manager.h
  77. usb_modem_one_shot_switcher.cc
  78. usb_modem_one_shot_switcher.h
  79. usb_modem_switch_context.cc
  80. usb_modem_switch_context.h
  81. usb_modem_switch_context_unittest.cc
  82. usb_modem_switch_operation.cc
  83. usb_modem_switch_operation.h
  84. usb_modem_switcher.cc
  85. usb_modem_switcher.h
  86. usb_transfer.cc
  87. usb_transfer.h
  88. usb_transfer_unittest.cc