Merge "Make a few function parameters to be reference"
diff --git a/automotive/evs/1.1/vts/functional/VtsHalEvsV1_1TargetTest.cpp b/automotive/evs/1.1/vts/functional/VtsHalEvsV1_1TargetTest.cpp
index a3dc45b..8cc1882 100644
--- a/automotive/evs/1.1/vts/functional/VtsHalEvsV1_1TargetTest.cpp
+++ b/automotive/evs/1.1/vts/functional/VtsHalEvsV1_1TargetTest.cpp
@@ -2269,48 +2269,74 @@
 
     // Acquire the graphics buffer allocator
     android::GraphicBufferAllocator& alloc(android::GraphicBufferAllocator::get());
-    const auto usage = GRALLOC_USAGE_HW_TEXTURE |
-                       GRALLOC_USAGE_SW_READ_RARELY |
-                       GRALLOC_USAGE_SW_WRITE_OFTEN;
+    const auto usage =
+            GRALLOC_USAGE_HW_TEXTURE | GRALLOC_USAGE_SW_READ_RARELY | GRALLOC_USAGE_SW_WRITE_OFTEN;
     const auto format = HAL_PIXEL_FORMAT_RGBA_8888;
-    const auto width = 640;
-    const auto height = 360;
-
-    // Allocate buffers to use
-    hidl_vec<BufferDesc> buffers;
-    buffers.resize(kBuffersToHold);
-    for (auto i = 0; i < kBuffersToHold; ++i) {
-        unsigned pixelsPerLine;
-        buffer_handle_t memHandle = nullptr;
-        android::status_t result = alloc.allocate(width,
-                                                  height,
-                                                  format,
-                                                  1,
-                                                  usage,
-                                                  &memHandle,
-                                                  &pixelsPerLine,
-                                                  0,
-                                                  "EvsApp");
-        if (result != android::NO_ERROR) {
-            LOG(ERROR) << __FUNCTION__ << " failed to allocate memory.";
-        } else {
-            BufferDesc buf;
-            AHardwareBuffer_Desc* pDesc =
-                reinterpret_cast<AHardwareBuffer_Desc *>(&buf.buffer.description);
-            pDesc->width = width;
-            pDesc->height = height;
-            pDesc->layers = 1;
-            pDesc->format = format;
-            pDesc->usage = usage;
-            pDesc->stride = pixelsPerLine;
-            buf.buffer.nativeHandle = memHandle;
-            buf.bufferId = i;   // Unique number to identify this buffer
-            buffers[i] = buf;
-        }
-    }
+    uint32_t width = 640;
+    uint32_t height = 360;
+    camera_metadata_entry_t streamCfgs;
 
     // Test each reported camera
-    for (auto&& cam: cameraInfo) {
+    for (auto&& cam : cameraInfo) {
+        bool foundCfg = false;
+        if (!find_camera_metadata_entry(reinterpret_cast<camera_metadata_t*>(cam.metadata.data()),
+                                        ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS,
+                                        &streamCfgs)) {
+            // Stream configurations are found in metadata
+            RawStreamConfig* ptr = reinterpret_cast<RawStreamConfig*>(streamCfgs.data.i32);
+
+            LOG(DEBUG) << __LINE__ << " start searching " << streamCfgs.count;
+            for (unsigned idx = 0; idx < streamCfgs.count; idx++) {
+                LOG(DEBUG) << "ptr->direction= " << ptr->direction
+                           << " ptr->format= " << ptr->format;
+                if (ptr->direction == ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS_OUTPUT &&
+                    ptr->format == HAL_PIXEL_FORMAT_RGBA_8888) {
+                    width = ptr->width;
+                    height = ptr->height;
+                    foundCfg = true;
+                    // Always use the 1st available configuration
+                    break;
+                }
+                ++ptr;
+            }
+        }
+
+        if (!foundCfg) {
+            LOG(INFO) << "No configuration found. Use default stream configurations.";
+        }
+
+        // Allocate buffers to use
+        hidl_vec<BufferDesc> buffers;
+        buffers.resize(kBuffersToHold);
+        for (auto i = 0; i < kBuffersToHold; ++i) {
+            unsigned pixelsPerLine;
+            buffer_handle_t memHandle = nullptr;
+            android::status_t result =
+                    alloc.allocate(width, height, format, 1, usage, &memHandle, &pixelsPerLine, 0,
+                                   "CameraStreamExternalBufferingTest");
+            if (result != android::NO_ERROR) {
+                LOG(ERROR) << __FUNCTION__ << " failed to allocate memory.";
+                // Release previous allocated buffers
+                for (auto j = 0; j < i; j++) {
+                    alloc.free(buffers[i].buffer.nativeHandle);
+                }
+                return;
+            } else {
+                BufferDesc buf;
+                AHardwareBuffer_Desc* pDesc =
+                        reinterpret_cast<AHardwareBuffer_Desc*>(&buf.buffer.description);
+                pDesc->width = width;
+                pDesc->height = height;
+                pDesc->layers = 1;
+                pDesc->format = format;
+                pDesc->usage = usage;
+                pDesc->stride = pixelsPerLine;
+                buf.buffer.nativeHandle = memHandle;
+                buf.bufferId = i;  // Unique number to identify this buffer
+                buffers[i] = buf;
+            }
+        }
+
         bool isLogicalCam = false;
         getPhysicalCameraIds(cam.v1.cameraId, isLogicalCam);
 
@@ -2374,13 +2400,12 @@
         // Explicitly release the camera
         pEnumerator->closeCamera(pCam);
         activeCameras.clear();
+        // Release buffers
+        for (auto& b : buffers) {
+            alloc.free(b.buffer.nativeHandle);
+        }
+        buffers.resize(0);
     }
-
-    // Release buffers
-    for (auto& b : buffers) {
-        alloc.free(b.buffer.nativeHandle);
-    }
-    buffers.resize(0);
 }
 
 
