From e1153030e7f2a91d9fc38ec7d789ff3319a105de Mon Sep 17 00:00:00 2001 From: Avichal Rakesh Date: Thu, 19 Jan 2023 19:52:06 -0800 Subject: [PATCH] Usb Gadget: Add UVC to Usb Gadget interface UVC Gadget Function is required for DeviceAsWebcam service that lets Android Devices be used as Webcam when connected to hosts. This CL adds the UVC GadgetFunction to the USB Gadget interface. Bug: 242344221 Test: Manually tested that the HAL and the framework pick up the new GadgetFunction Change-Id: I93acf458f279500320ffc5abd55f139d3d768101 --- .../hardware/usb/gadget/GadgetFunction.aidl | 15 ++++++++------- .../hardware/usb/gadget/GadgetFunction.aidl | 4 ++++ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/usb/gadget/aidl/aidl_api/android.hardware.usb.gadget/current/android/hardware/usb/gadget/GadgetFunction.aidl b/usb/gadget/aidl/aidl_api/android.hardware.usb.gadget/current/android/hardware/usb/gadget/GadgetFunction.aidl index c3f26d5efd..78b79e46e3 100644 --- a/usb/gadget/aidl/aidl_api/android.hardware.usb.gadget/current/android/hardware/usb/gadget/GadgetFunction.aidl +++ b/usb/gadget/aidl/aidl_api/android.hardware.usb.gadget/current/android/hardware/usb/gadget/GadgetFunction.aidl @@ -36,11 +36,12 @@ package android.hardware.usb.gadget; parcelable GadgetFunction { const long NONE = 0; const long ADB = 1; - const long ACCESSORY = 2; - const long MTP = 4; - const long MIDI = 8; - const long PTP = 16; - const long RNDIS = 32; - const long AUDIO_SOURCE = 64; - const long NCM = 1024; + const long ACCESSORY = (1 << 1); + const long MTP = (1 << 2); + const long MIDI = (1 << 3); + const long PTP = (1 << 4); + const long RNDIS = (1 << 5); + const long AUDIO_SOURCE = (1 << 6); + const long UVC = (1 << 7); + const long NCM = (1 << 10); } diff --git a/usb/gadget/aidl/android/hardware/usb/gadget/GadgetFunction.aidl b/usb/gadget/aidl/android/hardware/usb/gadget/GadgetFunction.aidl index d82b427621..dd7ee3771f 100644 --- a/usb/gadget/aidl/android/hardware/usb/gadget/GadgetFunction.aidl +++ b/usb/gadget/aidl/android/hardware/usb/gadget/GadgetFunction.aidl @@ -50,6 +50,10 @@ parcelable GadgetFunction { * AOAv2.0 - Audio Source function. */ const long AUDIO_SOURCE = 1 << 6; + /** + * UVC - Universal Video Class function. + */ + const long UVC = 1 << 7; /** * NCM - NCM function. */