UsbDeviceManager: Do not set USB config to NONE if CONNECTED uevent is not received for UVC
UVC is a function which is deactivated by default in UVC function driver
at bind time. It requires a user space control application to activate
bind when the application is ready. CONNECTED uevent will therefore not
be received when usb composition is set to uvc,adb, but rather when
DeviceAsWebcam service is ready and activates the function.
Setting usb composition to NONE when CONNECTED uevent is not received
results in the V4L2 device getting destroyed as a part of
uvc_function_unbind(). This causes DeviceAsWebcam to be unable to access
the V4L2 device and thereby not activating the UVC function. This
results in switching back to default adb composition.
->handleMessage(MSG_SET_CURRENT_FUNCTIONS)
->setEnabledFunctions(uvc)
->trySetEnabledFunctions()
->setUsbConfig(none)
->setUsbConfig(uvc)
<sys.usb.state is set to uvc,adb>
<CONNECTED uevent is not received for UVC>
->handleMessage(MSG_UPDATE_STATE)
->updateUsbNotification()
< if CONNECTED uevent is not received >
->setEnabledFunctions(none)
->setUsbConfig(none)
-->uvc_function_unbind()
-->video_unregister_device()
-->v4l2_device_unregister()
<DeviceAsWebcam is ready, but cannot open V4L2 device>
->setUsbConfig(adb)
Do not set the usb composition to none when the current composition is
UVC and CONNECTED uevent is not received from kernel driver to avoid
switching back to default adb composition.
Bug: 379044849
Google: 3503374
Change-Id: I626f8b7bc06c6be0ea23e2af34cb85147af70156
Signed-off-by: Akash M <akash.m5@samsung.com>
Signed-off-by: Selvarasu Ganesan <selvarasu.g@samsung.com>
Signed-off-by: Jackeagle <jackeagle102@gmail.com>
1 file changed