diff --git a/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultConfig.h b/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultConfig.h
index 909a196..0173a42 100644
--- a/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultConfig.h
+++ b/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultConfig.h
@@ -328,6 +328,11 @@
                          .prop = toInt(VehicleProperty::CURRENT_GEAR),
                          .access = VehiclePropertyAccess::READ,
                          .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
+                         .configArray = {(int)VehicleGear::GEAR_PARK,
+                                         (int)VehicleGear::GEAR_NEUTRAL,
+                                         (int)VehicleGear::GEAR_REVERSE, (int)VehicleGear::GEAR_1,
+                                         (int)VehicleGear::GEAR_2, (int)VehicleGear::GEAR_3,
+                                         (int)VehicleGear::GEAR_4, (int)VehicleGear::GEAR_5},
                  },
          .initialValue = {.int32Values = {toInt(VehicleGear::GEAR_PARK)}}},
 
diff --git a/biometrics/face/1.0/vts/functional/OWNERS b/biometrics/face/1.0/vts/functional/OWNERS
new file mode 100644
index 0000000..7651b69
--- /dev/null
+++ b/biometrics/face/1.0/vts/functional/OWNERS
@@ -0,0 +1,2 @@
+# Bug component: 432605
+ilyamaty@google.com
diff --git a/bluetooth/audio/2.0/default/A2dpSoftwareAudioProvider.cpp b/bluetooth/audio/2.0/default/A2dpSoftwareAudioProvider.cpp
index f71a73e..0c0b85f 100644
--- a/bluetooth/audio/2.0/default/A2dpSoftwareAudioProvider.cpp
+++ b/bluetooth/audio/2.0/default/A2dpSoftwareAudioProvider.cpp
@@ -32,10 +32,14 @@
 using ::android::bluetooth::audio::BluetoothAudioSessionReport;
 using ::android::hardware::Void;
 
+// Here the buffer size is based on SBC
 static constexpr uint32_t kPcmFrameSize = 4;  // 16 bits per sample / stereo
-static constexpr uint32_t kPcmFrameCount = 128;
+// SBC is 128, and here choose the LCM of 16, 24, and 32
+static constexpr uint32_t kPcmFrameCount = 96;
 static constexpr uint32_t kRtpFrameSize = kPcmFrameSize * kPcmFrameCount;
-static constexpr uint32_t kRtpFrameCount = 7;  // max counts by 1 tick (20ms)
+// The max counts by 1 tick (20ms) for SBC is about 7. Since using 96 for the
+// PCM counts, here we just choose a greater number
+static constexpr uint32_t kRtpFrameCount = 10;
 static constexpr uint32_t kBufferSize = kRtpFrameSize * kRtpFrameCount;
 static constexpr uint32_t kBufferCount = 2;  // double buffer
 static constexpr uint32_t kDataMqSize = kBufferSize * kBufferCount;
diff --git a/bluetooth/audio/2.1/default/A2dpSoftwareAudioProvider.cpp b/bluetooth/audio/2.1/default/A2dpSoftwareAudioProvider.cpp
index a37176b..4928cea 100644
--- a/bluetooth/audio/2.1/default/A2dpSoftwareAudioProvider.cpp
+++ b/bluetooth/audio/2.1/default/A2dpSoftwareAudioProvider.cpp
@@ -34,10 +34,14 @@
 using ::android::hardware::Void;
 using ::android::hardware::bluetooth::audio::V2_0::AudioConfiguration;
 
+// Here the buffer size is based on SBC
 static constexpr uint32_t kPcmFrameSize = 4;  // 16 bits per sample / stereo
-static constexpr uint32_t kPcmFrameCount = 128;
+// SBC is 128, and here we choose the LCM of 16, 24, and 32
+static constexpr uint32_t kPcmFrameCount = 96;
 static constexpr uint32_t kRtpFrameSize = kPcmFrameSize * kPcmFrameCount;
-static constexpr uint32_t kRtpFrameCount = 7;  // max counts by 1 tick (20ms)
+// The max counts by 1 tick (20ms) for SBC is about 7. Since using 96 for the
+// PCM counts, here we just choose a greater number
+static constexpr uint32_t kRtpFrameCount = 10;
 static constexpr uint32_t kBufferSize = kRtpFrameSize * kRtpFrameCount;
 static constexpr uint32_t kBufferCount = 2;  // double buffer
 static constexpr uint32_t kDataMqSize = kBufferSize * kBufferCount;
