Add UVC support

This CL adds support for UVC GadgetFunction. UVC can be enabled/disabled
by setting the `ro.usb.uvc.enabled` property, and this CL makes sure
that the Settings app honors the property when showing USB functions to
the user.

Bug: 242344221
Test: Manually tested that the 'USB Webcam' option is present when the
      property is set, and removed when property is unset.
Change-Id: I5d1ff0a43d3c0c722bc9e03132a581da5c61bd76
This commit is contained in:
Avichal Rakesh
2023-01-19 14:21:02 -08:00
parent d540e02be8
commit e6731b05e1
5 changed files with 25 additions and 2 deletions

View File

@@ -129,6 +129,8 @@ public class ConnectedUsbDeviceUpdater {
return R.string.usb_summary_photo_transfers;
} else if (functions == UsbManager.FUNCTION_MIDI) {
return R.string.usb_summary_MIDI;
} else if (functions == UsbManager.FUNCTION_UVC) {
return R.string.usb_summary_UVC;
} else {
return R.string.usb_summary_charging_only;
}
@@ -141,6 +143,8 @@ public class ConnectedUsbDeviceUpdater {
return R.string.usb_summary_photo_transfers_power;
} else if (functions == UsbManager.FUNCTION_MIDI) {
return R.string.usb_summary_MIDI_power;
} else if (functions == UsbManager.FUNCTION_UVC) {
return R.string.usb_summary_UVC_power;
} else {
return R.string.usb_summary_power_only;
}