diff --git a/common/fmq/aidl/Android.bp b/common/fmq/aidl/Android.bp
index 4b38241..3c414e7 100644
--- a/common/fmq/aidl/Android.bp
+++ b/common/fmq/aidl/Android.bp
@@ -25,6 +25,7 @@
     backend: {
         java: {
             sdk_version: "module_current",
+            srcs_available: true,
         },
         cpp: {
             enabled: false,
diff --git a/common/fmq/aidl/aidl_api/android.hardware.common.fmq/1/.hash b/common/fmq/aidl/aidl_api/android.hardware.common.fmq/1/.hash
index da122e6..b88c5fc 100644
--- a/common/fmq/aidl/aidl_api/android.hardware.common.fmq/1/.hash
+++ b/common/fmq/aidl/aidl_api/android.hardware.common.fmq/1/.hash
@@ -1 +1,2 @@
 12cf0ce8614557cc0efe73bdf011f5193f7a8653
+6a780550f6e6965d6969fd7964c3ca81b6b0ccdf
diff --git a/common/fmq/aidl/aidl_api/android.hardware.common.fmq/1/android/hardware/common/fmq/GrantorDescriptor.aidl b/common/fmq/aidl/aidl_api/android.hardware.common.fmq/1/android/hardware/common/fmq/GrantorDescriptor.aidl
index cf7048b..0430c6e 100644
--- a/common/fmq/aidl/aidl_api/android.hardware.common.fmq/1/android/hardware/common/fmq/GrantorDescriptor.aidl
+++ b/common/fmq/aidl/aidl_api/android.hardware.common.fmq/1/android/hardware/common/fmq/GrantorDescriptor.aidl
@@ -32,6 +32,7 @@
 // later when a module using the interface is updated, e.g., Mainline modules.
 
 package android.hardware.common.fmq;
+/* @hide */
 @VintfStability
 parcelable GrantorDescriptor {
   int fdIndex;
diff --git a/common/fmq/aidl/aidl_api/android.hardware.common.fmq/1/android/hardware/common/fmq/MQDescriptor.aidl b/common/fmq/aidl/aidl_api/android.hardware.common.fmq/1/android/hardware/common/fmq/MQDescriptor.aidl
index add4b64..ab3af0f 100644
--- a/common/fmq/aidl/aidl_api/android.hardware.common.fmq/1/android/hardware/common/fmq/MQDescriptor.aidl
+++ b/common/fmq/aidl/aidl_api/android.hardware.common.fmq/1/android/hardware/common/fmq/MQDescriptor.aidl
@@ -32,6 +32,7 @@
 // later when a module using the interface is updated, e.g., Mainline modules.
 
 package android.hardware.common.fmq;
+/* @hide */
 @VintfStability
 parcelable MQDescriptor<T, Flavor> {
   android.hardware.common.fmq.GrantorDescriptor[] grantors;
diff --git a/common/fmq/aidl/aidl_api/android.hardware.common.fmq/1/android/hardware/common/fmq/SynchronizedReadWrite.aidl b/common/fmq/aidl/aidl_api/android.hardware.common.fmq/1/android/hardware/common/fmq/SynchronizedReadWrite.aidl
index 12c61ba..72bab1c 100644
--- a/common/fmq/aidl/aidl_api/android.hardware.common.fmq/1/android/hardware/common/fmq/SynchronizedReadWrite.aidl
+++ b/common/fmq/aidl/aidl_api/android.hardware.common.fmq/1/android/hardware/common/fmq/SynchronizedReadWrite.aidl
@@ -32,6 +32,7 @@
 // later when a module using the interface is updated, e.g., Mainline modules.
 
 package android.hardware.common.fmq;
+/* @hide */
 @VintfStability
 enum SynchronizedReadWrite {
   EMPTY = 0,
diff --git a/common/fmq/aidl/aidl_api/android.hardware.common.fmq/1/android/hardware/common/fmq/UnsynchronizedWrite.aidl b/common/fmq/aidl/aidl_api/android.hardware.common.fmq/1/android/hardware/common/fmq/UnsynchronizedWrite.aidl
index f99528d..f308688 100644
--- a/common/fmq/aidl/aidl_api/android.hardware.common.fmq/1/android/hardware/common/fmq/UnsynchronizedWrite.aidl
+++ b/common/fmq/aidl/aidl_api/android.hardware.common.fmq/1/android/hardware/common/fmq/UnsynchronizedWrite.aidl
@@ -32,6 +32,7 @@
 // later when a module using the interface is updated, e.g., Mainline modules.
 
 package android.hardware.common.fmq;
+/* @hide */
 @VintfStability
 enum UnsynchronizedWrite {
   EMPTY = 0,
diff --git a/common/fmq/aidl/aidl_api/android.hardware.common.fmq/current/android/hardware/common/fmq/GrantorDescriptor.aidl b/common/fmq/aidl/aidl_api/android.hardware.common.fmq/current/android/hardware/common/fmq/GrantorDescriptor.aidl
index cf7048b..0430c6e 100644
--- a/common/fmq/aidl/aidl_api/android.hardware.common.fmq/current/android/hardware/common/fmq/GrantorDescriptor.aidl
+++ b/common/fmq/aidl/aidl_api/android.hardware.common.fmq/current/android/hardware/common/fmq/GrantorDescriptor.aidl
@@ -32,6 +32,7 @@
 // later when a module using the interface is updated, e.g., Mainline modules.
 
 package android.hardware.common.fmq;
+/* @hide */
 @VintfStability
 parcelable GrantorDescriptor {
   int fdIndex;
diff --git a/common/fmq/aidl/aidl_api/android.hardware.common.fmq/current/android/hardware/common/fmq/MQDescriptor.aidl b/common/fmq/aidl/aidl_api/android.hardware.common.fmq/current/android/hardware/common/fmq/MQDescriptor.aidl
index add4b64..ab3af0f 100644
--- a/common/fmq/aidl/aidl_api/android.hardware.common.fmq/current/android/hardware/common/fmq/MQDescriptor.aidl
+++ b/common/fmq/aidl/aidl_api/android.hardware.common.fmq/current/android/hardware/common/fmq/MQDescriptor.aidl
@@ -32,6 +32,7 @@
 // later when a module using the interface is updated, e.g., Mainline modules.
 
 package android.hardware.common.fmq;
+/* @hide */
 @VintfStability
 parcelable MQDescriptor<T, Flavor> {
   android.hardware.common.fmq.GrantorDescriptor[] grantors;
diff --git a/common/fmq/aidl/aidl_api/android.hardware.common.fmq/current/android/hardware/common/fmq/SynchronizedReadWrite.aidl b/common/fmq/aidl/aidl_api/android.hardware.common.fmq/current/android/hardware/common/fmq/SynchronizedReadWrite.aidl
index 12c61ba..72bab1c 100644
--- a/common/fmq/aidl/aidl_api/android.hardware.common.fmq/current/android/hardware/common/fmq/SynchronizedReadWrite.aidl
+++ b/common/fmq/aidl/aidl_api/android.hardware.common.fmq/current/android/hardware/common/fmq/SynchronizedReadWrite.aidl
@@ -32,6 +32,7 @@
 // later when a module using the interface is updated, e.g., Mainline modules.
 
 package android.hardware.common.fmq;
+/* @hide */
 @VintfStability
 enum SynchronizedReadWrite {
   EMPTY = 0,
diff --git a/common/fmq/aidl/aidl_api/android.hardware.common.fmq/current/android/hardware/common/fmq/UnsynchronizedWrite.aidl b/common/fmq/aidl/aidl_api/android.hardware.common.fmq/current/android/hardware/common/fmq/UnsynchronizedWrite.aidl
index f99528d..f308688 100644
--- a/common/fmq/aidl/aidl_api/android.hardware.common.fmq/current/android/hardware/common/fmq/UnsynchronizedWrite.aidl
+++ b/common/fmq/aidl/aidl_api/android.hardware.common.fmq/current/android/hardware/common/fmq/UnsynchronizedWrite.aidl
@@ -32,6 +32,7 @@
 // later when a module using the interface is updated, e.g., Mainline modules.
 
 package android.hardware.common.fmq;
+/* @hide */
 @VintfStability
 enum UnsynchronizedWrite {
   EMPTY = 0,
diff --git a/common/fmq/aidl/android/hardware/common/fmq/GrantorDescriptor.aidl b/common/fmq/aidl/android/hardware/common/fmq/GrantorDescriptor.aidl
index 672415e..c6ca470 100644
--- a/common/fmq/aidl/android/hardware/common/fmq/GrantorDescriptor.aidl
+++ b/common/fmq/aidl/android/hardware/common/fmq/GrantorDescriptor.aidl
@@ -18,6 +18,7 @@
 
 /*
  * Included in MQDescriptor, for use with libfmq.
+ * @hide
  */
 @VintfStability
 parcelable GrantorDescriptor {
diff --git a/common/fmq/aidl/android/hardware/common/fmq/MQDescriptor.aidl b/common/fmq/aidl/android/hardware/common/fmq/MQDescriptor.aidl
index 46622f0..f2fcb31 100644
--- a/common/fmq/aidl/android/hardware/common/fmq/MQDescriptor.aidl
+++ b/common/fmq/aidl/android/hardware/common/fmq/MQDescriptor.aidl
@@ -26,6 +26,7 @@
  * T - is used to specify the type of the payload
  * Flavor - is used to specify the type of the queue using
  * android.hardware.common.SynchronizedReadWrite or UnsynchronizedWrite
+ * @hide
  */
 @VintfStability
 parcelable MQDescriptor<T, Flavor> {
diff --git a/common/fmq/aidl/android/hardware/common/fmq/SynchronizedReadWrite.aidl b/common/fmq/aidl/android/hardware/common/fmq/SynchronizedReadWrite.aidl
index 8c33442..8b1d0a1 100644
--- a/common/fmq/aidl/android/hardware/common/fmq/SynchronizedReadWrite.aidl
+++ b/common/fmq/aidl/android/hardware/common/fmq/SynchronizedReadWrite.aidl
@@ -20,6 +20,7 @@
  * For use with android.hardware.common.MQDescriptor to specify which type of
  * queue to use. SynchronizedReadWrite is single reader, single writer, with no
  * overflow. All messages written need to be read.
+ * @hide
  */
 @VintfStability
 enum SynchronizedReadWrite {
diff --git a/common/fmq/aidl/android/hardware/common/fmq/UnsynchronizedWrite.aidl b/common/fmq/aidl/android/hardware/common/fmq/UnsynchronizedWrite.aidl
index 24c4cce..5fe48c8 100644
--- a/common/fmq/aidl/android/hardware/common/fmq/UnsynchronizedWrite.aidl
+++ b/common/fmq/aidl/android/hardware/common/fmq/UnsynchronizedWrite.aidl
@@ -20,6 +20,7 @@
  * For use with android.hardware.common.MQDescriptor to specify which type of
  * queue to use. UnsynchronizedWrite is single writer, multiple reader, with
  * overflow. If messages are not read fast enough, they can be overwritten.
+ * @hide
  */
 @VintfStability
 enum UnsynchronizedWrite {
diff --git a/health/2.0/vts/OWNERS b/health/2.0/vts/OWNERS
index 4024ec0..9f96f51 100644
--- a/health/2.0/vts/OWNERS
+++ b/health/2.0/vts/OWNERS
@@ -1,5 +1,3 @@
+# Bug component: 30545
 elsk@google.com
 sspatil@google.com
-
-# VTS team
-yim@google.com
diff --git a/keymaster/4.0/vts/functional/keymaster_hidl_hal_test.cpp b/keymaster/4.0/vts/functional/keymaster_hidl_hal_test.cpp
index 01c502c..476eed8 100644
--- a/keymaster/4.0/vts/functional/keymaster_hidl_hal_test.cpp
+++ b/keymaster/4.0/vts/functional/keymaster_hidl_hal_test.cpp
@@ -438,7 +438,7 @@
     // TODO(b/136282179): When running under VTS-on-GSI the TEE-backed
     // keymaster implementation will report YYYYMM dates instead of YYYYMMDD
     // for the BOOT_PATCH_LEVEL.
-    if (avb_verification_enabled()) {
+    if (!is_gsi()) {
         for (int i = 0; i < att_hw_enforced.size(); i++) {
             if (att_hw_enforced[i].tag == TAG_BOOT_PATCHLEVEL ||
                 att_hw_enforced[i].tag == TAG_VENDOR_PATCHLEVEL) {
diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterTypeDemuxFilterSubType.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterSubType.aidl
similarity index 97%
rename from tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterTypeDemuxFilterSubType.aidl
rename to tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterSubType.aidl
index 2aa3a89..2e2a774 100644
--- a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterTypeDemuxFilterSubType.aidl
+++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterSubType.aidl
@@ -34,7 +34,7 @@
 package android.hardware.tv.tuner;
 /* @hide */
 @VintfStability
-union DemuxFilterTypeDemuxFilterSubType {
+union DemuxFilterSubType {
   android.hardware.tv.tuner.DemuxTsFilterType tsFilterType = android.hardware.tv.tuner.DemuxTsFilterType.UNDEFINED;
   android.hardware.tv.tuner.DemuxMmtpFilterType mmtpFilterType;
   android.hardware.tv.tuner.DemuxIpFilterType ipFilterType;
diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterType.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterType.aidl
index 14f9202..b2f499d 100644
--- a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterType.aidl
+++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterType.aidl
@@ -36,5 +36,5 @@
 @VintfStability
 parcelable DemuxFilterType {
   android.hardware.tv.tuner.DemuxFilterMainType mainType = android.hardware.tv.tuner.DemuxFilterMainType.UNDEFINED;
-  android.hardware.tv.tuner.DemuxFilterTypeDemuxFilterSubType subType;
+  android.hardware.tv.tuner.DemuxFilterSubType subType;
 }
diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterTypeDemuxFilterSubType.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterSubType.aidl
similarity index 94%
rename from tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterTypeDemuxFilterSubType.aidl
rename to tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterSubType.aidl
index cf1a59c..3dfc0ae 100644
--- a/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterTypeDemuxFilterSubType.aidl
+++ b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterSubType.aidl
@@ -23,10 +23,11 @@
 import android.hardware.tv.tuner.DemuxTsFilterType;
 
 /**
+ * The different Demux Filter Sub Types.
  * @hide
  */
 @VintfStability
-union DemuxFilterTypeDemuxFilterSubType {
+union DemuxFilterSubType {
     DemuxTsFilterType tsFilterType = DemuxTsFilterType.UNDEFINED;
 
     DemuxMmtpFilterType mmtpFilterType;
diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterType.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterType.aidl
index 38348b6..f5eda60 100644
--- a/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterType.aidl
+++ b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterType.aidl
@@ -17,7 +17,7 @@
 package android.hardware.tv.tuner;
 
 import android.hardware.tv.tuner.DemuxFilterMainType;
-import android.hardware.tv.tuner.DemuxFilterTypeDemuxFilterSubType;
+import android.hardware.tv.tuner.DemuxFilterSubType;
 
 /**
  * Demux Filter Type.
@@ -27,5 +27,5 @@
 parcelable DemuxFilterType {
     DemuxFilterMainType mainType = DemuxFilterMainType.UNDEFINED;
 
-    DemuxFilterTypeDemuxFilterSubType subType;
+    DemuxFilterSubType subType;
 }
diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/ITuner.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/ITuner.aidl
index f881082..ab8b0b8 100644
--- a/tv/tuner/aidl/android/hardware/tv/tuner/ITuner.aidl
+++ b/tv/tuner/aidl/android/hardware/tv/tuner/ITuner.aidl
@@ -22,7 +22,6 @@
 import android.hardware.tv.tuner.IDescrambler;
 import android.hardware.tv.tuner.IFrontend;
 import android.hardware.tv.tuner.ILnb;
-import android.hardware.tv.tuner.FrontendDtmbCapabilities;
 
 /**
  * Top level interface to manage Frontend, Demux and Decrambler hardware
diff --git a/tv/tuner/aidl/default/Filter.cpp b/tv/tuner/aidl/default/Filter.cpp
index dd9bee3..6c4b28c 100644
--- a/tv/tuner/aidl/default/Filter.cpp
+++ b/tv/tuner/aidl/default/Filter.cpp
@@ -46,29 +46,29 @@
 
     switch (mType.mainType) {
         case DemuxFilterMainType::TS:
-            if (mType.subType.get<DemuxFilterTypeDemuxFilterSubType::Tag::tsFilterType>() ==
+            if (mType.subType.get<DemuxFilterSubType::Tag::tsFilterType>() ==
                         DemuxTsFilterType::AUDIO ||
-                mType.subType.get<DemuxFilterTypeDemuxFilterSubType::Tag::tsFilterType>() ==
+                mType.subType.get<DemuxFilterSubType::Tag::tsFilterType>() ==
                         DemuxTsFilterType::VIDEO) {
                 mIsMediaFilter = true;
             }
-            if (mType.subType.get<DemuxFilterTypeDemuxFilterSubType::Tag::tsFilterType>() ==
+            if (mType.subType.get<DemuxFilterSubType::Tag::tsFilterType>() ==
                 DemuxTsFilterType::PCR) {
                 mIsPcrFilter = true;
             }
-            if (mType.subType.get<DemuxFilterTypeDemuxFilterSubType::Tag::tsFilterType>() ==
+            if (mType.subType.get<DemuxFilterSubType::Tag::tsFilterType>() ==
                 DemuxTsFilterType::RECORD) {
                 mIsRecordFilter = true;
             }
             break;
         case DemuxFilterMainType::MMTP:
-            if (mType.subType.get<DemuxFilterTypeDemuxFilterSubType::Tag::mmtpFilterType>() ==
+            if (mType.subType.get<DemuxFilterSubType::Tag::mmtpFilterType>() ==
                         DemuxMmtpFilterType::AUDIO ||
-                mType.subType.get<DemuxFilterTypeDemuxFilterSubType::Tag::mmtpFilterType>() ==
+                mType.subType.get<DemuxFilterSubType::Tag::mmtpFilterType>() ==
                         DemuxMmtpFilterType::VIDEO) {
                 mIsMediaFilter = true;
             }
-            if (mType.subType.get<DemuxFilterTypeDemuxFilterSubType::Tag::mmtpFilterType>() ==
+            if (mType.subType.get<DemuxFilterSubType::Tag::mmtpFilterType>() ==
                 DemuxMmtpFilterType::RECORD) {
                 mIsRecordFilter = true;
             }
@@ -538,7 +538,7 @@
     std::lock_guard<std::mutex> lock(mFilterOutputLock);
     switch (mType.mainType) {
         case DemuxFilterMainType::TS:
-            switch (mType.subType.get<DemuxFilterTypeDemuxFilterSubType::Tag::tsFilterType>()) {
+            switch (mType.subType.get<DemuxFilterSubType::Tag::tsFilterType>()) {
                 case DemuxTsFilterType::UNDEFINED:
                     break;
                 case DemuxTsFilterType::SECTION:
diff --git a/tv/tuner/aidl/vts/functional/DescramblerTests.cpp b/tv/tuner/aidl/vts/functional/DescramblerTests.cpp
index e0ee391..157fa04 100644
--- a/tv/tuner/aidl/vts/functional/DescramblerTests.cpp
+++ b/tv/tuner/aidl/vts/functional/DescramblerTests.cpp
@@ -175,9 +175,9 @@
                                                                 DemuxPid& pid) {
     switch (type.mainType) {
         case DemuxFilterMainType::TS:
-            if (type.subType.get<DemuxFilterTypeDemuxFilterSubType::Tag::tsFilterType>() ==
+            if (type.subType.get<DemuxFilterSubType::Tag::tsFilterType>() ==
                         DemuxTsFilterType::AUDIO ||
-                type.subType.get<DemuxFilterTypeDemuxFilterSubType::Tag::tsFilterType>() ==
+                type.subType.get<DemuxFilterSubType::Tag::tsFilterType>() ==
                         DemuxTsFilterType::VIDEO) {
                 pid.set<DemuxPid::Tag::tPid>(settings.get<DemuxFilterSettings::Tag::ts>().tpid);
             } else {
@@ -186,9 +186,9 @@
             }
             break;
         case DemuxFilterMainType::MMTP:
-            if (type.subType.get<DemuxFilterTypeDemuxFilterSubType::Tag::mmtpFilterType>() ==
+            if (type.subType.get<DemuxFilterSubType::Tag::mmtpFilterType>() ==
                         DemuxMmtpFilterType::AUDIO ||
-                type.subType.get<DemuxFilterTypeDemuxFilterSubType::Tag::mmtpFilterType>() ==
+                type.subType.get<DemuxFilterSubType::Tag::mmtpFilterType>() ==
                         DemuxMmtpFilterType::VIDEO) {
                 pid.set<DemuxPid::Tag::mmtpPid>(
                         settings.get<DemuxFilterSettings::Tag::mmtp>().mmtpPid);
diff --git a/tv/tuner/aidl/vts/functional/VtsHalTvTunerTargetTest.h b/tv/tuner/aidl/vts/functional/VtsHalTvTunerTargetTest.h
index e5cee76..13c5a80 100644
--- a/tv/tuner/aidl/vts/functional/VtsHalTvTunerTargetTest.h
+++ b/tv/tuner/aidl/vts/functional/VtsHalTvTunerTargetTest.h
@@ -146,23 +146,23 @@
         type.mainType = static_cast<DemuxFilterMainType>(1 << bit);
         switch (type.mainType) {
             case DemuxFilterMainType::TS:
-                type.subType.set<DemuxFilterTypeDemuxFilterSubType::Tag::tsFilterType>(
+                type.subType.set<DemuxFilterSubType::Tag::tsFilterType>(
                         DemuxTsFilterType::UNDEFINED);
                 break;
             case DemuxFilterMainType::MMTP:
-                type.subType.set<DemuxFilterTypeDemuxFilterSubType::Tag::mmtpFilterType>(
+                type.subType.set<DemuxFilterSubType::Tag::mmtpFilterType>(
                         DemuxMmtpFilterType::UNDEFINED);
                 break;
             case DemuxFilterMainType::IP:
-                type.subType.set<DemuxFilterTypeDemuxFilterSubType::Tag::ipFilterType>(
+                type.subType.set<DemuxFilterSubType::Tag::ipFilterType>(
                         DemuxIpFilterType::UNDEFINED);
                 break;
             case DemuxFilterMainType::TLV:
-                type.subType.set<DemuxFilterTypeDemuxFilterSubType::Tag::tlvFilterType>(
+                type.subType.set<DemuxFilterSubType::Tag::tlvFilterType>(
                         DemuxTlvFilterType::UNDEFINED);
                 break;
             case DemuxFilterMainType::ALP:
-                type.subType.set<DemuxFilterTypeDemuxFilterSubType::Tag::alpFilterType>(
+                type.subType.set<DemuxFilterSubType::Tag::alpFilterType>(
                         DemuxAlpFilterType::UNDEFINED);
                 break;
             default:
diff --git a/tv/tuner/aidl/vts/functional/VtsHalTvTunerTestConfigurations.h b/tv/tuner/aidl/vts/functional/VtsHalTvTunerTestConfigurations.h
index 1ddb641..b4fb54f 100644
--- a/tv/tuner/aidl/vts/functional/VtsHalTvTunerTestConfigurations.h
+++ b/tv/tuner/aidl/vts/functional/VtsHalTvTunerTestConfigurations.h
@@ -119,9 +119,8 @@
     string defaultVideoFilterId = "FILTER_VIDEO_DEFAULT";
 
     filterMap[defaultVideoFilterId].type.mainType = DemuxFilterMainType::TS;
-    filterMap[defaultVideoFilterId]
-            .type.subType.set<DemuxFilterTypeDemuxFilterSubType::Tag::tsFilterType>(
-                    DemuxTsFilterType::VIDEO);
+    filterMap[defaultVideoFilterId].type.subType.set<DemuxFilterSubType::Tag::tsFilterType>(
+            DemuxTsFilterType::VIDEO);
     filterMap[defaultVideoFilterId].bufferSize = FMQ_SIZE_16M;
     filterMap[defaultVideoFilterId].settings =
             DemuxFilterSettings::make<DemuxFilterSettings::Tag::ts>();
@@ -138,9 +137,8 @@
             VideoStreamType::MPEG1);
 
     filterMap[defaultAudioFilterId].type.mainType = DemuxFilterMainType::TS;
-    filterMap[defaultAudioFilterId]
-            .type.subType.set<DemuxFilterTypeDemuxFilterSubType::Tag::tsFilterType>(
-                    DemuxTsFilterType::AUDIO);
+    filterMap[defaultAudioFilterId].type.subType.set<DemuxFilterSubType::Tag::tsFilterType>(
+            DemuxTsFilterType::AUDIO);
     filterMap[defaultAudioFilterId].bufferSize = FMQ_SIZE_16M;
     filterMap[defaultAudioFilterId].settings =
             DemuxFilterSettings::make<DemuxFilterSettings::Tag::ts>();
diff --git a/tv/tuner/config/TunerTestingConfigAidlReaderV1_0.h b/tv/tuner/config/TunerTestingConfigAidlReaderV1_0.h
index 8525b4f..2d7be9e 100644
--- a/tv/tuner/config/TunerTestingConfigAidlReaderV1_0.h
+++ b/tv/tuner/config/TunerTestingConfigAidlReaderV1_0.h
@@ -689,11 +689,11 @@
                 bool isTsSet = false;
                 switch (subType) {
                     case FilterSubTypeEnum::UNDEFINED:
-                        type.subType.set<DemuxFilterTypeDemuxFilterSubType::Tag::tsFilterType>(
+                        type.subType.set<DemuxFilterSubType::Tag::tsFilterType>(
                                 DemuxTsFilterType::UNDEFINED);
                         break;
                     case FilterSubTypeEnum::SECTION:
-                        type.subType.set<DemuxFilterTypeDemuxFilterSubType::Tag::tsFilterType>(
+                        type.subType.set<DemuxFilterSubType::Tag::tsFilterType>(
                                 DemuxTsFilterType::SECTION);
                         ts.filterSettings.set<DemuxTsFilterSettingsFilterSettings::Tag::section>(
                                 readSectionFilterSettings(filterConfig));
@@ -701,46 +701,46 @@
                         break;
                     case FilterSubTypeEnum::PES:
                         // TODO: b/182519645 support all the filter settings
-                        type.subType.set<DemuxFilterTypeDemuxFilterSubType::Tag::tsFilterType>(
+                        type.subType.set<DemuxFilterSubType::Tag::tsFilterType>(
                                 DemuxTsFilterType::PES);
                         break;
                     case FilterSubTypeEnum::TS:
-                        type.subType.set<DemuxFilterTypeDemuxFilterSubType::Tag::tsFilterType>(
+                        type.subType.set<DemuxFilterSubType::Tag::tsFilterType>(
                                 DemuxTsFilterType::TS);
                         ts.filterSettings.set<DemuxTsFilterSettingsFilterSettings::Tag::noinit>(
                                 true);
                         isTsSet = true;
                         break;
                     case FilterSubTypeEnum::PCR:
-                        type.subType.set<DemuxFilterTypeDemuxFilterSubType::Tag::tsFilterType>(
+                        type.subType.set<DemuxFilterSubType::Tag::tsFilterType>(
                                 DemuxTsFilterType::PCR);
                         ts.filterSettings.set<DemuxTsFilterSettingsFilterSettings::Tag::noinit>(
                                 true);
                         isTsSet = true;
                         break;
                     case FilterSubTypeEnum::TEMI:
-                        type.subType.set<DemuxFilterTypeDemuxFilterSubType::Tag::tsFilterType>(
+                        type.subType.set<DemuxFilterSubType::Tag::tsFilterType>(
                                 DemuxTsFilterType::TEMI);
                         ts.filterSettings.set<DemuxTsFilterSettingsFilterSettings::Tag::noinit>(
                                 true);
                         isTsSet = true;
                         break;
                     case FilterSubTypeEnum::AUDIO:
-                        type.subType.set<DemuxFilterTypeDemuxFilterSubType::Tag::tsFilterType>(
+                        type.subType.set<DemuxFilterSubType::Tag::tsFilterType>(
                                 DemuxTsFilterType::AUDIO);
                         ts.filterSettings.set<DemuxTsFilterSettingsFilterSettings::Tag::av>(
                                 readAvFilterSettings(filterConfig));
                         isTsSet = true;
                         break;
                     case FilterSubTypeEnum::VIDEO:
-                        type.subType.set<DemuxFilterTypeDemuxFilterSubType::Tag::tsFilterType>(
+                        type.subType.set<DemuxFilterSubType::Tag::tsFilterType>(
                                 DemuxTsFilterType::VIDEO);
                         ts.filterSettings.set<DemuxTsFilterSettingsFilterSettings::Tag::av>(
                                 readAvFilterSettings(filterConfig));
                         isTsSet = true;
                         break;
                     case FilterSubTypeEnum::RECORD:
-                        type.subType.set<DemuxFilterTypeDemuxFilterSubType::Tag::tsFilterType>(
+                        type.subType.set<DemuxFilterSubType::Tag::tsFilterType>(
                                 DemuxTsFilterType::RECORD);
                         ts.filterSettings.set<DemuxTsFilterSettingsFilterSettings::Tag::record>(
                                 readRecordFilterSettings(filterConfig));
@@ -766,11 +766,11 @@
                 bool isMmtpSet = false;
                 switch (subType) {
                     case FilterSubTypeEnum::UNDEFINED:
-                        type.subType.set<DemuxFilterTypeDemuxFilterSubType::Tag::mmtpFilterType>(
+                        type.subType.set<DemuxFilterSubType::Tag::mmtpFilterType>(
                                 DemuxMmtpFilterType::UNDEFINED);
                         break;
                     case FilterSubTypeEnum::SECTION:
-                        type.subType.set<DemuxFilterTypeDemuxFilterSubType::Tag::mmtpFilterType>(
+                        type.subType.set<DemuxFilterSubType::Tag::mmtpFilterType>(
                                 DemuxMmtpFilterType::SECTION);
                         mmtp.filterSettings
                                 .set<DemuxMmtpFilterSettingsFilterSettings::Tag::section>(
@@ -778,40 +778,40 @@
                         isMmtpSet = true;
                         break;
                     case FilterSubTypeEnum::PES:
-                        type.subType.set<DemuxFilterTypeDemuxFilterSubType::Tag::mmtpFilterType>(
+                        type.subType.set<DemuxFilterSubType::Tag::mmtpFilterType>(
                                 DemuxMmtpFilterType::PES);
                         // TODO: b/182519645 support all the filter settings
                         break;
                     case FilterSubTypeEnum::MMTP:
-                        type.subType.set<DemuxFilterTypeDemuxFilterSubType::Tag::mmtpFilterType>(
+                        type.subType.set<DemuxFilterSubType::Tag::mmtpFilterType>(
                                 DemuxMmtpFilterType::MMTP);
                         mmtp.filterSettings.set<DemuxMmtpFilterSettingsFilterSettings::Tag::noinit>(
                                 true);
                         isMmtpSet = true;
                         break;
                     case FilterSubTypeEnum::AUDIO:
-                        type.subType.set<DemuxFilterTypeDemuxFilterSubType::Tag::mmtpFilterType>(
+                        type.subType.set<DemuxFilterSubType::Tag::mmtpFilterType>(
                                 DemuxMmtpFilterType::AUDIO);
                         mmtp.filterSettings.set<DemuxMmtpFilterSettingsFilterSettings::Tag::av>(
                                 readAvFilterSettings(filterConfig));
                         isMmtpSet = true;
                         break;
                     case FilterSubTypeEnum::VIDEO:
-                        type.subType.set<DemuxFilterTypeDemuxFilterSubType::Tag::mmtpFilterType>(
+                        type.subType.set<DemuxFilterSubType::Tag::mmtpFilterType>(
                                 DemuxMmtpFilterType::VIDEO);
                         mmtp.filterSettings.set<DemuxMmtpFilterSettingsFilterSettings::Tag::av>(
                                 readAvFilterSettings(filterConfig));
                         isMmtpSet = true;
                         break;
                     case FilterSubTypeEnum::RECORD:
-                        type.subType.set<DemuxFilterTypeDemuxFilterSubType::Tag::mmtpFilterType>(
+                        type.subType.set<DemuxFilterSubType::Tag::mmtpFilterType>(
                                 DemuxMmtpFilterType::RECORD);
                         mmtp.filterSettings.set<DemuxMmtpFilterSettingsFilterSettings::Tag::record>(
                                 readRecordFilterSettings(filterConfig));
                         isMmtpSet = true;
                         break;
                     case FilterSubTypeEnum::DOWNLOAD:
-                        type.subType.set<DemuxFilterTypeDemuxFilterSubType::Tag::mmtpFilterType>(
+                        type.subType.set<DemuxFilterSubType::Tag::mmtpFilterType>(
                                 DemuxMmtpFilterType::DOWNLOAD);
                         // TODO: b/182519645 support all the filter settings
                         break;
@@ -834,18 +834,18 @@
                 DemuxIpFilterSettings ip;
                 switch (subType) {
                     case FilterSubTypeEnum::UNDEFINED:
-                        type.subType.set<DemuxFilterTypeDemuxFilterSubType::Tag::ipFilterType>(
+                        type.subType.set<DemuxFilterSubType::Tag::ipFilterType>(
                                 DemuxIpFilterType::UNDEFINED);
                         break;
                     case FilterSubTypeEnum::SECTION:
-                        type.subType.set<DemuxFilterTypeDemuxFilterSubType::Tag::ipFilterType>(
+                        type.subType.set<DemuxFilterSubType::Tag::ipFilterType>(
                                 DemuxIpFilterType::SECTION);
                         ip.filterSettings.set<DemuxIpFilterSettingsFilterSettings::Tag::section>(
                                 readSectionFilterSettings(filterConfig));
                         settings.set<DemuxFilterSettings::Tag::ip>(ip);
                         break;
                     case FilterSubTypeEnum::NTP:
-                        type.subType.set<DemuxFilterTypeDemuxFilterSubType::Tag::ipFilterType>(
+                        type.subType.set<DemuxFilterSubType::Tag::ipFilterType>(
                                 DemuxIpFilterType::NTP);
                         ip.filterSettings.set<DemuxIpFilterSettingsFilterSettings::Tag::noinit>(
                                 true);
@@ -860,14 +860,14 @@
                         break;
                     }
                     case FilterSubTypeEnum::IP_PAYLOAD:
-                        type.subType.set<DemuxFilterTypeDemuxFilterSubType::Tag::ipFilterType>(
+                        type.subType.set<DemuxFilterSubType::Tag::ipFilterType>(
                                 DemuxIpFilterType::IP_PAYLOAD);
                         ip.filterSettings.set<DemuxIpFilterSettingsFilterSettings::Tag::noinit>(
                                 true);
                         settings.set<DemuxFilterSettings::Tag::ip>(ip);
                         break;
                     case FilterSubTypeEnum::PAYLOAD_THROUGH:
-                        type.subType.set<DemuxFilterTypeDemuxFilterSubType::Tag::ipFilterType>(
+                        type.subType.set<DemuxFilterSubType::Tag::ipFilterType>(
                                 DemuxIpFilterType::PAYLOAD_THROUGH);
                         ip.filterSettings.set<DemuxIpFilterSettingsFilterSettings::Tag::noinit>(
                                 true);