Merge "Support AFC channel allowance feature flag"
diff --git a/audio/aidl/Android.bp b/audio/aidl/Android.bp
index e69306e..01af940 100644
--- a/audio/aidl/Android.bp
+++ b/audio/aidl/Android.bp
@@ -109,7 +109,6 @@
         "android.hardware.audio_defaults",
     ],
     srcs: [
-        "android/hardware/audio/core/AudioMode.aidl",
         "android/hardware/audio/core/AudioPatch.aidl",
         "android/hardware/audio/core/AudioRoute.aidl",
         "android/hardware/audio/core/IBluetooth.aidl",
@@ -227,6 +226,7 @@
     srcs: [
         "android/hardware/audio/effect/AcousticEchoCanceler.aidl",
         "android/hardware/audio/effect/AutomaticGainControl.aidl",
+        "android/hardware/audio/effect/AutomaticGainControlV1.aidl",
         "android/hardware/audio/effect/BassBoost.aidl",
         "android/hardware/audio/effect/Capability.aidl",
         "android/hardware/audio/effect/CommandId.aidl",
@@ -244,6 +244,7 @@
         "android/hardware/audio/effect/Parameter.aidl",
         "android/hardware/audio/effect/PresetReverb.aidl",
         "android/hardware/audio/effect/Processing.aidl",
+        "android/hardware/audio/effect/Range.aidl",
         "android/hardware/audio/effect/State.aidl",
         "android/hardware/audio/effect/VendorExtension.aidl",
         "android/hardware/audio/effect/Virtualizer.aidl",
diff --git a/audio/aidl/aidl_api/android.hardware.audio.core/current/android/hardware/audio/core/IBluetooth.aidl b/audio/aidl/aidl_api/android.hardware.audio.core/current/android/hardware/audio/core/IBluetooth.aidl
index 289c0c2..9357a15 100644
--- a/audio/aidl/aidl_api/android.hardware.audio.core/current/android/hardware/audio/core/IBluetooth.aidl
+++ b/audio/aidl/aidl_api/android.hardware.audio.core/current/android/hardware/audio/core/IBluetooth.aidl
@@ -44,10 +44,10 @@
     @nullable @utf8InCpp String debugName;
     @VintfStability
     enum Mode {
-      UNSPECIFIED = 0,
-      SCO = 1,
-      SCO_WB = 2,
-      SCO_SWB = 3,
+      UNSPECIFIED,
+      SCO,
+      SCO_WB,
+      SCO_SWB,
     }
   }
   @JavaDerive(equals=true, toString=true) @VintfStability
diff --git a/audio/aidl/aidl_api/android.hardware.audio.core/current/android/hardware/audio/core/IModule.aidl b/audio/aidl/aidl_api/android.hardware.audio.core/current/android/hardware/audio/core/IModule.aidl
index 4486b66..45217e7 100644
--- a/audio/aidl/aidl_api/android.hardware.audio.core/current/android/hardware/audio/core/IModule.aidl
+++ b/audio/aidl/aidl_api/android.hardware.audio.core/current/android/hardware/audio/core/IModule.aidl
@@ -59,7 +59,7 @@
   boolean getMicMute();
   void setMicMute(boolean mute);
   android.hardware.audio.core.MicrophoneInfo[] getMicrophones();
-  void updateAudioMode(android.hardware.audio.core.AudioMode mode);
+  void updateAudioMode(android.media.audio.common.AudioMode mode);
   void updateScreenRotation(android.hardware.audio.core.IModule.ScreenRotation rotation);
   void updateScreenState(boolean isTurnedOn);
   @nullable android.hardware.audio.core.sounddose.ISoundDose getSoundDose();
@@ -68,6 +68,12 @@
   void setVendorParameters(in android.hardware.audio.core.VendorParameter[] parameters, boolean async);
   void addDeviceEffect(int portConfigId, in android.hardware.audio.effect.IEffect effect);
   void removeDeviceEffect(int portConfigId, in android.hardware.audio.effect.IEffect effect);
+  android.media.audio.common.AudioMMapPolicyInfo[] getMmapPolicyInfos(android.media.audio.common.AudioMMapPolicyType mmapPolicyType);
+  boolean supportsVariableLatency();
+  int getAAudioMixerBurstCount();
+  int getAAudioHardwareBurstMinUsec();
+  const int DEFAULT_AAUDIO_MIXER_BURST_COUNT = 2;
+  const int DEFAULT_AAUDIO_HARDWARE_BURST_MIN_DURATION_US = 1000;
   @VintfStability
   parcelable OpenInputStreamArguments {
     int portConfigId;
diff --git a/audio/aidl/aidl_api/android.hardware.audio.core/current/android/hardware/audio/core/ITelephony.aidl b/audio/aidl/aidl_api/android.hardware.audio.core/current/android/hardware/audio/core/ITelephony.aidl
index 77063df..001d074 100644
--- a/audio/aidl/aidl_api/android.hardware.audio.core/current/android/hardware/audio/core/ITelephony.aidl
+++ b/audio/aidl/aidl_api/android.hardware.audio.core/current/android/hardware/audio/core/ITelephony.aidl
@@ -34,8 +34,8 @@
 package android.hardware.audio.core;
 @VintfStability
 interface ITelephony {
-  android.hardware.audio.core.AudioMode[] getSupportedAudioModes();
-  void switchAudioMode(android.hardware.audio.core.AudioMode mode);
+  android.media.audio.common.AudioMode[] getSupportedAudioModes();
+  void switchAudioMode(android.media.audio.common.AudioMode mode);
   android.hardware.audio.core.ITelephony.TelecomConfig setTelecomConfig(in android.hardware.audio.core.ITelephony.TelecomConfig config);
   @JavaDerive(equals=true, toString=true) @VintfStability
   parcelable TelecomConfig {
diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/AnbrBitrate.aidl b/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/AutomaticGainControlV1.aidl
similarity index 75%
copy from radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/AnbrBitrate.aidl
copy to audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/AutomaticGainControlV1.aidl
index 711ac19..ff010c6 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/AnbrBitrate.aidl
+++ b/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/AutomaticGainControlV1.aidl
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2022 The Android Open Source Project
+ * Copyright (C) 2023 The Android Open Source Project
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -31,10 +31,21 @@
 // with such a backward incompatible change, it has a high risk of breaking
 // later when a module using the interface is updated, e.g., Mainline modules.
 
-package android.hardware.radio.ims.media;
+package android.hardware.audio.effect;
 @VintfStability
-parcelable AnbrBitrate {
-  int uplinkBps;
-  int downlinkBps;
-  const int INVALID_ANBR_BITRATE = -1;
+union AutomaticGainControlV1 {
+  android.hardware.audio.effect.VendorExtension vendor;
+  int targetPeakLevelDbFs;
+  int maxCompressionGainDb;
+  boolean enableLimiter;
+  @VintfStability
+  union Id {
+    int vendorExtensionTag;
+    android.hardware.audio.effect.AutomaticGainControlV1.Tag commonTag;
+  }
+  @VintfStability
+  parcelable Capability {
+    ParcelableHolder extension;
+    android.hardware.audio.effect.Range[] ranges;
+  }
 }
diff --git a/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/NoiseSuppression.aidl b/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/NoiseSuppression.aidl
index 397f897..1cf92ef 100644
--- a/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/NoiseSuppression.aidl
+++ b/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/NoiseSuppression.aidl
@@ -50,5 +50,6 @@
     LOW,
     MEDIUM,
     HIGH,
+    VERY_HIGH,
   }
 }
diff --git a/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/Parameter.aidl b/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/Parameter.aidl
index eaa4bb1..3ba44a0 100644
--- a/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/Parameter.aidl
+++ b/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/Parameter.aidl
@@ -35,7 +35,7 @@
 @VintfStability
 union Parameter {
   android.hardware.audio.effect.Parameter.Common common;
-  android.media.audio.common.AudioDeviceDescription deviceDescription;
+  android.media.audio.common.AudioDeviceDescription[] deviceDescription;
   android.media.audio.common.AudioMode mode;
   android.media.audio.common.AudioSource source;
   android.hardware.audio.effect.Parameter.VolumeStereo volumeStereo;
diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/AnbrBitrate.aidl b/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/Range.aidl
similarity index 69%
copy from radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/AnbrBitrate.aidl
copy to audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/Range.aidl
index 711ac19..531d3a1 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/AnbrBitrate.aidl
+++ b/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/Range.aidl
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2022 The Android Open Source Project
+ * Copyright (C) 2023 The Android Open Source Project
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -31,10 +31,36 @@
 // with such a backward incompatible change, it has a high risk of breaking
 // later when a module using the interface is updated, e.g., Mainline modules.
 
-package android.hardware.radio.ims.media;
+package android.hardware.audio.effect;
 @VintfStability
-parcelable AnbrBitrate {
-  int uplinkBps;
-  int downlinkBps;
-  const int INVALID_ANBR_BITRATE = -1;
+parcelable Range {
+  int tag;
+  android.hardware.audio.effect.Range.Types types;
+  @VintfStability
+  parcelable Int {
+    int min;
+    int max;
+  }
+  @VintfStability
+  parcelable Float {
+    float min;
+    float max;
+  }
+  @VintfStability
+  parcelable Long {
+    long min;
+    long max;
+  }
+  @VintfStability
+  parcelable Byte {
+    byte min;
+    byte max;
+  }
+  @VintfStability
+  union Types {
+    android.hardware.audio.effect.Range.Int rangeInt;
+    android.hardware.audio.effect.Range.Float rangeFloat;
+    android.hardware.audio.effect.Range.Long rangeLong;
+    android.hardware.audio.effect.Range.Byte rangeByte;
+  }
 }
diff --git a/audio/aidl/android/hardware/audio/core/AudioMode.aidl b/audio/aidl/android/hardware/audio/core/AudioMode.aidl
deleted file mode 100644
index 0943a55..0000000
--- a/audio/aidl/android/hardware/audio/core/AudioMode.aidl
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright (C) 2022 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package android.hardware.audio.core;
-
-/**
- * The audio mode describes states of the audio system of the device that
- * can significantly affect the rules of audio routing, volume control, etc.
- * The audio mode is controlled by the framework, however the HAL has some
- * flexibility in the choice of modes to support, see 'IModule.updateAudioMode'.
- */
-@VintfStability
-@Backing(type="int")
-enum AudioMode {
-    /** No active calls. */
-    NORMAL = 0,
-    /** The device is playing the ringtone. */
-    RINGTONE = 1,
-    /** The call is handled by the telephony stack ("voice call"). */
-    IN_CALL = 2,
-    /** The call is handled by an application ("VoIP call"). */
-    IN_COMMUNICATION = 3,
-    /** Call screening is in progress. */
-    CALL_SCREEN = 4,
-}
diff --git a/audio/aidl/android/hardware/audio/core/IModule.aidl b/audio/aidl/android/hardware/audio/core/IModule.aidl
index 7bc1b9c..968b573 100644
--- a/audio/aidl/android/hardware/audio/core/IModule.aidl
+++ b/audio/aidl/android/hardware/audio/core/IModule.aidl
@@ -18,7 +18,6 @@
 
 import android.hardware.audio.common.SinkMetadata;
 import android.hardware.audio.common.SourceMetadata;
-import android.hardware.audio.core.AudioMode;
 import android.hardware.audio.core.AudioPatch;
 import android.hardware.audio.core.AudioRoute;
 import android.hardware.audio.core.IBluetooth;
@@ -33,6 +32,9 @@
 import android.hardware.audio.core.VendorParameter;
 import android.hardware.audio.core.sounddose.ISoundDose;
 import android.hardware.audio.effect.IEffect;
+import android.media.audio.common.AudioMMapPolicyInfo;
+import android.media.audio.common.AudioMMapPolicyType;
+import android.media.audio.common.AudioMode;
 import android.media.audio.common.AudioOffloadInfo;
 import android.media.audio.common.AudioPort;
 import android.media.audio.common.AudioPortConfig;
@@ -684,6 +686,7 @@
      * method.
      *
      * @param mode The current mode.
+     * @throws EX_ILLEGAL_ARGUMENT If the mode is out of range of valid values.
      */
     void updateAudioMode(AudioMode mode);
 
@@ -806,4 +809,55 @@
      * @throws EX_UNSUPPORTED_OPERATION If the module does not support device port effects.
      */
     void removeDeviceEffect(int portConfigId, in IEffect effect);
+
+    /**
+     * Provide information describing how aaudio MMAP is supported per queried aaudio
+     * MMAP policy type.
+     *
+     * If there are no devices that support aaudio MMAP for the queried aaudio MMAP policy
+     * type in the HAL module, it must return an empty vector. Otherwise, return a vector
+     * describing how the devices support aaudio MMAP.
+     *
+     * @param mmapPolicyType the aaudio mmap policy type to query.
+     * @return The vector with mmap policy information.
+     */
+    AudioMMapPolicyInfo[] getMmapPolicyInfos(AudioMMapPolicyType mmapPolicyType);
+
+    /**
+     * Indicates if this module supports variable latency control for instance
+     * over Bluetooth A2DP or LE Audio links.
+     *
+     * If supported, all instances of IStreamOut interface returned by this module must
+     * implement getRecommendedLatencyModes() and setLatencyMode() APIs.
+     *
+     * @return Whether the module supports variable latency control.
+     */
+    boolean supportsVariableLatency();
+
+    /**
+     * Default value for number of bursts per aaudio mixer cycle. This is a suggested value
+     * to return for the HAL module, unless it is known that a better option exists.
+     */
+    const int DEFAULT_AAUDIO_MIXER_BURST_COUNT = 2;
+    /**
+     * Get the number of bursts per aaudio mixer cycle.
+     *
+     * @return The number of burst per aaudio mixer cycle.
+     * @throw EX_UNSUPPORTED_OPERATION If the module does not support aaudio MMAP.
+     */
+    int getAAudioMixerBurstCount();
+
+    /**
+     * Default value for minimum duration in microseconds for a MMAP hardware burst. This
+     * is a suggested value to return for the HAL module, unless it is known that a better
+     * option exists.
+     */
+    const int DEFAULT_AAUDIO_HARDWARE_BURST_MIN_DURATION_US = 1000;
+    /**
+     * Get the minimum duration in microseconds for a MMAP hardware burst.
+     *
+     * @return The minimum number of microseconds for a MMAP hardware burst.
+     * @throw EX_UNSUPPORTED_OPERATION If the module does not support aaudio MMAP.
+     */
+    int getAAudioHardwareBurstMinUsec();
 }
diff --git a/audio/aidl/android/hardware/audio/core/IStreamOut.aidl b/audio/aidl/android/hardware/audio/core/IStreamOut.aidl
index b60b0fd..0e58add 100644
--- a/audio/aidl/android/hardware/audio/core/IStreamOut.aidl
+++ b/audio/aidl/android/hardware/audio/core/IStreamOut.aidl
@@ -157,7 +157,8 @@
      *
      * Implementation for this method is mandatory only on specific spatial
      * audio streams indicated by AUDIO_OUTPUT_FLAG_SPATIALIZER flag if they can
-     * be routed to a BT classic sink.
+     * be routed to a BT sinks or if the implementation indicates support
+     * on all streams via IModule.supportsVariableLatency().
      *
      * @return Currently supported latency modes.
      * @throws EX_ILLEGAL_STATE If the stream is closed.
@@ -172,7 +173,8 @@
      *
      * Implementation for this method is mandatory only on specific spatial
      * audio streams indicated by AUDIO_OUTPUT_FLAG_SPATIALIZER flag if they can
-     * be routed to a BT classic sink.
+     * be routed to a BT sinks or if the implementation indicates support
+     * on all streams via IModule.supportsVariableLatency().
      *
      * @throws EX_ILLEGAL_ARGUMENT If the specified mode is not supported.
      * @throws EX_ILLEGAL_STATE If the stream is closed.
diff --git a/audio/aidl/android/hardware/audio/core/ITelephony.aidl b/audio/aidl/android/hardware/audio/core/ITelephony.aidl
index a817032..7fc1ace 100644
--- a/audio/aidl/android/hardware/audio/core/ITelephony.aidl
+++ b/audio/aidl/android/hardware/audio/core/ITelephony.aidl
@@ -16,7 +16,7 @@
 
 package android.hardware.audio.core;
 
-import android.hardware.audio.core.AudioMode;
+import android.media.audio.common.AudioMode;
 import android.media.audio.common.Boolean;
 import android.media.audio.common.Float;
 
@@ -52,6 +52,7 @@
      *
      * @param mode The mode to switch to.
      * @throws EX_UNSUPPORTED_OPERATION If the HAL does not support the specified mode.
+     * @throws EX_ILLEGAL_ARGUMENT If the mode is out of range of valid values.
      * @throws EX_ILLEGAL_STATE If there was an error during switching.
      */
     void switchAudioMode(AudioMode mode);
diff --git a/audio/aidl/android/hardware/audio/effect/AutomaticGainControlV1.aidl b/audio/aidl/android/hardware/audio/effect/AutomaticGainControlV1.aidl
new file mode 100644
index 0000000..d6e0648
--- /dev/null
+++ b/audio/aidl/android/hardware/audio/effect/AutomaticGainControlV1.aidl
@@ -0,0 +1,82 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.audio.effect;
+
+import android.hardware.audio.effect.Range;
+import android.hardware.audio.effect.VendorExtension;
+
+/**
+ * Automatic Gain Control (AGC) is an audio pre-processor which automatically normalizes the output
+ * of the captured signal by boosting or lowering input from the microphone to match a preset level
+ * so that the output signal level is virtually constant. AGC can be used by applications where the
+ * input signal dynamic range is not important but where a constant strong capture level is desired.
+ *
+ * All parameters defined in union AutomaticGainControlV1 must be gettable and settable. The
+ * capabilities defined in AutomaticGainControlV1.Capability can only acquired with
+ * IEffect.getDescriptor() and not settable.
+ */
+@VintfStability
+union AutomaticGainControlV1 {
+    /**
+     * Effect parameter tag to identify the parameters for getParameter().
+     */
+    @VintfStability
+    union Id {
+        int vendorExtensionTag;
+        AutomaticGainControlV1.Tag commonTag;
+    }
+
+    /**
+     * Vendor AutomaticGainControlV1 implementation definition for additional parameters.
+     */
+    VendorExtension vendor;
+
+    /**
+     * Capability supported by AutomaticGainControlV1 implementation.
+     */
+    @VintfStability
+    parcelable Capability {
+        /**
+         * AutomaticGainControlV1 capability extension, vendor can use this extension in case
+         * existing capability definition not enough.
+         */
+        ParcelableHolder extension;
+        /**
+         * Supported range for parameters.
+         */
+        Range[] ranges;
+    }
+
+    /**
+     * Target peak level (or envelope) of the AGC implementation in dBFs (dB relative to full
+     * scale).
+     * Must be in range of AutomaticGainControlV1.Capability.ranges with targetPeakLevelDbFs tag.
+     */
+    int targetPeakLevelDbFs;
+    /*
+     * Sets the maximum gain the digital compression stage may apply, in dB. A higher number
+     * corresponds to greater compression, while a value of 0 will leave the signal uncompressed.
+     * Must be in range of AutomaticGainControlV1.Capability.ranges with maxCompressionGainDb tag.
+     */
+    int maxCompressionGainDb;
+    /**
+     * Enable or disable limiter.
+     * When enabled, the compression stage will hard limit the signal to the target level.
+     * Otherwise, the signal will be compressed but not limited above the target level.
+     */
+    boolean enableLimiter;
+}
diff --git a/audio/aidl/android/hardware/audio/effect/NoiseSuppression.aidl b/audio/aidl/android/hardware/audio/effect/NoiseSuppression.aidl
index 946fa87..9969a0b 100644
--- a/audio/aidl/android/hardware/audio/effect/NoiseSuppression.aidl
+++ b/audio/aidl/android/hardware/audio/effect/NoiseSuppression.aidl
@@ -62,7 +62,7 @@
      * suppression, NsConfig::SuppressionLevel::k12dB for MEDIUM, and
      * NsConfig::SuppressionLevel::k18dB for HIGH.
      */
-    @VintfStability @Backing(type="int") enum Level { LOW, MEDIUM, HIGH }
+    @VintfStability @Backing(type="int") enum Level { LOW, MEDIUM, HIGH, VERY_HIGH }
 
     /**
      * The NS level.
diff --git a/audio/aidl/android/hardware/audio/effect/Parameter.aidl b/audio/aidl/android/hardware/audio/effect/Parameter.aidl
index 1c001d2..473dfb5 100644
--- a/audio/aidl/android/hardware/audio/effect/Parameter.aidl
+++ b/audio/aidl/android/hardware/audio/effect/Parameter.aidl
@@ -120,10 +120,11 @@
     Common common;
 
     /**
-     * Used by audio framework to set the device type to effect engine.
-     * Effect must implement setParameter(device) if Flags.deviceIndication set to true.
+     * Used by audio framework to set the device type(s) to effect engine.
+     * Effect engine must apply all AudioDeviceDescription in the list.
+     * Effect must implement setParameter(deviceDescription) if Flags.deviceIndication set to true.
      */
-    AudioDeviceDescription deviceDescription;
+    AudioDeviceDescription[] deviceDescription;
     /**
      * Used by audio framework to set the audio mode to effect engine.
      * Effect must implement setParameter(mode) if Flags.audioModeIndication set to true.
diff --git a/audio/aidl/android/hardware/audio/effect/Range.aidl b/audio/aidl/android/hardware/audio/effect/Range.aidl
new file mode 100644
index 0000000..c052502
--- /dev/null
+++ b/audio/aidl/android/hardware/audio/effect/Range.aidl
@@ -0,0 +1,65 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.audio.effect;
+
+/**
+ * Define the range (min and max) of a certain field, identified by tag.
+ * Can be used by effect capabilities to define supported value ranges.
+ */
+@VintfStability
+parcelable Range {
+    /**
+     * The union tag name which the range is defined for.
+     * For example: if used in AutomaticGainControlV1.Capability, value of Range.tag could be
+     * targetLevelDbFs or compressionGainDb.
+     */
+    int tag;
+
+    @VintfStability
+    parcelable Int {
+        int min;
+        int max;
+    }
+
+    @VintfStability
+    parcelable Float {
+        float min;
+        float max;
+    }
+
+    @VintfStability
+    parcelable Long {
+        long min;
+        long max;
+    }
+
+    @VintfStability
+    parcelable Byte {
+        byte min;
+        byte max;
+    }
+
+    @VintfStability
+    union Types {
+        Int rangeInt;
+        Float rangeFloat;
+        Long rangeLong;
+        Byte rangeByte;
+    }
+
+    Types types;
+}
diff --git a/audio/aidl/common/include/Utils.h b/audio/aidl/common/include/Utils.h
index 8f0c986..2aaa781 100644
--- a/audio/aidl/common/include/Utils.h
+++ b/audio/aidl/common/include/Utils.h
@@ -16,6 +16,8 @@
 
 #pragma once
 
+#include <algorithm>
+#include <array>
 #include <initializer_list>
 #include <type_traits>
 
@@ -23,11 +25,22 @@
 #include <aidl/android/media/audio/common/AudioDeviceType.h>
 #include <aidl/android/media/audio/common/AudioFormatDescription.h>
 #include <aidl/android/media/audio/common/AudioInputFlags.h>
+#include <aidl/android/media/audio/common/AudioMode.h>
 #include <aidl/android/media/audio/common/AudioOutputFlags.h>
 #include <aidl/android/media/audio/common/PcmType.h>
 
 namespace android::hardware::audio::common {
 
+// Some values are reserved for use by the system code only.
+// HALs must not accept or emit values outside from the provided list.
+constexpr std::array<::aidl::android::media::audio::common::AudioMode, 5> kValidAudioModes = {
+        ::aidl::android::media::audio::common::AudioMode::NORMAL,
+        ::aidl::android::media::audio::common::AudioMode::RINGTONE,
+        ::aidl::android::media::audio::common::AudioMode::IN_CALL,
+        ::aidl::android::media::audio::common::AudioMode::IN_COMMUNICATION,
+        ::aidl::android::media::audio::common::AudioMode::CALL_SCREEN,
+};
+
 constexpr size_t getPcmSampleSizeInBytes(::aidl::android::media::audio::common::PcmType pcm) {
     using ::aidl::android::media::audio::common::PcmType;
     switch (pcm) {
@@ -91,6 +104,11 @@
            device == ::aidl::android::media::audio::common::AudioDeviceType::OUT_TELEPHONY_TX;
 }
 
+constexpr bool isValidAudioMode(::aidl::android::media::audio::common::AudioMode mode) {
+    return std::find(kValidAudioModes.begin(), kValidAudioModes.end(), mode) !=
+           kValidAudioModes.end();
+}
+
 // The helper functions defined below are only applicable to the case when an enum type
 // specifies zero-based bit positions, not bit masks themselves. This is why instantiation
 // is restricted to certain enum types.
diff --git a/audio/aidl/default/Android.bp b/audio/aidl/default/Android.bp
index 1e6785f..95043f7 100644
--- a/audio/aidl/default/Android.bp
+++ b/audio/aidl/default/Android.bp
@@ -69,6 +69,7 @@
         "Module.cpp",
         "SoundDose.cpp",
         "Stream.cpp",
+        "StreamStub.cpp",
         "Telephony.cpp",
     ],
     generated_sources: [
@@ -163,6 +164,7 @@
         "libloudnessenhanceraidl",
         "libnssw",
         "libpresetreverbsw",
+        "libreverbaidl",
         "libtinyxml2",
         "libvirtualizersw",
         "libvisualizeraidl",
diff --git a/audio/aidl/default/Configuration.cpp b/audio/aidl/default/Configuration.cpp
index 6d5357b..854c7f3 100644
--- a/audio/aidl/default/Configuration.cpp
+++ b/audio/aidl/default/Configuration.cpp
@@ -76,6 +76,11 @@
                                     std::string connection = "") {
     AudioPortDeviceExt deviceExt;
     deviceExt.device.type.type = devType;
+    if (devType == AudioDeviceType::IN_MICROPHONE && connection.empty()) {
+        deviceExt.device.address = "bottom";
+    } else if (devType == AudioDeviceType::IN_MICROPHONE_BACK && connection.empty()) {
+        deviceExt.device.address = "back";
+    }
     deviceExt.device.type.connection = std::move(connection);
     deviceExt.flags = flags;
     return AudioPortExt::make<AudioPortExt::Tag::device>(deviceExt);
@@ -393,4 +398,73 @@
     return std::make_unique<Configuration>(configuration);
 }
 
+// Usb configuration:
+//
+// Device ports:
+//  * "USB Headset Out", OUT_HEADSET, CONNECTION_USB
+//    - no profiles specified
+//  * "USB Headset In", IN_HEADSET, CONNECTION_USB
+//    - no profiles specified
+//
+// Mix ports:
+//  * "usb_headset output", 1 max open, 1 max active stream
+//    - no profiles specified
+//  * "usb_headset input", 1 max open, 1 max active stream
+//    - no profiles specified
+//
+// Profiles for device port connected state:
+//  * USB Headset Out":
+//    - profile PCM 16-bit; MONO, STEREO, INDEX_MASK_1, INDEX_MASK_2; 44100, 48000
+//    - profile PCM 24-bit; MONO, STEREO, INDEX_MASK_1, INDEX_MASK_2; 44100, 48000
+//  * USB Headset In":
+//    - profile PCM 16-bit; MONO, STEREO, INDEX_MASK_1, INDEX_MASK_2; 44100, 48000
+//    - profile PCM 24-bit; MONO, STEREO, INDEX_MASK_1, INDEX_MASK_2; 44100, 48000
+//
+std::unique_ptr<Configuration> getUsbConfiguration() {
+    static const Configuration configuration = []() {
+        const std::vector<AudioProfile> standardPcmAudioProfiles = {
+                createProfile(PcmType::INT_16_BIT,
+                              {AudioChannelLayout::LAYOUT_MONO, AudioChannelLayout::LAYOUT_STEREO,
+                               AudioChannelLayout::INDEX_MASK_1, AudioChannelLayout::INDEX_MASK_2},
+                              {44100, 48000}),
+                createProfile(PcmType::INT_24_BIT,
+                              {AudioChannelLayout::LAYOUT_MONO, AudioChannelLayout::LAYOUT_STEREO,
+                               AudioChannelLayout::INDEX_MASK_1, AudioChannelLayout::INDEX_MASK_2},
+                              {44100, 48000})};
+        Configuration c;
+
+        // Device ports
+
+        AudioPort usbOutHeadset =
+                createPort(c.nextPortId++, "USB Headset Out", 0, false,
+                           createDeviceExt(AudioDeviceType::OUT_HEADSET, 0,
+                                           AudioDeviceDescription::CONNECTION_USB));
+        c.ports.push_back(usbOutHeadset);
+        c.connectedProfiles[usbOutHeadset.id] = standardPcmAudioProfiles;
+
+        AudioPort usbInHeadset =
+                createPort(c.nextPortId++, "USB Headset In", 0, true,
+                           createDeviceExt(AudioDeviceType::IN_HEADSET, 0,
+                                           AudioDeviceDescription::CONNECTION_USB));
+        c.ports.push_back(usbInHeadset);
+        c.connectedProfiles[usbInHeadset.id] = standardPcmAudioProfiles;
+
+        // Mix ports
+
+        AudioPort usbHeadsetOutMix =
+                createPort(c.nextPortId++, "usb_headset output", 0, false, createPortMixExt(1, 1));
+        c.ports.push_back(usbHeadsetOutMix);
+
+        AudioPort usbHeadsetInMix =
+                createPort(c.nextPortId++, "usb_headset input", 0, true, createPortMixExt(1, 1));
+        c.ports.push_back(usbHeadsetInMix);
+
+        c.routes.push_back(createRoute({usbHeadsetOutMix}, usbOutHeadset));
+        c.routes.push_back(createRoute({usbInHeadset}, usbHeadsetInMix));
+
+        return c;
+    }();
+    return std::make_unique<Configuration>(configuration);
+}
+
 }  // namespace aidl::android::hardware::audio::core::internal
diff --git a/audio/aidl/default/EffectFactory.cpp b/audio/aidl/default/EffectFactory.cpp
index 3b40ae0..5cd87fd 100644
--- a/audio/aidl/default/EffectFactory.cpp
+++ b/audio/aidl/default/EffectFactory.cpp
@@ -165,7 +165,7 @@
     return status;
 }
 
-void Factory::openEffectLibrary(const AudioUuid& impl, const std::string& libName) {
+bool Factory::openEffectLibrary(const AudioUuid& impl, const std::string& libName) {
     std::function<void(void*)> dlClose = [](void* handle) -> void {
         if (handle && dlclose(handle)) {
             LOG(ERROR) << "dlclose failed " << dlerror();
@@ -176,7 +176,7 @@
             std::unique_ptr<void, decltype(dlClose)>{dlopen(libName.c_str(), RTLD_LAZY), dlClose};
     if (!libHandle) {
         LOG(ERROR) << __func__ << ": dlopen failed, err: " << dlerror();
-        return;
+        return false;
     }
 
     LOG(INFO) << __func__ << " dlopen lib:" << libName << "\nimpl:" << impl.toString()
@@ -186,6 +186,7 @@
             {impl,
              std::make_tuple(std::move(libHandle),
                              std::unique_ptr<struct effect_dl_interface_s>(interface), libName)});
+    return true;
 }
 
 void Factory::createIdentityWithConfig(const EffectConfig::LibraryUuid& configLib,
@@ -201,8 +202,9 @@
         LOG(DEBUG) << __func__ << ": typeUuid " << id.type.toString() << "\nimplUuid "
                    << id.uuid.toString() << " proxyUuid "
                    << (proxyUuid.has_value() ? proxyUuid->toString() : "null");
-        openEffectLibrary(id.uuid, path->second);
-        mIdentitySet.insert(std::move(id));
+        if (openEffectLibrary(id.uuid, path->second)) {
+            mIdentitySet.insert(std::move(id));
+        }
     } else {
         LOG(ERROR) << __func__ << ": library " << libName << " not exist!";
         return;
diff --git a/audio/aidl/default/EffectImpl.cpp b/audio/aidl/default/EffectImpl.cpp
index b24ca63..403a4b9 100644
--- a/audio/aidl/default/EffectImpl.cpp
+++ b/audio/aidl/default/EffectImpl.cpp
@@ -49,7 +49,6 @@
     auto context = createContext(common);
     RETURN_IF(!context, EX_NULL_POINTER, "createContextFailed");
 
-    RETURN_IF_ASTATUS_NOT_OK(setParameterCommon(common), "setCommParamErr");
     if (specific.has_value()) {
         RETURN_IF_ASTATUS_NOT_OK(setParameterSpecific(specific.value()), "setSpecParamErr");
     }
diff --git a/audio/aidl/default/Module.cpp b/audio/aidl/default/Module.cpp
index 13b04cd..82d1ef8 100644
--- a/audio/aidl/default/Module.cpp
+++ b/audio/aidl/default/Module.cpp
@@ -28,6 +28,7 @@
 #include "core-impl/Bluetooth.h"
 #include "core-impl/Module.h"
 #include "core-impl/SoundDose.h"
+#include "core-impl/StreamStub.h"
 #include "core-impl/Telephony.h"
 #include "core-impl/utils.h"
 
@@ -40,6 +41,10 @@
 using aidl::android::media::audio::common::AudioFormatType;
 using aidl::android::media::audio::common::AudioInputFlags;
 using aidl::android::media::audio::common::AudioIoFlags;
+using aidl::android::media::audio::common::AudioMMapPolicy;
+using aidl::android::media::audio::common::AudioMMapPolicyInfo;
+using aidl::android::media::audio::common::AudioMMapPolicyType;
+using aidl::android::media::audio::common::AudioMode;
 using aidl::android::media::audio::common::AudioOffloadInfo;
 using aidl::android::media::audio::common::AudioOutputFlags;
 using aidl::android::media::audio::common::AudioPort;
@@ -51,6 +56,7 @@
 using aidl::android::media::audio::common::PcmType;
 using android::hardware::audio::common::getFrameSizeInBytes;
 using android::hardware::audio::common::isBitPositionFlagSet;
+using android::hardware::audio::common::isValidAudioMode;
 
 namespace aidl::android::hardware::audio::core {
 
@@ -102,9 +108,10 @@
     erase_all_values(mPatches, std::set<int32_t>{patchId});
 }
 
-ndk::ScopedAStatus Module::createStreamContext(int32_t in_portConfigId, int64_t in_bufferSizeFrames,
-                                               std::shared_ptr<IStreamCallback> asyncCallback,
-                                               StreamContext* out_context) {
+ndk::ScopedAStatus Module::createStreamContext(
+        int32_t in_portConfigId, int64_t in_bufferSizeFrames,
+        std::shared_ptr<IStreamCallback> asyncCallback,
+        std::shared_ptr<IStreamOutEventCallback> outEventCallback, StreamContext* out_context) {
     if (in_bufferSizeFrames <= 0) {
         LOG(ERROR) << __func__ << ": non-positive buffer size " << in_bufferSizeFrames;
         return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT);
@@ -147,7 +154,7 @@
                 std::make_unique<StreamContext::ReplyMQ>(1, true /*configureEventFlagWord*/),
                 portConfigIt->format.value(), portConfigIt->channelMask.value(),
                 std::make_unique<StreamContext::DataMQ>(frameSize * in_bufferSizeFrames),
-                asyncCallback, params);
+                asyncCallback, outEventCallback, params);
         if (temp.isValid()) {
             *out_context = std::move(temp);
         } else {
@@ -252,6 +259,8 @@
             case Type::R_SUBMIX:
                 mConfig = std::move(internal::getRSubmixConfiguration());
                 break;
+            case Type::USB:
+                mConfig = std::move(internal::getUsbConfiguration());
         }
     }
     return *mConfig;
@@ -545,14 +554,15 @@
     }
     StreamContext context;
     if (auto status = createStreamContext(in_args.portConfigId, in_args.bufferSizeFrames, nullptr,
-                                          &context);
+                                          nullptr, &context);
         !status.isOk()) {
         return status;
     }
     context.fillDescriptor(&_aidl_return->desc);
     std::shared_ptr<StreamIn> stream;
-    if (auto status = StreamIn::createInstance(in_args.sinkMetadata, std::move(context),
-                                               mConfig->microphones, &stream);
+    // TODO: Add a mapping from module instance names to a corresponding 'createInstance'.
+    if (auto status = StreamInStub::createInstance(in_args.sinkMetadata, std::move(context),
+                                                   mConfig->microphones, &stream);
         !status.isOk()) {
         return status;
     }
@@ -598,14 +608,16 @@
     }
     StreamContext context;
     if (auto status = createStreamContext(in_args.portConfigId, in_args.bufferSizeFrames,
-                                          isNonBlocking ? in_args.callback : nullptr, &context);
+                                          isNonBlocking ? in_args.callback : nullptr,
+                                          in_args.eventCallback, &context);
         !status.isOk()) {
         return status;
     }
     context.fillDescriptor(&_aidl_return->desc);
     std::shared_ptr<StreamOut> stream;
-    if (auto status = StreamOut::createInstance(in_args.sourceMetadata, std::move(context),
-                                                in_args.offloadInfo, &stream);
+    // TODO: Add a mapping from module instance names to a corresponding 'createInstance'.
+    if (auto status = StreamOutStub::createInstance(in_args.sourceMetadata, std::move(context),
+                                                    in_args.offloadInfo, &stream);
         !status.isOk()) {
         return status;
     }
@@ -947,6 +959,10 @@
 }
 
 ndk::ScopedAStatus Module::updateAudioMode(AudioMode in_mode) {
+    if (!isValidAudioMode(in_mode)) {
+        LOG(ERROR) << __func__ << ": invalid mode " << toString(in_mode);
+        return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT);
+    }
     // No checks for supported audio modes here, it's an informative notification.
     LOG(DEBUG) << __func__ << ": " << toString(in_mode);
     return ndk::ScopedAStatus::ok();
@@ -1069,4 +1085,109 @@
     return ndk::ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION);
 }
 
+ndk::ScopedAStatus Module::getMmapPolicyInfos(AudioMMapPolicyType mmapPolicyType,
+                                              std::vector<AudioMMapPolicyInfo>* _aidl_return) {
+    LOG(DEBUG) << __func__ << ": mmap policy type " << toString(mmapPolicyType);
+    std::set<int32_t> mmapSinks;
+    std::set<int32_t> mmapSources;
+    auto& ports = getConfig().ports;
+    for (const auto& port : ports) {
+        if (port.flags.getTag() == AudioIoFlags::Tag::input &&
+            isBitPositionFlagSet(port.flags.get<AudioIoFlags::Tag::input>(),
+                                 AudioInputFlags::MMAP_NOIRQ)) {
+            mmapSinks.insert(port.id);
+        } else if (port.flags.getTag() == AudioIoFlags::Tag::output &&
+                   isBitPositionFlagSet(port.flags.get<AudioIoFlags::Tag::output>(),
+                                        AudioOutputFlags::MMAP_NOIRQ)) {
+            mmapSources.insert(port.id);
+        }
+    }
+    for (const auto& route : getConfig().routes) {
+        if (mmapSinks.count(route.sinkPortId) != 0) {
+            // The sink is a mix port, add the sources if they are device ports.
+            for (int sourcePortId : route.sourcePortIds) {
+                auto sourcePortIt = findById<AudioPort>(ports, sourcePortId);
+                if (sourcePortIt == ports.end()) {
+                    // This must not happen
+                    LOG(ERROR) << __func__ << ": port id " << sourcePortId << " cannot be found";
+                    continue;
+                }
+                if (sourcePortIt->ext.getTag() != AudioPortExt::Tag::device) {
+                    // The source is not a device port, skip
+                    continue;
+                }
+                AudioMMapPolicyInfo policyInfo;
+                policyInfo.device = sourcePortIt->ext.get<AudioPortExt::Tag::device>().device;
+                // Always return AudioMMapPolicy.AUTO if the device supports mmap for
+                // default implementation.
+                policyInfo.mmapPolicy = AudioMMapPolicy::AUTO;
+                _aidl_return->push_back(policyInfo);
+            }
+        } else {
+            auto sinkPortIt = findById<AudioPort>(ports, route.sinkPortId);
+            if (sinkPortIt == ports.end()) {
+                // This must not happen
+                LOG(ERROR) << __func__ << ": port id " << route.sinkPortId << " cannot be found";
+                continue;
+            }
+            if (sinkPortIt->ext.getTag() != AudioPortExt::Tag::device) {
+                // The sink is not a device port, skip
+                continue;
+            }
+            if (count_any(mmapSources, route.sourcePortIds)) {
+                AudioMMapPolicyInfo policyInfo;
+                policyInfo.device = sinkPortIt->ext.get<AudioPortExt::Tag::device>().device;
+                // Always return AudioMMapPolicy.AUTO if the device supports mmap for
+                // default implementation.
+                policyInfo.mmapPolicy = AudioMMapPolicy::AUTO;
+                _aidl_return->push_back(policyInfo);
+            }
+        }
+    }
+    return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus Module::supportsVariableLatency(bool* _aidl_return) {
+    LOG(DEBUG) << __func__;
+    *_aidl_return = false;
+    return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus Module::getAAudioMixerBurstCount(int32_t* _aidl_return) {
+    if (!isMmapSupported()) {
+        LOG(DEBUG) << __func__ << ": mmap is not supported ";
+        return ndk::ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION);
+    }
+    *_aidl_return = DEFAULT_AAUDIO_MIXER_BURST_COUNT;
+    LOG(DEBUG) << __func__ << ": returning " << *_aidl_return;
+    return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus Module::getAAudioHardwareBurstMinUsec(int32_t* _aidl_return) {
+    if (!isMmapSupported()) {
+        LOG(DEBUG) << __func__ << ": mmap is not supported ";
+        return ndk::ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION);
+    }
+    *_aidl_return = DEFAULT_AAUDIO_HARDWARE_BURST_MIN_DURATION_US;
+    LOG(DEBUG) << __func__ << ": returning " << *_aidl_return;
+    return ndk::ScopedAStatus::ok();
+}
+
+bool Module::isMmapSupported() {
+    if (mIsMmapSupported.has_value()) {
+        return mIsMmapSupported.value();
+    }
+    std::vector<AudioMMapPolicyInfo> mmapPolicyInfos;
+    if (!getMmapPolicyInfos(AudioMMapPolicyType::DEFAULT, &mmapPolicyInfos).isOk()) {
+        mIsMmapSupported = false;
+    } else {
+        mIsMmapSupported =
+                std::find_if(mmapPolicyInfos.begin(), mmapPolicyInfos.end(), [](const auto& info) {
+                    return info.mmapPolicy == AudioMMapPolicy::AUTO ||
+                           info.mmapPolicy == AudioMMapPolicy::ALWAYS;
+                }) != mmapPolicyInfos.end();
+    }
+    return mIsMmapSupported.value();
+}
+
 }  // namespace aidl::android::hardware::audio::core
diff --git a/audio/aidl/default/Stream.cpp b/audio/aidl/default/Stream.cpp
index 0520cba..25814e4 100644
--- a/audio/aidl/default/Stream.cpp
+++ b/audio/aidl/default/Stream.cpp
@@ -85,16 +85,19 @@
     if (mCommandMQ == nullptr) return "Command MQ is null";
     if (mReplyMQ == nullptr) return "Reply MQ is null";
     if (mDataMQ == nullptr) return "Data MQ is null";
-    if (sizeof(decltype(mDataBuffer)::element_type) != mDataMQ->getQuantumSize()) {
+    if (sizeof(DataBufferElement) != mDataMQ->getQuantumSize()) {
         return "Unexpected Data MQ quantum size: " + std::to_string(mDataMQ->getQuantumSize());
     }
     mDataBufferSize = mDataMQ->getQuantumCount() * mDataMQ->getQuantumSize();
-    mDataBuffer.reset(new (std::nothrow) int8_t[mDataBufferSize]);
+    mDataBuffer.reset(new (std::nothrow) DataBufferElement[mDataBufferSize]);
     if (mDataBuffer == nullptr) {
         return "Failed to allocate data buffer for element count " +
                std::to_string(mDataMQ->getQuantumCount()) +
                ", size in bytes: " + std::to_string(mDataBufferSize);
     }
+    if (::android::status_t status = mDriver->init(); status != STATUS_OK) {
+        return "Failed to initialize the driver: " + std::to_string(status);
+    }
     return "";
 }
 
@@ -191,46 +194,59 @@
             }
             break;
         case Tag::drain:
-            if (command.get<Tag::drain>() == StreamDescriptor::DrainMode::DRAIN_UNSPECIFIED) {
+            if (const auto mode = command.get<Tag::drain>();
+                mode == StreamDescriptor::DrainMode::DRAIN_UNSPECIFIED) {
                 if (mState == StreamDescriptor::State::ACTIVE) {
-                    usleep(1000);  // Simulate a blocking call into the driver.
-                    populateReply(&reply, mIsConnected);
-                    // Can switch the state to ERROR if a driver error occurs.
-                    mState = StreamDescriptor::State::DRAINING;
+                    if (::android::status_t status = mDriver->drain(mode);
+                        status == ::android::OK) {
+                        populateReply(&reply, mIsConnected);
+                        mState = StreamDescriptor::State::DRAINING;
+                    } else {
+                        LOG(ERROR) << __func__ << ": drain failed: " << status;
+                        mState = StreamDescriptor::State::ERROR;
+                    }
                 } else {
                     populateReplyWrongState(&reply, command);
                 }
             } else {
-                LOG(WARNING) << __func__
-                             << ": invalid drain mode: " << toString(command.get<Tag::drain>());
+                LOG(WARNING) << __func__ << ": invalid drain mode: " << toString(mode);
             }
             break;
         case Tag::standby:
             if (mState == StreamDescriptor::State::IDLE) {
-                usleep(1000);  // Simulate a blocking call into the driver.
-                populateReply(&reply, mIsConnected);
-                // Can switch the state to ERROR if a driver error occurs.
-                mState = StreamDescriptor::State::STANDBY;
+                if (::android::status_t status = mDriver->standby(); status == ::android::OK) {
+                    populateReply(&reply, mIsConnected);
+                    mState = StreamDescriptor::State::STANDBY;
+                } else {
+                    LOG(ERROR) << __func__ << ": standby failed: " << status;
+                    mState = StreamDescriptor::State::ERROR;
+                }
             } else {
                 populateReplyWrongState(&reply, command);
             }
             break;
         case Tag::pause:
             if (mState == StreamDescriptor::State::ACTIVE) {
-                usleep(1000);  // Simulate a blocking call into the driver.
-                populateReply(&reply, mIsConnected);
-                // Can switch the state to ERROR if a driver error occurs.
-                mState = StreamDescriptor::State::PAUSED;
+                if (::android::status_t status = mDriver->pause(); status == ::android::OK) {
+                    populateReply(&reply, mIsConnected);
+                    mState = StreamDescriptor::State::PAUSED;
+                } else {
+                    LOG(ERROR) << __func__ << ": pause failed: " << status;
+                    mState = StreamDescriptor::State::ERROR;
+                }
             } else {
                 populateReplyWrongState(&reply, command);
             }
             break;
         case Tag::flush:
             if (mState == StreamDescriptor::State::PAUSED) {
-                usleep(1000);  // Simulate a blocking call into the driver.
-                populateReply(&reply, mIsConnected);
-                // Can switch the state to ERROR if a driver error occurs.
-                mState = StreamDescriptor::State::STANDBY;
+                if (::android::status_t status = mDriver->flush(); status == ::android::OK) {
+                    populateReply(&reply, mIsConnected);
+                    mState = StreamDescriptor::State::STANDBY;
+                } else {
+                    LOG(ERROR) << __func__ << ": flush failed: " << status;
+                    mState = StreamDescriptor::State::ERROR;
+                }
             } else {
                 populateReplyWrongState(&reply, command);
             }
@@ -247,33 +263,39 @@
 }
 
 bool StreamInWorkerLogic::read(size_t clientSize, StreamDescriptor::Reply* reply) {
-    // Can switch the state to ERROR if a driver error occurs.
     const size_t byteCount = std::min({clientSize, mDataMQ->availableToWrite(), mDataBufferSize});
     const bool isConnected = mIsConnected;
+    size_t actualFrameCount = 0;
     bool fatal = false;
-    // Simulate reading of data, or provide zeroes if the stream is not connected.
-    for (size_t i = 0; i < byteCount; ++i) {
-        using buffer_type = decltype(mDataBuffer)::element_type;
-        constexpr int kBufferValueRange = std::numeric_limits<buffer_type>::max() -
-                                          std::numeric_limits<buffer_type>::min() + 1;
-        mDataBuffer[i] = isConnected ? (std::rand() % kBufferValueRange) +
-                                               std::numeric_limits<buffer_type>::min()
-                                     : 0;
+    int32_t latency = Module::kLatencyMs;
+    if (isConnected) {
+        if (::android::status_t status = mDriver->transfer(
+                    mDataBuffer.get(), byteCount / mFrameSize, &actualFrameCount, &latency);
+            status != ::android::OK) {
+            fatal = true;
+            LOG(ERROR) << __func__ << ": read failed: " << status;
+        }
+    } else {
+        usleep(3000);  // Simulate blocking transfer delay.
+        for (size_t i = 0; i < byteCount; ++i) mDataBuffer[i] = 0;
+        actualFrameCount = byteCount / mFrameSize;
     }
-    usleep(3000);  // Simulate a blocking call into the driver.
-    // Set 'fatal = true' if a driver error occurs.
-    if (bool success = byteCount > 0 ? mDataMQ->write(&mDataBuffer[0], byteCount) : true; success) {
-        LOG(DEBUG) << __func__ << ": writing of " << byteCount << " bytes into data MQ"
+    const size_t actualByteCount = actualFrameCount * mFrameSize;
+    if (bool success =
+                actualByteCount > 0 ? mDataMQ->write(&mDataBuffer[0], actualByteCount) : true;
+        success) {
+        LOG(DEBUG) << __func__ << ": writing of " << actualByteCount << " bytes into data MQ"
                    << " succeeded; connected? " << isConnected;
         // Frames are provided and counted regardless of connection status.
-        reply->fmqByteCount += byteCount;
-        mFrameCount += byteCount / mFrameSize;
+        reply->fmqByteCount += actualByteCount;
+        mFrameCount += actualFrameCount;
         populateReply(reply, isConnected);
     } else {
-        LOG(WARNING) << __func__ << ": writing of " << byteCount << " bytes of data to MQ failed";
+        LOG(WARNING) << __func__ << ": writing of " << actualByteCount
+                     << " bytes of data to MQ failed";
         reply->status = STATUS_NOT_ENOUGH_DATA;
     }
-    reply->latencyMs = Module::kLatencyMs;
+    reply->latencyMs = latency;
     return !fatal;
 }
 
@@ -395,17 +417,22 @@
             }
             break;
         case Tag::drain:
-            if (command.get<Tag::drain>() == StreamDescriptor::DrainMode::DRAIN_ALL ||
-                command.get<Tag::drain>() == StreamDescriptor::DrainMode::DRAIN_EARLY_NOTIFY) {
+            if (const auto mode = command.get<Tag::drain>();
+                mode == StreamDescriptor::DrainMode::DRAIN_ALL ||
+                mode == StreamDescriptor::DrainMode::DRAIN_EARLY_NOTIFY) {
                 if (mState == StreamDescriptor::State::ACTIVE ||
                     mState == StreamDescriptor::State::TRANSFERRING) {
-                    usleep(1000);  // Simulate a blocking call into the driver.
-                    populateReply(&reply, mIsConnected);
-                    // Can switch the state to ERROR if a driver error occurs.
-                    if (mState == StreamDescriptor::State::ACTIVE && mForceSynchronousDrain) {
-                        mState = StreamDescriptor::State::IDLE;
+                    if (::android::status_t status = mDriver->drain(mode);
+                        status == ::android::OK) {
+                        populateReply(&reply, mIsConnected);
+                        if (mState == StreamDescriptor::State::ACTIVE && mForceSynchronousDrain) {
+                            mState = StreamDescriptor::State::IDLE;
+                        } else {
+                            switchToTransientState(StreamDescriptor::State::DRAINING);
+                        }
                     } else {
-                        switchToTransientState(StreamDescriptor::State::DRAINING);
+                        LOG(ERROR) << __func__ << ": drain failed: " << status;
+                        mState = StreamDescriptor::State::ERROR;
                     }
                 } else if (mState == StreamDescriptor::State::TRANSFER_PAUSED) {
                     mState = StreamDescriptor::State::DRAIN_PAUSED;
@@ -414,46 +441,58 @@
                     populateReplyWrongState(&reply, command);
                 }
             } else {
-                LOG(WARNING) << __func__
-                             << ": invalid drain mode: " << toString(command.get<Tag::drain>());
+                LOG(WARNING) << __func__ << ": invalid drain mode: " << toString(mode);
             }
             break;
         case Tag::standby:
             if (mState == StreamDescriptor::State::IDLE) {
-                usleep(1000);  // Simulate a blocking call into the driver.
-                populateReply(&reply, mIsConnected);
-                // Can switch the state to ERROR if a driver error occurs.
-                mState = StreamDescriptor::State::STANDBY;
+                if (::android::status_t status = mDriver->standby(); status == ::android::OK) {
+                    populateReply(&reply, mIsConnected);
+                    mState = StreamDescriptor::State::STANDBY;
+                } else {
+                    LOG(ERROR) << __func__ << ": standby failed: " << status;
+                    mState = StreamDescriptor::State::ERROR;
+                }
             } else {
                 populateReplyWrongState(&reply, command);
             }
             break;
         case Tag::pause: {
-            bool commandAccepted = true;
+            std::optional<StreamDescriptor::State> nextState;
             switch (mState) {
                 case StreamDescriptor::State::ACTIVE:
-                    mState = StreamDescriptor::State::PAUSED;
+                    nextState = StreamDescriptor::State::PAUSED;
                     break;
                 case StreamDescriptor::State::DRAINING:
-                    mState = StreamDescriptor::State::DRAIN_PAUSED;
+                    nextState = StreamDescriptor::State::DRAIN_PAUSED;
                     break;
                 case StreamDescriptor::State::TRANSFERRING:
-                    mState = StreamDescriptor::State::TRANSFER_PAUSED;
+                    nextState = StreamDescriptor::State::TRANSFER_PAUSED;
                     break;
                 default:
                     populateReplyWrongState(&reply, command);
-                    commandAccepted = false;
             }
-            if (commandAccepted) {
-                populateReply(&reply, mIsConnected);
+            if (nextState.has_value()) {
+                if (::android::status_t status = mDriver->pause(); status == ::android::OK) {
+                    populateReply(&reply, mIsConnected);
+                    mState = nextState.value();
+                } else {
+                    LOG(ERROR) << __func__ << ": pause failed: " << status;
+                    mState = StreamDescriptor::State::ERROR;
+                }
             }
         } break;
         case Tag::flush:
             if (mState == StreamDescriptor::State::PAUSED ||
                 mState == StreamDescriptor::State::DRAIN_PAUSED ||
                 mState == StreamDescriptor::State::TRANSFER_PAUSED) {
-                populateReply(&reply, mIsConnected);
-                mState = StreamDescriptor::State::IDLE;
+                if (::android::status_t status = mDriver->flush(); status == ::android::OK) {
+                    populateReply(&reply, mIsConnected);
+                    mState = StreamDescriptor::State::IDLE;
+                } else {
+                    LOG(ERROR) << __func__ << ": flush failed: " << status;
+                    mState = StreamDescriptor::State::ERROR;
+                }
             } else {
                 populateReplyWrongState(&reply, command);
             }
@@ -472,6 +511,7 @@
 bool StreamOutWorkerLogic::write(size_t clientSize, StreamDescriptor::Reply* reply) {
     const size_t readByteCount = mDataMQ->availableToRead();
     bool fatal = false;
+    int32_t latency = Module::kLatencyMs;
     if (bool success = readByteCount > 0 ? mDataMQ->read(&mDataBuffer[0], readByteCount) : true) {
         const bool isConnected = mIsConnected;
         LOG(DEBUG) << __func__ << ": reading of " << readByteCount << " bytes from data MQ"
@@ -483,23 +523,36 @@
             // simulate partial write.
             byteCount -= mFrameSize;
         }
+        size_t actualFrameCount = 0;
+        if (isConnected) {
+            if (::android::status_t status = mDriver->transfer(
+                        mDataBuffer.get(), byteCount / mFrameSize, &actualFrameCount, &latency);
+                status != ::android::OK) {
+                fatal = true;
+                LOG(ERROR) << __func__ << ": write failed: " << status;
+            }
+        } else {
+            if (mAsyncCallback == nullptr) {
+                usleep(3000);  // Simulate blocking transfer delay.
+            }
+            actualFrameCount = byteCount / mFrameSize;
+        }
+        const size_t actualByteCount = actualFrameCount * mFrameSize;
         // Frames are consumed and counted regardless of the connection status.
-        reply->fmqByteCount += byteCount;
-        mFrameCount += byteCount / mFrameSize;
+        reply->fmqByteCount += actualByteCount;
+        mFrameCount += actualFrameCount;
         populateReply(reply, isConnected);
-        usleep(3000);  // Simulate a blocking call into the driver.
-        // Set 'fatal = true' if a driver error occurs.
     } else {
         LOG(WARNING) << __func__ << ": reading of " << readByteCount
                      << " bytes of data from MQ failed";
         reply->status = STATUS_NOT_ENOUGH_DATA;
     }
-    reply->latencyMs = Module::kLatencyMs;
+    reply->latencyMs = latency;
     return !fatal;
 }
 
-template <class Metadata, class StreamWorker>
-StreamCommonImpl<Metadata, StreamWorker>::~StreamCommonImpl() {
+template <class Metadata>
+StreamCommonImpl<Metadata>::~StreamCommonImpl() {
     if (!isClosed()) {
         LOG(ERROR) << __func__ << ": stream was not closed prior to destruction, resource leak";
         stopWorker();
@@ -507,8 +560,8 @@
     }
 }
 
-template <class Metadata, class StreamWorker>
-void StreamCommonImpl<Metadata, StreamWorker>::createStreamCommon(
+template <class Metadata>
+void StreamCommonImpl<Metadata>::createStreamCommon(
         const std::shared_ptr<StreamCommonInterface>& delegate) {
     if (mCommon != nullptr) {
         LOG(FATAL) << __func__ << ": attempting to create the common interface twice";
@@ -518,8 +571,8 @@
     AIBinder_setMinSchedulerPolicy(mCommonBinder.get(), SCHED_NORMAL, ANDROID_PRIORITY_AUDIO);
 }
 
-template <class Metadata, class StreamWorker>
-ndk::ScopedAStatus StreamCommonImpl<Metadata, StreamWorker>::getStreamCommon(
+template <class Metadata>
+ndk::ScopedAStatus StreamCommonImpl<Metadata>::getStreamCommon(
         std::shared_ptr<IStreamCommon>* _aidl_return) {
     if (mCommon == nullptr) {
         LOG(FATAL) << __func__ << ": the common interface was not created";
@@ -529,31 +582,30 @@
     return ndk::ScopedAStatus::ok();
 }
 
-template <class Metadata, class StreamWorker>
-ndk::ScopedAStatus StreamCommonImpl<Metadata, StreamWorker>::updateHwAvSyncId(
-        int32_t in_hwAvSyncId) {
+template <class Metadata>
+ndk::ScopedAStatus StreamCommonImpl<Metadata>::updateHwAvSyncId(int32_t in_hwAvSyncId) {
     LOG(DEBUG) << __func__ << ": id " << in_hwAvSyncId;
     return ndk::ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION);
 }
 
-template <class Metadata, class StreamWorker>
-ndk::ScopedAStatus StreamCommonImpl<Metadata, StreamWorker>::getVendorParameters(
+template <class Metadata>
+ndk::ScopedAStatus StreamCommonImpl<Metadata>::getVendorParameters(
         const std::vector<std::string>& in_ids, std::vector<VendorParameter>* _aidl_return) {
     LOG(DEBUG) << __func__ << ": id count: " << in_ids.size();
     (void)_aidl_return;
     return ndk::ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION);
 }
 
-template <class Metadata, class StreamWorker>
-ndk::ScopedAStatus StreamCommonImpl<Metadata, StreamWorker>::setVendorParameters(
+template <class Metadata>
+ndk::ScopedAStatus StreamCommonImpl<Metadata>::setVendorParameters(
         const std::vector<VendorParameter>& in_parameters, bool in_async) {
     LOG(DEBUG) << __func__ << ": parameters count " << in_parameters.size()
                << ", async: " << in_async;
     return ndk::ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION);
 }
 
-template <class Metadata, class StreamWorker>
-ndk::ScopedAStatus StreamCommonImpl<Metadata, StreamWorker>::addEffect(
+template <class Metadata>
+ndk::ScopedAStatus StreamCommonImpl<Metadata>::addEffect(
         const std::shared_ptr<::aidl::android::hardware::audio::effect::IEffect>& in_effect) {
     if (in_effect == nullptr) {
         LOG(DEBUG) << __func__ << ": null effect";
@@ -563,8 +615,8 @@
     return ndk::ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION);
 }
 
-template <class Metadata, class StreamWorker>
-ndk::ScopedAStatus StreamCommonImpl<Metadata, StreamWorker>::removeEffect(
+template <class Metadata>
+ndk::ScopedAStatus StreamCommonImpl<Metadata>::removeEffect(
         const std::shared_ptr<::aidl::android::hardware::audio::effect::IEffect>& in_effect) {
     if (in_effect == nullptr) {
         LOG(DEBUG) << __func__ << ": null effect";
@@ -574,16 +626,16 @@
     return ndk::ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION);
 }
 
-template <class Metadata, class StreamWorker>
-ndk::ScopedAStatus StreamCommonImpl<Metadata, StreamWorker>::close() {
+template <class Metadata>
+ndk::ScopedAStatus StreamCommonImpl<Metadata>::close() {
     LOG(DEBUG) << __func__;
     if (!isClosed()) {
         stopWorker();
         LOG(DEBUG) << __func__ << ": joining the worker thread...";
-        mWorker.stop();
+        mWorker->stop();
         LOG(DEBUG) << __func__ << ": worker thread joined";
         mContext.reset();
-        mWorker.setClosed();
+        mWorker->setClosed();
         return ndk::ScopedAStatus::ok();
     } else {
         LOG(ERROR) << __func__ << ": stream was already closed";
@@ -591,8 +643,8 @@
     }
 }
 
-template <class Metadata, class StreamWorker>
-void StreamCommonImpl<Metadata, StreamWorker>::stopWorker() {
+template <class Metadata>
+void StreamCommonImpl<Metadata>::stopWorker() {
     if (auto commandMQ = mContext.getCommandMQ(); commandMQ != nullptr) {
         LOG(DEBUG) << __func__ << ": asking the worker to exit...";
         auto cmd = StreamDescriptor::Command::make<StreamDescriptor::Command::Tag::halReservedExit>(
@@ -608,9 +660,8 @@
     }
 }
 
-template <class Metadata, class StreamWorker>
-ndk::ScopedAStatus StreamCommonImpl<Metadata, StreamWorker>::updateMetadata(
-        const Metadata& metadata) {
+template <class Metadata>
+ndk::ScopedAStatus StreamCommonImpl<Metadata>::updateMetadata(const Metadata& metadata) {
     LOG(DEBUG) << __func__;
     if (!isClosed()) {
         mMetadata = metadata;
@@ -621,16 +672,11 @@
 }
 
 // static
-ndk::ScopedAStatus StreamIn::createInstance(const common::SinkMetadata& sinkMetadata,
-                                            StreamContext context,
-                                            const std::vector<MicrophoneInfo>& microphones,
-                                            std::shared_ptr<StreamIn>* result) {
-    auto stream = ndk::SharedRefBase::make<StreamIn>(sinkMetadata, std::move(context), microphones);
+ndk::ScopedAStatus StreamIn::initInstance(const std::shared_ptr<StreamIn>& stream) {
     if (auto status = stream->init(); !status.isOk()) {
         return status;
     }
     stream->createStreamCommon(stream);
-    *result = std::move(stream);
     return ndk::ScopedAStatus::ok();
 }
 
@@ -645,8 +691,10 @@
 }  // namespace
 
 StreamIn::StreamIn(const SinkMetadata& sinkMetadata, StreamContext&& context,
+                   const DriverInterface::CreateInstance& createDriver,
+                   const StreamWorkerInterface::CreateInstance& createWorker,
                    const std::vector<MicrophoneInfo>& microphones)
-    : StreamCommonImpl<SinkMetadata, StreamInWorker>(sinkMetadata, std::move(context)),
+    : StreamCommonImpl<SinkMetadata>(sinkMetadata, std::move(context), createDriver, createWorker),
       mMicrophones(transformMicrophones(microphones)) {
     LOG(DEBUG) << __func__;
 }
@@ -704,23 +752,20 @@
 }
 
 // static
-ndk::ScopedAStatus StreamOut::createInstance(const SourceMetadata& sourceMetadata,
-                                             StreamContext context,
-                                             const std::optional<AudioOffloadInfo>& offloadInfo,
-                                             std::shared_ptr<StreamOut>* result) {
-    auto stream =
-            ndk::SharedRefBase::make<StreamOut>(sourceMetadata, std::move(context), offloadInfo);
+ndk::ScopedAStatus StreamOut::initInstance(const std::shared_ptr<StreamOut>& stream) {
     if (auto status = stream->init(); !status.isOk()) {
         return status;
     }
     stream->createStreamCommon(stream);
-    *result = std::move(stream);
     return ndk::ScopedAStatus::ok();
 }
 
 StreamOut::StreamOut(const SourceMetadata& sourceMetadata, StreamContext&& context,
+                     const DriverInterface::CreateInstance& createDriver,
+                     const StreamWorkerInterface::CreateInstance& createWorker,
                      const std::optional<AudioOffloadInfo>& offloadInfo)
-    : StreamCommonImpl<SourceMetadata, StreamOutWorker>(sourceMetadata, std::move(context)),
+    : StreamCommonImpl<SourceMetadata>(sourceMetadata, std::move(context), createDriver,
+                                       createWorker),
       mOffloadInfo(offloadInfo) {
     LOG(DEBUG) << __func__;
 }
diff --git a/audio/aidl/default/StreamStub.cpp b/audio/aidl/default/StreamStub.cpp
new file mode 100644
index 0000000..5442179
--- /dev/null
+++ b/audio/aidl/default/StreamStub.cpp
@@ -0,0 +1,125 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#define LOG_TAG "AHAL_Stream"
+#include <android-base/logging.h>
+
+#include "core-impl/Module.h"
+#include "core-impl/StreamStub.h"
+
+using aidl::android::hardware::audio::common::SinkMetadata;
+using aidl::android::hardware::audio::common::SourceMetadata;
+using aidl::android::media::audio::common::AudioOffloadInfo;
+
+namespace aidl::android::hardware::audio::core {
+
+DriverStub::DriverStub(const StreamContext& context, bool isInput)
+    : mFrameSizeBytes(context.getFrameSize()), mIsInput(isInput) {}
+
+::android::status_t DriverStub::init() {
+    usleep(1000);
+    return ::android::OK;
+}
+
+::android::status_t DriverStub::drain(StreamDescriptor::DrainMode) {
+    usleep(1000);
+    return ::android::OK;
+}
+
+::android::status_t DriverStub::flush() {
+    usleep(1000);
+    return ::android::OK;
+}
+
+::android::status_t DriverStub::pause() {
+    usleep(1000);
+    return ::android::OK;
+}
+
+::android::status_t DriverStub::transfer(void* buffer, size_t frameCount, size_t* actualFrameCount,
+                                         int32_t* latencyMs) {
+    usleep(3000);
+    if (mIsInput) {
+        uint8_t* byteBuffer = static_cast<uint8_t*>(buffer);
+        for (size_t i = 0; i < frameCount * mFrameSizeBytes; ++i) {
+            byteBuffer[i] = std::rand() % 255;
+        }
+    }
+    *actualFrameCount = frameCount;
+    *latencyMs = Module::kLatencyMs;
+    return ::android::OK;
+}
+
+::android::status_t DriverStub::standby() {
+    usleep(1000);
+    return ::android::OK;
+}
+
+// static
+ndk::ScopedAStatus StreamInStub::createInstance(const SinkMetadata& sinkMetadata,
+                                                StreamContext&& context,
+                                                const std::vector<MicrophoneInfo>& microphones,
+                                                std::shared_ptr<StreamIn>* result) {
+    std::shared_ptr<StreamIn> stream =
+            ndk::SharedRefBase::make<StreamInStub>(sinkMetadata, std::move(context), microphones);
+    if (auto status = initInstance(stream); !status.isOk()) {
+        return status;
+    }
+    *result = std::move(stream);
+    return ndk::ScopedAStatus::ok();
+}
+
+StreamInStub::StreamInStub(const SinkMetadata& sinkMetadata, StreamContext&& context,
+                           const std::vector<MicrophoneInfo>& microphones)
+    : StreamIn(
+              sinkMetadata, std::move(context),
+              [](const StreamContext& ctx) -> DriverInterface* {
+                  return new DriverStub(ctx, true /*isInput*/);
+              },
+              [](const StreamContext& ctx, DriverInterface* driver) -> StreamWorkerInterface* {
+                  // The default worker implementation is used.
+                  return new StreamInWorker(ctx, driver);
+              },
+              microphones) {}
+
+// static
+ndk::ScopedAStatus StreamOutStub::createInstance(const SourceMetadata& sourceMetadata,
+                                                 StreamContext&& context,
+                                                 const std::optional<AudioOffloadInfo>& offloadInfo,
+                                                 std::shared_ptr<StreamOut>* result) {
+    std::shared_ptr<StreamOut> stream = ndk::SharedRefBase::make<StreamOutStub>(
+            sourceMetadata, std::move(context), offloadInfo);
+    if (auto status = initInstance(stream); !status.isOk()) {
+        return status;
+    }
+    *result = std::move(stream);
+    return ndk::ScopedAStatus::ok();
+}
+
+StreamOutStub::StreamOutStub(const SourceMetadata& sourceMetadata, StreamContext&& context,
+                             const std::optional<AudioOffloadInfo>& offloadInfo)
+    : StreamOut(
+              sourceMetadata, std::move(context),
+              [](const StreamContext& ctx) -> DriverInterface* {
+                  return new DriverStub(ctx, false /*isInput*/);
+              },
+              [](const StreamContext& ctx, DriverInterface* driver) -> StreamWorkerInterface* {
+                  // The default worker implementation is used.
+                  return new StreamOutWorker(ctx, driver);
+              },
+              offloadInfo) {}
+
+}  // namespace aidl::android::hardware::audio::core
diff --git a/audio/aidl/default/Telephony.cpp b/audio/aidl/default/Telephony.cpp
index d873178..ad22470 100644
--- a/audio/aidl/default/Telephony.cpp
+++ b/audio/aidl/default/Telephony.cpp
@@ -14,14 +14,18 @@
  * limitations under the License.
  */
 
-#include <android/binder_to_string.h>
 #define LOG_TAG "AHAL_Telephony"
 #include <android-base/logging.h>
 
+#include <Utils.h>
+#include <android/binder_to_string.h>
+
 #include "core-impl/Telephony.h"
 
+using aidl::android::media::audio::common::AudioMode;
 using aidl::android::media::audio::common::Boolean;
 using aidl::android::media::audio::common::Float;
+using android::hardware::audio::common::isValidAudioMode;
 
 namespace aidl::android::hardware::audio::core {
 
@@ -38,6 +42,10 @@
 }
 
 ndk::ScopedAStatus Telephony::switchAudioMode(AudioMode in_mode) {
+    if (!isValidAudioMode(in_mode)) {
+        LOG(ERROR) << __func__ << ": invalid mode " << toString(in_mode);
+        return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT);
+    }
     if (std::find(mSupportedAudioModes.begin(), mSupportedAudioModes.end(), in_mode) !=
         mSupportedAudioModes.end()) {
         LOG(DEBUG) << __func__ << ": " << toString(in_mode);
diff --git a/audio/aidl/default/android.hardware.audio.service-aidl.xml b/audio/aidl/default/android.hardware.audio.service-aidl.xml
index 46b665f..9636a58 100644
--- a/audio/aidl/default/android.hardware.audio.service-aidl.xml
+++ b/audio/aidl/default/android.hardware.audio.service-aidl.xml
@@ -12,6 +12,11 @@
   <hal format="aidl">
     <name>android.hardware.audio.core</name>
     <version>1</version>
+    <fqname>IModule/usb</fqname>
+  </hal>
+  <hal format="aidl">
+    <name>android.hardware.audio.core</name>
+    <version>1</version>
     <fqname>IConfig/default</fqname>
   </hal>
 </manifest>
diff --git a/audio/aidl/default/audio_effects_config.xml b/audio/aidl/default/audio_effects_config.xml
index e460f89..6714a7e 100644
--- a/audio/aidl/default/audio_effects_config.xml
+++ b/audio/aidl/default/audio_effects_config.xml
@@ -40,6 +40,7 @@
         <library name="nssw" path="libnssw.so"/>
         <library name="env_reverbsw" path="libenvreverbsw.so"/>
         <library name="preset_reverbsw" path="libpresetreverbsw.so"/>
+        <library name="reverb" path="libreverbaidl.so"/>
         <library name="virtualizersw" path="libvirtualizersw.so"/>
         <library name="visualizer" path="libvisualizeraidl.so"/>
         <library name="volumesw" path="libvolumesw.so"/>
@@ -78,6 +79,10 @@
         <effect name="env_reverb" library="env_reverbsw" uuid="fa819886-588b-11ed-9b6a-0242ac120002"/>
         <effect name="noise_suppression" library="nssw" uuid="c06c8400-8e06-11e0-9cb6-0002a5d5c51b"/>
         <effect name="preset_reverb" library="preset_reverbsw" uuid="fa8199c6-588b-11ed-9b6a-0242ac120002"/>
+        <effect name="reverb_env_aux" library="reverb" uuid="4a387fc0-8ab3-11df-8bad-0002a5d5c51b"/>
+        <effect name="reverb_env_ins" library="reverb" uuid="c7a511a0-a3bb-11df-860e-0002a5d5c51b"/>
+        <effect name="reverb_pre_aux" library="reverb" uuid="f29a1400-a3bb-11df-8ddc-0002a5d5c51b"/>
+        <effect name="reverb_pre_ins" library="reverb" uuid="172cdf00-a3bc-11df-a72f-0002a5d5c51b"/>
         <effectProxy name="virtualizer" uuid="d3467faa-acc7-4d34-acaf-0002a5d5c51b">
             <libsw library="virtualizersw" uuid="fa819d86-588b-11ed-9b6a-0242ac120002"/>
             <libsw library="bundle" uuid="1d4033c0-8557-11df-9f2d-0002a5d5c51b"/>
diff --git a/audio/aidl/default/include/core-impl/Configuration.h b/audio/aidl/default/include/core-impl/Configuration.h
index 3b4c494..1aca1fe 100644
--- a/audio/aidl/default/include/core-impl/Configuration.h
+++ b/audio/aidl/default/include/core-impl/Configuration.h
@@ -44,5 +44,6 @@
 
 std::unique_ptr<Configuration> getPrimaryConfiguration();
 std::unique_ptr<Configuration> getRSubmixConfiguration();
+std::unique_ptr<Configuration> getUsbConfiguration();
 
 }  // namespace aidl::android::hardware::audio::core::internal
diff --git a/audio/aidl/default/include/core-impl/Module.h b/audio/aidl/default/include/core-impl/Module.h
index 000a704..80a22dc 100644
--- a/audio/aidl/default/include/core-impl/Module.h
+++ b/audio/aidl/default/include/core-impl/Module.h
@@ -31,7 +31,7 @@
   public:
     // This value is used for all AudioPatches and reported by all streams.
     static constexpr int32_t kLatencyMs = 10;
-    enum Type : int { DEFAULT, R_SUBMIX };
+    enum Type : int { DEFAULT, R_SUBMIX, USB };
 
     explicit Module(Type type) : mType(type) {}
 
@@ -92,7 +92,7 @@
     ndk::ScopedAStatus setMicMute(bool in_mute) override;
     ndk::ScopedAStatus getMicrophones(std::vector<MicrophoneInfo>* _aidl_return) override;
     ndk::ScopedAStatus updateAudioMode(
-            ::aidl::android::hardware::audio::core::AudioMode in_mode) override;
+            ::aidl::android::media::audio::common::AudioMode in_mode) override;
     ndk::ScopedAStatus updateScreenRotation(
             ::aidl::android::hardware::audio::core::IModule::ScreenRotation in_rotation) override;
     ndk::ScopedAStatus updateScreenState(bool in_isTurnedOn) override;
@@ -110,11 +110,19 @@
             int32_t in_portConfigId,
             const std::shared_ptr<::aidl::android::hardware::audio::effect::IEffect>& in_effect)
             override;
+    ndk::ScopedAStatus getMmapPolicyInfos(
+            ::aidl::android::media::audio::common::AudioMMapPolicyType mmapPolicyType,
+            std::vector<::aidl::android::media::audio::common::AudioMMapPolicyInfo>* _aidl_return)
+            override;
+    ndk::ScopedAStatus supportsVariableLatency(bool* _aidl_return) override;
+    ndk::ScopedAStatus getAAudioMixerBurstCount(int32_t* _aidl_return) override;
+    ndk::ScopedAStatus getAAudioHardwareBurstMinUsec(int32_t* _aidl_return) override;
 
     void cleanUpPatch(int32_t patchId);
     ndk::ScopedAStatus createStreamContext(
             int32_t in_portConfigId, int64_t in_bufferSizeFrames,
             std::shared_ptr<IStreamCallback> asyncCallback,
+            std::shared_ptr<IStreamOutEventCallback> outEventCallback,
             ::aidl::android::hardware::audio::core::StreamContext* out_context);
     std::vector<::aidl::android::media::audio::common::AudioDevice> findConnectedDevices(
             int32_t portConfigId);
@@ -126,6 +134,7 @@
     std::set<int32_t> portIdsFromPortConfigIds(C portConfigIds);
     void registerPatch(const AudioPatch& patch);
     void updateStreamsConnectedState(const AudioPatch& oldPatch, const AudioPatch& newPatch);
+    bool isMmapSupported();
 
     // This value is used for all AudioPatches.
     static constexpr int32_t kMinimumStreamBufferSizeFrames = 16;
@@ -153,6 +162,7 @@
     bool mMicMute = false;
     std::shared_ptr<sounddose::ISoundDose> mSoundDose;
     ndk::SpAIBinder mSoundDoseBinder;
+    std::optional<bool> mIsMmapSupported;
 };
 
 }  // namespace aidl::android::hardware::audio::core
diff --git a/audio/aidl/default/include/core-impl/Stream.h b/audio/aidl/default/include/core-impl/Stream.h
index 2cf5951..7cd4259 100644
--- a/audio/aidl/default/include/core-impl/Stream.h
+++ b/audio/aidl/default/include/core-impl/Stream.h
@@ -31,12 +31,14 @@
 #include <aidl/android/hardware/audio/core/BnStreamIn.h>
 #include <aidl/android/hardware/audio/core/BnStreamOut.h>
 #include <aidl/android/hardware/audio/core/IStreamCallback.h>
+#include <aidl/android/hardware/audio/core/IStreamOutEventCallback.h>
 #include <aidl/android/hardware/audio/core/MicrophoneInfo.h>
 #include <aidl/android/hardware/audio/core/StreamDescriptor.h>
 #include <aidl/android/media/audio/common/AudioDevice.h>
 #include <aidl/android/media/audio/common/AudioOffloadInfo.h>
 #include <fmq/AidlMessageQueue.h>
 #include <system/thread_defs.h>
+#include <utils/Errors.h>
 
 #include "core-impl/utils.h"
 
@@ -76,6 +78,7 @@
                   const ::aidl::android::media::audio::common::AudioFormatDescription& format,
                   const ::aidl::android::media::audio::common::AudioChannelLayout& channelLayout,
                   std::unique_ptr<DataMQ> dataMQ, std::shared_ptr<IStreamCallback> asyncCallback,
+                  std::shared_ptr<IStreamOutEventCallback> outEventCallback,
                   DebugParameters debugParameters)
         : mCommandMQ(std::move(commandMQ)),
           mInternalCommandCookie(std::rand()),
@@ -84,6 +87,7 @@
           mChannelLayout(channelLayout),
           mDataMQ(std::move(dataMQ)),
           mAsyncCallback(asyncCallback),
+          mOutEventCallback(outEventCallback),
           mDebugParameters(debugParameters) {}
     StreamContext(StreamContext&& other)
         : mCommandMQ(std::move(other.mCommandMQ)),
@@ -93,6 +97,7 @@
           mChannelLayout(other.mChannelLayout),
           mDataMQ(std::move(other.mDataMQ)),
           mAsyncCallback(std::move(other.mAsyncCallback)),
+          mOutEventCallback(std::move(other.mOutEventCallback)),
           mDebugParameters(std::move(other.mDebugParameters)) {}
     StreamContext& operator=(StreamContext&& other) {
         mCommandMQ = std::move(other.mCommandMQ);
@@ -102,6 +107,7 @@
         mChannelLayout = std::move(other.mChannelLayout);
         mDataMQ = std::move(other.mDataMQ);
         mAsyncCallback = std::move(other.mAsyncCallback);
+        mOutEventCallback = std::move(other.mOutEventCallback);
         mDebugParameters = std::move(other.mDebugParameters);
         return *this;
     }
@@ -120,6 +126,9 @@
     bool getForceSynchronousDrain() const { return mDebugParameters.forceSynchronousDrain; }
     size_t getFrameSize() const;
     int getInternalCommandCookie() const { return mInternalCommandCookie; }
+    std::shared_ptr<IStreamOutEventCallback> getOutEventCallback() const {
+        return mOutEventCallback;
+    }
     ReplyMQ* getReplyMQ() const { return mReplyMQ.get(); }
     int getTransientStateDelayMs() const { return mDebugParameters.transientStateDelayMs; }
     bool isValid() const;
@@ -133,9 +142,24 @@
     ::aidl::android::media::audio::common::AudioChannelLayout mChannelLayout;
     std::unique_ptr<DataMQ> mDataMQ;
     std::shared_ptr<IStreamCallback> mAsyncCallback;
+    std::shared_ptr<IStreamOutEventCallback> mOutEventCallback;  // Only used by output streams
     DebugParameters mDebugParameters;
 };
 
+struct DriverInterface {
+    using CreateInstance = std::function<DriverInterface*(const StreamContext&)>;
+    virtual ~DriverInterface() = default;
+    // This function is called once, on the main thread, before starting the worker thread.
+    virtual ::android::status_t init() = 0;
+    // All the functions below are called on the worker thread.
+    virtual ::android::status_t drain(StreamDescriptor::DrainMode mode) = 0;
+    virtual ::android::status_t flush() = 0;
+    virtual ::android::status_t pause() = 0;
+    virtual ::android::status_t transfer(void* buffer, size_t frameCount, size_t* actualFrameCount,
+                                         int32_t* latencyMs) = 0;
+    virtual ::android::status_t standby() = 0;
+};
+
 class StreamWorkerCommonLogic : public ::android::hardware::audio::common::StreamLogic {
   public:
     bool isClosed() const {
@@ -145,8 +169,11 @@
     void setIsConnected(bool connected) { mIsConnected = connected; }
 
   protected:
-    explicit StreamWorkerCommonLogic(const StreamContext& context)
-        : mInternalCommandCookie(context.getInternalCommandCookie()),
+    using DataBufferElement = int8_t;
+
+    StreamWorkerCommonLogic(const StreamContext& context, DriverInterface* driver)
+        : mDriver(driver),
+          mInternalCommandCookie(context.getInternalCommandCookie()),
           mFrameSize(context.getFrameSize()),
           mCommandMQ(context.getCommandMQ()),
           mReplyMQ(context.getReplyMQ()),
@@ -164,6 +191,7 @@
         mTransientStateStart = std::chrono::steady_clock::now();
     }
 
+    DriverInterface* const mDriver;
     // Atomic fields are used both by the main and worker threads.
     std::atomic<bool> mIsConnected = false;
     static_assert(std::atomic<StreamDescriptor::State>::is_always_lock_free);
@@ -171,9 +199,9 @@
     // All fields are used on the worker thread only.
     const int mInternalCommandCookie;
     const size_t mFrameSize;
-    StreamContext::CommandMQ* mCommandMQ;
-    StreamContext::ReplyMQ* mReplyMQ;
-    StreamContext::DataMQ* mDataMQ;
+    StreamContext::CommandMQ* const mCommandMQ;
+    StreamContext::ReplyMQ* const mReplyMQ;
+    StreamContext::DataMQ* const mDataMQ;
     std::shared_ptr<IStreamCallback> mAsyncCallback;
     const std::chrono::duration<int, std::milli> mTransientStateDelayMs;
     std::chrono::time_point<std::chrono::steady_clock> mTransientStateStart;
@@ -181,15 +209,46 @@
     const bool mForceSynchronousDrain;
     // We use an array and the "size" field instead of a vector to be able to detect
     // memory allocation issues.
-    std::unique_ptr<int8_t[]> mDataBuffer;
+    std::unique_ptr<DataBufferElement[]> mDataBuffer;
     size_t mDataBufferSize;
     long mFrameCount = 0;
 };
 
+// This interface is used to decouple stream implementations from a concrete StreamWorker
+// implementation.
+struct StreamWorkerInterface {
+    using CreateInstance = std::function<StreamWorkerInterface*(const StreamContext& context,
+                                                                DriverInterface* driver)>;
+    virtual ~StreamWorkerInterface() = default;
+    virtual bool isClosed() const = 0;
+    virtual void setIsConnected(bool isConnected) = 0;
+    virtual void setClosed() = 0;
+    virtual bool start() = 0;
+    virtual void stop() = 0;
+};
+
+template <class WorkerLogic>
+class StreamWorkerImpl : public StreamWorkerInterface,
+                         public ::android::hardware::audio::common::StreamWorker<WorkerLogic> {
+    using WorkerImpl = ::android::hardware::audio::common::StreamWorker<WorkerLogic>;
+
+  public:
+    StreamWorkerImpl(const StreamContext& context, DriverInterface* driver)
+        : WorkerImpl(context, driver) {}
+    bool isClosed() const override { return WorkerImpl::isClosed(); }
+    void setIsConnected(bool isConnected) override { WorkerImpl::setIsConnected(isConnected); }
+    void setClosed() override { WorkerImpl::setClosed(); }
+    bool start() override {
+        return WorkerImpl::start(WorkerImpl::kThreadName, ANDROID_PRIORITY_AUDIO);
+    }
+    void stop() override { return WorkerImpl::stop(); }
+};
+
 class StreamInWorkerLogic : public StreamWorkerCommonLogic {
   public:
     static const std::string kThreadName;
-    explicit StreamInWorkerLogic(const StreamContext& context) : StreamWorkerCommonLogic(context) {}
+    StreamInWorkerLogic(const StreamContext& context, DriverInterface* driver)
+        : StreamWorkerCommonLogic(context, driver) {}
 
   protected:
     Status cycle() override;
@@ -197,21 +256,23 @@
   private:
     bool read(size_t clientSize, StreamDescriptor::Reply* reply);
 };
-using StreamInWorker = ::android::hardware::audio::common::StreamWorker<StreamInWorkerLogic>;
+using StreamInWorker = StreamWorkerImpl<StreamInWorkerLogic>;
 
 class StreamOutWorkerLogic : public StreamWorkerCommonLogic {
   public:
     static const std::string kThreadName;
-    explicit StreamOutWorkerLogic(const StreamContext& context)
-        : StreamWorkerCommonLogic(context) {}
+    StreamOutWorkerLogic(const StreamContext& context, DriverInterface* driver)
+        : StreamWorkerCommonLogic(context, driver), mEventCallback(context.getOutEventCallback()) {}
 
   protected:
     Status cycle() override;
 
   private:
     bool write(size_t clientSize, StreamDescriptor::Reply* reply);
+
+    std::shared_ptr<IStreamOutEventCallback> mEventCallback;
 };
-using StreamOutWorker = ::android::hardware::audio::common::StreamWorker<StreamOutWorkerLogic>;
+using StreamOutWorker = StreamWorkerImpl<StreamOutWorkerLogic>;
 
 // This provides a C++ interface with methods of the IStreamCommon Binder interface,
 // but intentionally does not inherit from it. This is needed to avoid inheriting
@@ -283,7 +344,7 @@
     std::weak_ptr<StreamCommonInterface> mDelegate;
 };
 
-template <class Metadata, class StreamWorker>
+template <class Metadata>
 class StreamCommonImpl : public StreamCommonInterface {
   public:
     ndk::ScopedAStatus close() override;
@@ -301,21 +362,25 @@
 
     ndk::ScopedAStatus getStreamCommon(std::shared_ptr<IStreamCommon>* _aidl_return);
     ndk::ScopedAStatus init() {
-        return mWorker.start(StreamWorker::kThreadName, ANDROID_PRIORITY_AUDIO)
-                       ? ndk::ScopedAStatus::ok()
-                       : ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_STATE);
+        return mWorker->start() ? ndk::ScopedAStatus::ok()
+                                : ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_STATE);
     }
-    bool isClosed() const { return mWorker.isClosed(); }
+    bool isClosed() const { return mWorker->isClosed(); }
     void setIsConnected(
             const std::vector<::aidl::android::media::audio::common::AudioDevice>& devices) {
-        mWorker.setIsConnected(!devices.empty());
+        mWorker->setIsConnected(!devices.empty());
         mConnectedDevices = devices;
     }
     ndk::ScopedAStatus updateMetadata(const Metadata& metadata);
 
   protected:
-    StreamCommonImpl(const Metadata& metadata, StreamContext&& context)
-        : mMetadata(metadata), mContext(std::move(context)), mWorker(mContext) {}
+    StreamCommonImpl(const Metadata& metadata, StreamContext&& context,
+                     const DriverInterface::CreateInstance& createDriver,
+                     const StreamWorkerInterface::CreateInstance& createWorker)
+        : mMetadata(metadata),
+          mContext(std::move(context)),
+          mDriver(createDriver(mContext)),
+          mWorker(createWorker(mContext, mDriver.get())) {}
     ~StreamCommonImpl();
     void stopWorker();
     void createStreamCommon(const std::shared_ptr<StreamCommonInterface>& delegate);
@@ -324,16 +389,16 @@
     ndk::SpAIBinder mCommonBinder;
     Metadata mMetadata;
     StreamContext mContext;
-    StreamWorker mWorker;
+    std::unique_ptr<DriverInterface> mDriver;
+    std::unique_ptr<StreamWorkerInterface> mWorker;
     std::vector<::aidl::android::media::audio::common::AudioDevice> mConnectedDevices;
 };
 
-class StreamIn : public StreamCommonImpl<::aidl::android::hardware::audio::common::SinkMetadata,
-                                         StreamInWorker>,
+class StreamIn : public StreamCommonImpl<::aidl::android::hardware::audio::common::SinkMetadata>,
                  public BnStreamIn {
     ndk::ScopedAStatus getStreamCommon(std::shared_ptr<IStreamCommon>* _aidl_return) override {
-        return StreamCommonImpl<::aidl::android::hardware::audio::common::SinkMetadata,
-                                StreamInWorker>::getStreamCommon(_aidl_return);
+        return StreamCommonImpl<::aidl::android::hardware::audio::common::SinkMetadata>::
+                getStreamCommon(_aidl_return);
     }
     ndk::ScopedAStatus getActiveMicrophones(
             std::vector<MicrophoneDynamicInfo>* _aidl_return) override;
@@ -343,42 +408,46 @@
     ndk::ScopedAStatus setMicrophoneFieldDimension(float in_zoom) override;
     ndk::ScopedAStatus updateMetadata(const ::aidl::android::hardware::audio::common::SinkMetadata&
                                               in_sinkMetadata) override {
-        return StreamCommonImpl<::aidl::android::hardware::audio::common::SinkMetadata,
-                                StreamInWorker>::updateMetadata(in_sinkMetadata);
+        return StreamCommonImpl<::aidl::android::hardware::audio::common::SinkMetadata>::
+                updateMetadata(in_sinkMetadata);
     }
     ndk::ScopedAStatus getHwGain(std::vector<float>* _aidl_return) override;
     ndk::ScopedAStatus setHwGain(const std::vector<float>& in_channelGains) override;
 
-  public:
-    static ndk::ScopedAStatus createInstance(
-            const ::aidl::android::hardware::audio::common::SinkMetadata& sinkMetadata,
-            StreamContext context, const std::vector<MicrophoneInfo>& microphones,
-            std::shared_ptr<StreamIn>* result);
-
-  private:
+  protected:
     friend class ndk::SharedRefBase;
+
+    static ndk::ScopedAStatus initInstance(const std::shared_ptr<StreamIn>& stream);
+
     StreamIn(const ::aidl::android::hardware::audio::common::SinkMetadata& sinkMetadata,
-             StreamContext&& context, const std::vector<MicrophoneInfo>& microphones);
+             StreamContext&& context, const DriverInterface::CreateInstance& createDriver,
+             const StreamWorkerInterface::CreateInstance& createWorker,
+             const std::vector<MicrophoneInfo>& microphones);
     void createStreamCommon(const std::shared_ptr<StreamIn>& myPtr) {
-        StreamCommonImpl<::aidl::android::hardware::audio::common::SinkMetadata,
-                         StreamInWorker>::createStreamCommon(myPtr);
+        StreamCommonImpl<
+                ::aidl::android::hardware::audio::common::SinkMetadata>::createStreamCommon(myPtr);
     }
 
     const std::map<::aidl::android::media::audio::common::AudioDevice, std::string> mMicrophones;
+
+  public:
+    using CreateInstance = std::function<ndk::ScopedAStatus(
+            const ::aidl::android::hardware::audio::common::SinkMetadata& sinkMetadata,
+            StreamContext&& context, const std::vector<MicrophoneInfo>& microphones,
+            std::shared_ptr<StreamIn>* result)>;
 };
 
-class StreamOut : public StreamCommonImpl<::aidl::android::hardware::audio::common::SourceMetadata,
-                                          StreamOutWorker>,
+class StreamOut : public StreamCommonImpl<::aidl::android::hardware::audio::common::SourceMetadata>,
                   public BnStreamOut {
     ndk::ScopedAStatus getStreamCommon(std::shared_ptr<IStreamCommon>* _aidl_return) override {
-        return StreamCommonImpl<::aidl::android::hardware::audio::common::SourceMetadata,
-                                StreamOutWorker>::getStreamCommon(_aidl_return);
+        return StreamCommonImpl<::aidl::android::hardware::audio::common::SourceMetadata>::
+                getStreamCommon(_aidl_return);
     }
     ndk::ScopedAStatus updateMetadata(
             const ::aidl::android::hardware::audio::common::SourceMetadata& in_sourceMetadata)
             override {
-        return StreamCommonImpl<::aidl::android::hardware::audio::common::SourceMetadata,
-                                StreamOutWorker>::updateMetadata(in_sourceMetadata);
+        return StreamCommonImpl<::aidl::android::hardware::audio::common::SourceMetadata>::
+                updateMetadata(in_sourceMetadata);
     }
     ndk::ScopedAStatus getHwVolume(std::vector<float>* _aidl_return) override;
     ndk::ScopedAStatus setHwVolume(const std::vector<float>& in_channelVolumes) override;
@@ -400,26 +469,31 @@
             override;
     ndk::ScopedAStatus selectPresentation(int32_t in_presentationId, int32_t in_programId) override;
 
-  public:
-    static ndk::ScopedAStatus createInstance(
-            const ::aidl::android::hardware::audio::common::SourceMetadata& sourceMetadata,
-            StreamContext context,
-            const std::optional<::aidl::android::media::audio::common::AudioOffloadInfo>&
-                    offloadInfo,
-            std::shared_ptr<StreamOut>* result);
-
-  private:
-    friend class ndk::SharedRefBase;
-    StreamOut(const ::aidl::android::hardware::audio::common::SourceMetadata& sourceMetadata,
-              StreamContext&& context,
-              const std::optional<::aidl::android::media::audio::common::AudioOffloadInfo>&
-                      offloadInfo);
     void createStreamCommon(const std::shared_ptr<StreamOut>& myPtr) {
-        StreamCommonImpl<::aidl::android::hardware::audio::common::SourceMetadata,
-                         StreamOutWorker>::createStreamCommon(myPtr);
+        StreamCommonImpl<::aidl::android::hardware::audio::common::SourceMetadata>::
+                createStreamCommon(myPtr);
     }
 
+  protected:
+    friend class ndk::SharedRefBase;
+
+    static ndk::ScopedAStatus initInstance(const std::shared_ptr<StreamOut>& stream);
+
+    StreamOut(const ::aidl::android::hardware::audio::common::SourceMetadata& sourceMetadata,
+              StreamContext&& context, const DriverInterface::CreateInstance& createDriver,
+              const StreamWorkerInterface::CreateInstance& createWorker,
+              const std::optional<::aidl::android::media::audio::common::AudioOffloadInfo>&
+                      offloadInfo);
+
     std::optional<::aidl::android::media::audio::common::AudioOffloadInfo> mOffloadInfo;
+
+  public:
+    using CreateInstance = std::function<ndk::ScopedAStatus(
+            const ::aidl::android::hardware::audio::common::SourceMetadata& sourceMetadata,
+            StreamContext&& context,
+            const std::optional<::aidl::android::media::audio::common::AudioOffloadInfo>&
+                    offloadInfo,
+            std::shared_ptr<StreamOut>* result)>;
 };
 
 class StreamWrapper {
diff --git a/audio/aidl/default/include/core-impl/StreamStub.h b/audio/aidl/default/include/core-impl/StreamStub.h
new file mode 100644
index 0000000..98a062a
--- /dev/null
+++ b/audio/aidl/default/include/core-impl/StreamStub.h
@@ -0,0 +1,69 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+#include "core-impl/Stream.h"
+
+namespace aidl::android::hardware::audio::core {
+
+class DriverStub : public DriverInterface {
+  public:
+    DriverStub(const StreamContext& context, bool isInput);
+    ::android::status_t init() override;
+    ::android::status_t drain(StreamDescriptor::DrainMode) override;
+    ::android::status_t flush() override;
+    ::android::status_t pause() override;
+    ::android::status_t transfer(void* buffer, size_t frameCount, size_t* actualFrameCount,
+                                 int32_t* latencyMs) override;
+    ::android::status_t standby() override;
+
+  private:
+    const size_t mFrameSizeBytes;
+    const bool mIsInput;
+};
+
+class StreamInStub final : public StreamIn {
+  public:
+    static ndk::ScopedAStatus createInstance(
+            const ::aidl::android::hardware::audio::common::SinkMetadata& sinkMetadata,
+            StreamContext&& context, const std::vector<MicrophoneInfo>& microphones,
+            std::shared_ptr<StreamIn>* result);
+
+  private:
+    friend class ndk::SharedRefBase;
+    StreamInStub(const ::aidl::android::hardware::audio::common::SinkMetadata& sinkMetadata,
+                 StreamContext&& context, const std::vector<MicrophoneInfo>& microphones);
+};
+
+class StreamOutStub final : public StreamOut {
+  public:
+    static ndk::ScopedAStatus createInstance(
+            const ::aidl::android::hardware::audio::common::SourceMetadata& sourceMetadata,
+            StreamContext&& context,
+            const std::optional<::aidl::android::media::audio::common::AudioOffloadInfo>&
+                    offloadInfo,
+            std::shared_ptr<StreamOut>* result);
+
+  private:
+    friend class ndk::SharedRefBase;
+    StreamOutStub(const ::aidl::android::hardware::audio::common::SourceMetadata& sourceMetadata,
+                  StreamContext&& context,
+                  const std::optional<::aidl::android::media::audio::common::AudioOffloadInfo>&
+                          offloadInfo);
+};
+
+}  // namespace aidl::android::hardware::audio::core
diff --git a/audio/aidl/default/include/core-impl/Telephony.h b/audio/aidl/default/include/core-impl/Telephony.h
index 0936172..0f8e93f 100644
--- a/audio/aidl/default/include/core-impl/Telephony.h
+++ b/audio/aidl/default/include/core-impl/Telephony.h
@@ -27,13 +27,20 @@
     Telephony();
 
   private:
-    ndk::ScopedAStatus getSupportedAudioModes(std::vector<AudioMode>* _aidl_return) override;
-    ndk::ScopedAStatus switchAudioMode(AudioMode in_mode) override;
+    ndk::ScopedAStatus getSupportedAudioModes(
+            std::vector<::aidl::android::media::audio::common::AudioMode>* _aidl_return) override;
+    ndk::ScopedAStatus switchAudioMode(
+            ::aidl::android::media::audio::common::AudioMode in_mode) override;
     ndk::ScopedAStatus setTelecomConfig(const TelecomConfig& in_config,
                                         TelecomConfig* _aidl_return) override;
 
-    const std::vector<AudioMode> mSupportedAudioModes = {::ndk::enum_range<AudioMode>().begin(),
-                                                         ::ndk::enum_range<AudioMode>().end()};
+    const std::vector<::aidl::android::media::audio::common::AudioMode> mSupportedAudioModes = {
+            ::aidl::android::media::audio::common::AudioMode::NORMAL,
+            ::aidl::android::media::audio::common::AudioMode::RINGTONE,
+            ::aidl::android::media::audio::common::AudioMode::IN_CALL,
+            ::aidl::android::media::audio::common::AudioMode::IN_COMMUNICATION,
+            // Omit CALL_SCREEN for a better VTS coverage.
+    };
     TelecomConfig mTelecomConfig;
 };
 
diff --git a/audio/aidl/default/include/effect-impl/EffectContext.h b/audio/aidl/default/include/effect-impl/EffectContext.h
index a3e7ff2..2ab0ade 100644
--- a/audio/aidl/default/include/effect-impl/EffectContext.h
+++ b/audio/aidl/default/include/effect-impl/EffectContext.h
@@ -37,7 +37,6 @@
             DataMQ;
 
     EffectContext(size_t statusDepth, const Parameter::Common& common) {
-        mSessionId = common.session;
         auto& input = common.input;
         auto& output = common.output;
 
@@ -63,6 +62,7 @@
             LOG(ERROR) << __func__ << " created invalid FMQ";
         }
         mWorkBuffer.reserve(std::max(inBufferSizeInFloat, outBufferSizeInFloat));
+        mCommon = common;
     }
     virtual ~EffectContext() {}
 
@@ -88,14 +88,18 @@
     }
     size_t getInputFrameSize() { return mInputFrameSize; }
     size_t getOutputFrameSize() { return mOutputFrameSize; }
-    int getSessionId() { return mSessionId; }
+    int getSessionId() { return mCommon.session; }
+    int getIoHandle() { return mCommon.ioHandle; }
 
     virtual RetCode setOutputDevice(
-            const aidl::android::media::audio::common::AudioDeviceDescription& device) {
+            const std::vector<aidl::android::media::audio::common::AudioDeviceDescription>&
+                    device) {
         mOutputDevice = device;
         return RetCode::SUCCESS;
     }
-    virtual aidl::android::media::audio::common::AudioDeviceDescription getOutputDevice() {
+
+    virtual std::vector<aidl::android::media::audio::common::AudioDeviceDescription>
+    getOutputDevice() {
         return mOutputDevice;
     }
 
@@ -129,11 +133,10 @@
 
   protected:
     // common parameters
-    int mSessionId = INVALID_AUDIO_SESSION_ID;
     size_t mInputFrameSize;
     size_t mOutputFrameSize;
     Parameter::Common mCommon;
-    aidl::android::media::audio::common::AudioDeviceDescription mOutputDevice;
+    std::vector<aidl::android::media::audio::common::AudioDeviceDescription> mOutputDevice;
     aidl::android::media::audio::common::AudioMode mMode;
     aidl::android::media::audio::common::AudioSource mSource;
     Parameter::VolumeStereo mVolumeStereo;
diff --git a/audio/aidl/default/include/effect-impl/EffectUUID.h b/audio/aidl/default/include/effect-impl/EffectUUID.h
index 1a60829..7703091 100644
--- a/audio/aidl/default/include/effect-impl/EffectUUID.h
+++ b/audio/aidl/default/include/effect-impl/EffectUUID.h
@@ -189,6 +189,18 @@
                                                0x11ed,
                                                0x9b6a,
                                                {0x02, 0x42, 0xac, 0x12, 0x00, 0x02}};
+// 4a387fc0-8ab3-11df-8bad-0002a5d5c51b
+static const AudioUuid kAuxEnvReverbImplUUID = {static_cast<int32_t>(0x4a387fc0),
+                                                0x8ab3,
+                                                0x11df,
+                                                0x8bad,
+                                                {0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b}};
+// c7a511a0-a3bb-11df-860e-0002a5d5c51b
+static const AudioUuid kInsertEnvReverbImplUUID = {static_cast<int32_t>(0xc7a511a0),
+                                                   0xa3bb,
+                                                   0x11df,
+                                                   0x860e,
+                                                   {0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b}};
 // 58b4b260-8e06-11e0-aa8e-0002a5d5c51b
 static const AudioUuid kNoiseSuppressionTypeUUID = {static_cast<int32_t>(0x58b4b260),
                                                     0x8e06,
@@ -213,6 +225,18 @@
                                                   0x11ed,
                                                   0x9b6a,
                                                   {0x02, 0x42, 0xac, 0x12, 0x00, 0x02}};
+// f29a1400-a3bb-11df-8ddc-0002a5d5c51b
+static const AudioUuid kAuxPresetReverbImplUUID = {static_cast<int32_t>(0xf29a1400),
+                                                   0xa3bb,
+                                                   0x11df,
+                                                   0x8ddc,
+                                                   {0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b}};
+// 172cdf00-a3bc-11df-a72f-0002a5d5c51b
+static const AudioUuid kInsertPresetReverbImplUUID = {static_cast<int32_t>(0x172cdf00),
+                                                      0xa3bc,
+                                                      0x11df,
+                                                      0xa72f,
+                                                      {0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b}};
 // 37cc2c00-dddd-11db-8577-0002a5d5c51b
 static const AudioUuid kVirtualizerTypeUUID = {static_cast<int32_t>(0x37cc2c00),
                                                0xdddd,
diff --git a/audio/aidl/default/include/effectFactory-impl/EffectFactory.h b/audio/aidl/default/include/effectFactory-impl/EffectFactory.h
index 04bd1bb..b32ec56 100644
--- a/audio/aidl/default/include/effectFactory-impl/EffectFactory.h
+++ b/audio/aidl/default/include/effectFactory-impl/EffectFactory.h
@@ -101,7 +101,7 @@
 
     ndk::ScopedAStatus destroyEffectImpl(const std::shared_ptr<IEffect>& in_handle);
     void cleanupEffectMap();
-    void openEffectLibrary(const ::aidl::android::media::audio::common::AudioUuid& impl,
+    bool openEffectLibrary(const ::aidl::android::media::audio::common::AudioUuid& impl,
                            const std::string& libName);
     void createIdentityWithConfig(
             const EffectConfig::LibraryUuid& configLib,
diff --git a/audio/aidl/default/main.cpp b/audio/aidl/default/main.cpp
index b66c134..1933509 100644
--- a/audio/aidl/default/main.cpp
+++ b/audio/aidl/default/main.cpp
@@ -55,7 +55,8 @@
         return std::make_pair(module, moduleBinder);
     };
     auto modules = {createModule(Module::Type::DEFAULT, "default"),
-                    createModule(Module::Type::R_SUBMIX, "r_submix")};
+                    createModule(Module::Type::R_SUBMIX, "r_submix"),
+                    createModule(Module::Type::USB, "usb")};
 
     ABinderProcess_joinThreadPool();
     return EXIT_FAILURE;  // should not reach
diff --git a/audio/aidl/vts/ModuleConfig.cpp b/audio/aidl/vts/ModuleConfig.cpp
index 7e4b148..7b002ad 100644
--- a/audio/aidl/vts/ModuleConfig.cpp
+++ b/audio/aidl/vts/ModuleConfig.cpp
@@ -18,6 +18,7 @@
 #include <chrono>
 
 #include <Utils.h>
+#include <aidl/android/media/audio/common/AudioInputFlags.h>
 #include <aidl/android/media/audio/common/AudioIoFlags.h>
 #include <aidl/android/media/audio/common/AudioOutputFlags.h>
 
@@ -32,6 +33,7 @@
 using aidl::android::media::audio::common::AudioEncapsulationMode;
 using aidl::android::media::audio::common::AudioFormatDescription;
 using aidl::android::media::audio::common::AudioFormatType;
+using aidl::android::media::audio::common::AudioInputFlags;
 using aidl::android::media::audio::common::AudioIoFlags;
 using aidl::android::media::audio::common::AudioOffloadInfo;
 using aidl::android::media::audio::common::AudioOutputFlags;
@@ -162,6 +164,20 @@
     });
 }
 
+std::vector<AudioPort> ModuleConfig::getMmapOutMixPorts(bool attachedOnly, bool singlePort) const {
+    return findMixPorts(false /*isInput*/, attachedOnly, singlePort, [&](const AudioPort& port) {
+        return isBitPositionFlagSet(port.flags.get<AudioIoFlags::Tag::output>(),
+                                    AudioOutputFlags::MMAP_NOIRQ);
+    });
+}
+
+std::vector<AudioPort> ModuleConfig::getMmapInMixPorts(bool attachedOnly, bool singlePort) const {
+    return findMixPorts(true /*isInput*/, attachedOnly, singlePort, [&](const AudioPort& port) {
+        return isBitPositionFlagSet(port.flags.get<AudioIoFlags::Tag::input>(),
+                                    AudioInputFlags::MMAP_NOIRQ);
+    });
+}
+
 std::vector<AudioPort> ModuleConfig::getAttachedDevicesPortsForMixPort(
         bool isInput, const AudioPortConfig& mixPortConfig) const {
     const auto mixPortIt = findById<AudioPort>(mPorts, mixPortConfig.portId);
@@ -422,3 +438,11 @@
     }
     return result;
 }
+
+bool ModuleConfig::isMmapSupported() const {
+    const std::vector<AudioPort> mmapOutMixPorts =
+            getMmapOutMixPorts(false /*attachedOnly*/, false /*singlePort*/);
+    const std::vector<AudioPort> mmapInMixPorts =
+            getMmapInMixPorts(false /*attachedOnly*/, false /*singlePort*/);
+    return !mmapOutMixPorts.empty() || !mmapInMixPorts.empty();
+}
diff --git a/audio/aidl/vts/ModuleConfig.h b/audio/aidl/vts/ModuleConfig.h
index 7247f3b..6a22075 100644
--- a/audio/aidl/vts/ModuleConfig.h
+++ b/audio/aidl/vts/ModuleConfig.h
@@ -63,6 +63,10 @@
             bool attachedOnly, bool singlePort) const;
     std::vector<aidl::android::media::audio::common::AudioPort> getPrimaryMixPorts(
             bool attachedOnly, bool singlePort) const;
+    std::vector<aidl::android::media::audio::common::AudioPort> getMmapOutMixPorts(
+            bool attachedOnly, bool singlePort) const;
+    std::vector<aidl::android::media::audio::common::AudioPort> getMmapInMixPorts(
+            bool attachedOnly, bool singlePort) const;
 
     std::vector<aidl::android::media::audio::common::AudioPort> getAttachedDevicesPortsForMixPort(
             bool isInput, const aidl::android::media::audio::common::AudioPort& mixPort) const {
@@ -135,6 +139,8 @@
         return *config.begin();
     }
 
+    bool isMmapSupported() const;
+
     std::string toString() const;
 
   private:
diff --git a/audio/aidl/vts/VtsHalAudioCoreModuleTargetTest.cpp b/audio/aidl/vts/VtsHalAudioCoreModuleTargetTest.cpp
index d4f2811..3ca51c7 100644
--- a/audio/aidl/vts/VtsHalAudioCoreModuleTargetTest.cpp
+++ b/audio/aidl/vts/VtsHalAudioCoreModuleTargetTest.cpp
@@ -40,6 +40,8 @@
 #include <aidl/android/hardware/audio/core/ITelephony.h>
 #include <aidl/android/hardware/audio/core/sounddose/ISoundDose.h>
 #include <aidl/android/media/audio/common/AudioIoFlags.h>
+#include <aidl/android/media/audio/common/AudioMMapPolicyInfo.h>
+#include <aidl/android/media/audio/common/AudioMMapPolicyType.h>
 #include <aidl/android/media/audio/common/AudioOutputFlags.h>
 #include <android-base/chrono_utils.h>
 #include <android/binder_enums.h>
@@ -54,7 +56,6 @@
 using aidl::android::hardware::audio::common::RecordTrackMetadata;
 using aidl::android::hardware::audio::common::SinkMetadata;
 using aidl::android::hardware::audio::common::SourceMetadata;
-using aidl::android::hardware::audio::core::AudioMode;
 using aidl::android::hardware::audio::core::AudioPatch;
 using aidl::android::hardware::audio::core::AudioRoute;
 using aidl::android::hardware::audio::core::IBluetooth;
@@ -78,6 +79,9 @@
 using aidl::android::media::audio::common::AudioFormatType;
 using aidl::android::media::audio::common::AudioIoFlags;
 using aidl::android::media::audio::common::AudioLatencyMode;
+using aidl::android::media::audio::common::AudioMMapPolicyInfo;
+using aidl::android::media::audio::common::AudioMMapPolicyType;
+using aidl::android::media::audio::common::AudioMode;
 using aidl::android::media::audio::common::AudioOutputFlags;
 using aidl::android::media::audio::common::AudioPlaybackRate;
 using aidl::android::media::audio::common::AudioPort;
@@ -93,6 +97,7 @@
 using android::hardware::audio::common::getChannelCount;
 using android::hardware::audio::common::isBitPositionFlagSet;
 using android::hardware::audio::common::isTelephonyDeviceType;
+using android::hardware::audio::common::isValidAudioMode;
 using android::hardware::audio::common::StreamLogic;
 using android::hardware::audio::common::StreamWorker;
 using ndk::enum_range;
@@ -1805,7 +1810,11 @@
 
 TEST_P(AudioCoreModule, UpdateAudioMode) {
     for (const auto mode : ::ndk::enum_range<AudioMode>()) {
-        EXPECT_IS_OK(module->updateAudioMode(mode)) << toString(mode);
+        if (isValidAudioMode(mode)) {
+            EXPECT_IS_OK(module->updateAudioMode(mode)) << toString(mode);
+        } else {
+            EXPECT_STATUS(EX_ILLEGAL_ARGUMENT, module->updateAudioMode(mode)) << toString(mode);
+        }
     }
     EXPECT_IS_OK(module->updateAudioMode(AudioMode::NORMAL));
 }
@@ -1882,6 +1891,51 @@
     }
 }
 
+TEST_P(AudioCoreModule, GetMmapPolicyInfos) {
+    ASSERT_NO_FATAL_FAILURE(SetUpModuleConfig());
+    const bool isMmapSupported = moduleConfig->isMmapSupported();
+    for (const auto mmapPolicyType :
+         {AudioMMapPolicyType::DEFAULT, AudioMMapPolicyType::EXCLUSIVE}) {
+        std::vector<AudioMMapPolicyInfo> policyInfos;
+        EXPECT_IS_OK(module->getMmapPolicyInfos(mmapPolicyType, &policyInfos))
+                << toString(mmapPolicyType);
+        EXPECT_EQ(isMmapSupported, !policyInfos.empty());
+    }
+}
+
+TEST_P(AudioCoreModule, BluetoothVariableLatency) {
+    bool isSupported = false;
+    EXPECT_IS_OK(module->supportsVariableLatency(&isSupported));
+    LOG(INFO) << "supportsVariableLatency: " << isSupported;
+}
+
+TEST_P(AudioCoreModule, GetAAudioMixerBurstCount) {
+    ASSERT_NO_FATAL_FAILURE(SetUpModuleConfig());
+    const bool isMmapSupported = moduleConfig->isMmapSupported();
+    int32_t mixerBursts = 0;
+    ndk::ScopedAStatus status = module->getAAudioMixerBurstCount(&mixerBursts);
+    EXPECT_EQ(isMmapSupported, status.getExceptionCode() != EX_UNSUPPORTED_OPERATION)
+            << "Support for AAudio MMAP and getting AAudio mixer burst count must be consistent";
+    if (!isMmapSupported) {
+        GTEST_SKIP() << "AAudio MMAP is not supported";
+    }
+    EXPECT_GE(mixerBursts, 0);
+}
+
+TEST_P(AudioCoreModule, GetAAudioHardwareBurstMinUsec) {
+    ASSERT_NO_FATAL_FAILURE(SetUpModuleConfig());
+    const bool isMmapSupported = moduleConfig->isMmapSupported();
+    int32_t aaudioHardwareBurstMinUsec = 0;
+    ndk::ScopedAStatus status = module->getAAudioHardwareBurstMinUsec(&aaudioHardwareBurstMinUsec);
+    EXPECT_EQ(isMmapSupported, status.getExceptionCode() != EX_UNSUPPORTED_OPERATION)
+            << "Support for AAudio MMAP and getting AAudio hardware burst minimum usec "
+            << "must be consistent";
+    if (!isMmapSupported) {
+        GTEST_SKIP() << "AAudio MMAP is not supported";
+    }
+    EXPECT_GE(aaudioHardwareBurstMinUsec, 0);
+}
+
 class AudioCoreBluetooth : public AudioCoreModuleBase, public testing::TestWithParam<std::string> {
   public:
     void SetUp() override {
@@ -1994,6 +2048,9 @@
     }
     std::vector<AudioMode> modes1;
     ASSERT_IS_OK(telephony->getSupportedAudioModes(&modes1));
+    for (const auto mode : modes1) {
+        EXPECT_TRUE(isValidAudioMode(mode)) << toString(mode);
+    }
     const std::vector<AudioMode> kMandatoryModes = {AudioMode::NORMAL, AudioMode::RINGTONE,
                                                     AudioMode::IN_CALL,
                                                     AudioMode::IN_COMMUNICATION};
@@ -2025,7 +2082,9 @@
         unsupportedModes.erase(mode);
     }
     for (const auto mode : unsupportedModes) {
-        EXPECT_STATUS(EX_UNSUPPORTED_OPERATION, telephony->switchAudioMode(mode)) << toString(mode);
+        EXPECT_STATUS(isValidAudioMode(mode) ? EX_UNSUPPORTED_OPERATION : EX_ILLEGAL_ARGUMENT,
+                      telephony->switchAudioMode(mode))
+                << toString(mode);
     }
 }
 
@@ -2314,7 +2373,7 @@
 
     void HwGainHwVolume() {
         const auto ports =
-                moduleConfig->getMixPorts(IOTraits<Stream>::is_input, false /*attachedOnly*/);
+                moduleConfig->getMixPorts(IOTraits<Stream>::is_input, true /*attachedOnly*/);
         if (ports.empty()) {
             GTEST_SKIP() << "No mix ports";
         }
@@ -2353,7 +2412,7 @@
     // it as an invalid argument, or say that offloaded effects are not supported.
     void AddRemoveEffectInvalidArguments() {
         const auto ports =
-                moduleConfig->getMixPorts(IOTraits<Stream>::is_input, false /*attachedOnly*/);
+                moduleConfig->getMixPorts(IOTraits<Stream>::is_input, true /*attachedOnly*/);
         if (ports.empty()) {
             GTEST_SKIP() << "No mix ports";
         }
@@ -2634,7 +2693,7 @@
 }
 
 TEST_P(AudioStreamOut, AudioDescriptionMixLevel) {
-    const auto ports = moduleConfig->getOutputMixPorts(false /*attachedOnly*/);
+    const auto ports = moduleConfig->getOutputMixPorts(true /*attachedOnly*/);
     if (ports.empty()) {
         GTEST_SKIP() << "No output mix ports";
     }
@@ -2662,7 +2721,7 @@
 }
 
 TEST_P(AudioStreamOut, DualMonoMode) {
-    const auto ports = moduleConfig->getOutputMixPorts(false /*attachedOnly*/);
+    const auto ports = moduleConfig->getOutputMixPorts(true /*attachedOnly*/);
     if (ports.empty()) {
         GTEST_SKIP() << "No output mix ports";
     }
@@ -2686,7 +2745,7 @@
 }
 
 TEST_P(AudioStreamOut, LatencyMode) {
-    const auto ports = moduleConfig->getOutputMixPorts(false /*attachedOnly*/);
+    const auto ports = moduleConfig->getOutputMixPorts(true /*attachedOnly*/);
     if (ports.empty()) {
         GTEST_SKIP() << "No output mix ports";
     }
diff --git a/audio/aidl/vts/VtsHalAudioEffectTargetTest.cpp b/audio/aidl/vts/VtsHalAudioEffectTargetTest.cpp
index 8938618..c5a0943 100644
--- a/audio/aidl/vts/VtsHalAudioEffectTargetTest.cpp
+++ b/audio/aidl/vts/VtsHalAudioEffectTargetTest.cpp
@@ -47,6 +47,10 @@
 using aidl::android::hardware::audio::effect::IFactory;
 using aidl::android::hardware::audio::effect::Parameter;
 using aidl::android::hardware::audio::effect::State;
+using aidl::android::media::audio::common::AudioDeviceDescription;
+using aidl::android::media::audio::common::AudioDeviceType;
+using aidl::android::media::audio::common::AudioMode;
+using aidl::android::media::audio::common::AudioSource;
 
 enum ParamName { PARAM_INSTANCE_NAME };
 using EffectTestParam = std::tuple<std::pair<std::shared_ptr<IFactory>, Descriptor>>;
@@ -73,6 +77,13 @@
     std::shared_ptr<IFactory> mFactory;
     std::shared_ptr<IEffect> mEffect;
     Descriptor mDescriptor;
+
+    void setAndGetParameter(Parameter::Id id, const Parameter& set) {
+        Parameter get;
+        EXPECT_IS_OK(mEffect->setParameter(set));
+        EXPECT_IS_OK(mEffect->getParameter(id, &get));
+        EXPECT_EQ(set, get) << set.toString() << " vs " << get.toString();
+    }
 };
 
 TEST_P(AudioEffectTest, SetupAndTearDown) {
@@ -392,14 +403,8 @@
 
     Parameter::Common common = EffectHelper::createParamCommon(
             0 /* session */, 1 /* ioHandle */, 44100 /* iSampleRate */, 44100 /* oSampleRate */);
-    Parameter get = Parameter(), set = Parameter();
-    set.set<Parameter::common>(common);
-    EXPECT_IS_OK(mEffect->setParameter(set));
-
-    Parameter::Id id;
-    id.set<Parameter::Id::commonTag>(Parameter::common);
-    EXPECT_IS_OK(mEffect->getParameter(id, &get));
-    EXPECT_EQ(set, get) << set.toString() << " vs " << get.toString();
+    Parameter::Id id = Parameter::Id::make<Parameter::Id::commonTag>(Parameter::common);
+    ASSERT_NO_FATAL_FAILURE(setAndGetParameter(id, Parameter::make<Parameter::common>(common)));
 
     ASSERT_NO_FATAL_FAILURE(close(mEffect));
     ASSERT_NO_FATAL_FAILURE(destroy(mFactory, mEffect));
@@ -414,14 +419,8 @@
 
     Parameter::Common common = EffectHelper::createParamCommon(
             0 /* session */, 1 /* ioHandle */, 44100 /* iSampleRate */, 44100 /* oSampleRate */);
-    Parameter get = Parameter(), set = Parameter();
-    set.set<Parameter::common>(common);
-    EXPECT_IS_OK(mEffect->setParameter(set));
-
-    Parameter::Id id;
-    id.set<Parameter::Id::commonTag>(Parameter::common);
-    EXPECT_IS_OK(mEffect->getParameter(id, &get));
-    EXPECT_EQ(set, get) << set.toString() << " vs " << get.toString();
+    Parameter::Id id = Parameter::Id::make<Parameter::Id::commonTag>(Parameter::common);
+    ASSERT_NO_FATAL_FAILURE(setAndGetParameter(id, Parameter::make<Parameter::common>(common)));
 
     ASSERT_NO_FATAL_FAILURE(command(mEffect, CommandId::STOP));
     ASSERT_NO_FATAL_FAILURE(close(mEffect));
@@ -439,14 +438,8 @@
 
     Parameter::Common common = EffectHelper::createParamCommon(
             0 /* session */, 1 /* ioHandle */, 44100 /* iSampleRate */, 44100 /* oSampleRate */);
-    Parameter get = Parameter(), set = Parameter();
-    set.set<Parameter::common>(common);
-    EXPECT_IS_OK(mEffect->setParameter(set));
-
-    Parameter::Id id;
-    id.set<Parameter::Id::commonTag>(Parameter::common);
-    EXPECT_IS_OK(mEffect->getParameter(id, &get));
-    EXPECT_EQ(set, get) << set.toString() << " vs " << get.toString();
+    Parameter::Id id = Parameter::Id::make<Parameter::Id::commonTag>(Parameter::common);
+    ASSERT_NO_FATAL_FAILURE(setAndGetParameter(id, Parameter::make<Parameter::common>(common)));
 
     ASSERT_NO_FATAL_FAILURE(close(mEffect));
     ASSERT_NO_FATAL_FAILURE(destroy(mFactory, mEffect));
@@ -461,18 +454,11 @@
 
     Parameter::Common common = EffectHelper::createParamCommon(
             0 /* session */, 1 /* ioHandle */, 44100 /* iSampleRate */, 44100 /* oSampleRate */);
-    Parameter get = Parameter(), set = Parameter();
-    set.set<Parameter::common>(common);
-    EXPECT_IS_OK(mEffect->setParameter(set));
+    Parameter::Id id = Parameter::Id::make<Parameter::Id::commonTag>(Parameter::common);
+    ASSERT_NO_FATAL_FAILURE(setAndGetParameter(id, Parameter::make<Parameter::common>(common)));
 
     ASSERT_NO_FATAL_FAILURE(command(mEffect, CommandId::STOP));
     ASSERT_NO_FATAL_FAILURE(expectState(mEffect, State::IDLE));
-
-    Parameter::Id id;
-    id.set<Parameter::Id::commonTag>(Parameter::common);
-    EXPECT_IS_OK(mEffect->getParameter(id, &get));
-    EXPECT_EQ(set, get) << set.toString() << " vs " << get.toString();
-
     ASSERT_NO_FATAL_FAILURE(close(mEffect));
     ASSERT_NO_FATAL_FAILURE(destroy(mFactory, mEffect));
 }
@@ -487,21 +473,102 @@
 
     Parameter::Common common = EffectHelper::createParamCommon(
             0 /* session */, 1 /* ioHandle */, 44100 /* iSampleRate */, 44100 /* oSampleRate */);
-    Parameter get = Parameter(), set = Parameter();
-    set.set<Parameter::common>(common);
-    EXPECT_IS_OK(mEffect->setParameter(set));
+    Parameter::Id id = Parameter::Id::make<Parameter::Id::commonTag>(Parameter::common);
+    ASSERT_NO_FATAL_FAILURE(setAndGetParameter(id, Parameter::make<Parameter::common>(common)));
 
     ASSERT_NO_FATAL_FAILURE(command(mEffect, CommandId::RESET));
     ASSERT_NO_FATAL_FAILURE(expectState(mEffect, State::IDLE));
 
-    Parameter::Id id;
-    id.set<Parameter::Id::commonTag>(Parameter::common);
-    EXPECT_IS_OK(mEffect->getParameter(id, &get));
-    EXPECT_EQ(set, get) << set.toString() << " vs " << get.toString();
+    ASSERT_NO_FATAL_FAILURE(setAndGetParameter(id, Parameter::make<Parameter::common>(common)));
 
+    ASSERT_NO_FATAL_FAILURE(command(mEffect, CommandId::STOP));
+    ASSERT_NO_FATAL_FAILURE(expectState(mEffect, State::IDLE));
     ASSERT_NO_FATAL_FAILURE(close(mEffect));
     ASSERT_NO_FATAL_FAILURE(destroy(mFactory, mEffect));
 }
+
+// Set and get AudioDeviceDescription in Parameter
+TEST_P(AudioEffectTest, SetAndGetParameterDeviceDescription) {
+    ASSERT_NO_FATAL_FAILURE(create(mFactory, mEffect, mDescriptor));
+    ASSERT_NO_FATAL_FAILURE(open(mEffect));
+
+    ASSERT_NO_FATAL_FAILURE(command(mEffect, CommandId::START));
+    ASSERT_NO_FATAL_FAILURE(expectState(mEffect, State::PROCESSING));
+
+    std::vector<AudioDeviceDescription> deviceDescs = {
+            {.type = AudioDeviceType::IN_DEFAULT,
+             .connection = AudioDeviceDescription::CONNECTION_ANALOG},
+            {.type = AudioDeviceType::IN_DEVICE,
+             .connection = AudioDeviceDescription::CONNECTION_BT_A2DP}};
+    Parameter::Id id = Parameter::Id::make<Parameter::Id::commonTag>(Parameter::deviceDescription);
+    ASSERT_NO_FATAL_FAILURE(
+            setAndGetParameter(id, Parameter::make<Parameter::deviceDescription>(deviceDescs)));
+
+    ASSERT_NO_FATAL_FAILURE(command(mEffect, CommandId::STOP));
+    ASSERT_NO_FATAL_FAILURE(expectState(mEffect, State::IDLE));
+    ASSERT_NO_FATAL_FAILURE(close(mEffect));
+    ASSERT_NO_FATAL_FAILURE(destroy(mFactory, mEffect));
+}
+
+// Set and get AudioMode in Parameter
+TEST_P(AudioEffectTest, SetAndGetParameterAudioMode) {
+    ASSERT_NO_FATAL_FAILURE(create(mFactory, mEffect, mDescriptor));
+    ASSERT_NO_FATAL_FAILURE(open(mEffect));
+
+    ASSERT_NO_FATAL_FAILURE(command(mEffect, CommandId::START));
+    ASSERT_NO_FATAL_FAILURE(expectState(mEffect, State::PROCESSING));
+
+    Parameter::Id id = Parameter::Id::make<Parameter::Id::commonTag>(Parameter::mode);
+    ASSERT_NO_FATAL_FAILURE(
+            setAndGetParameter(id, Parameter::make<Parameter::mode>(AudioMode::NORMAL)));
+    ASSERT_NO_FATAL_FAILURE(
+            setAndGetParameter(id, Parameter::make<Parameter::mode>(AudioMode::IN_COMMUNICATION)));
+
+    ASSERT_NO_FATAL_FAILURE(command(mEffect, CommandId::STOP));
+    ASSERT_NO_FATAL_FAILURE(expectState(mEffect, State::IDLE));
+    ASSERT_NO_FATAL_FAILURE(close(mEffect));
+    ASSERT_NO_FATAL_FAILURE(destroy(mFactory, mEffect));
+}
+
+// Set and get AudioSource in Parameter
+TEST_P(AudioEffectTest, SetAndGetParameterAudioSource) {
+    ASSERT_NO_FATAL_FAILURE(create(mFactory, mEffect, mDescriptor));
+    ASSERT_NO_FATAL_FAILURE(open(mEffect));
+
+    ASSERT_NO_FATAL_FAILURE(command(mEffect, CommandId::START));
+    ASSERT_NO_FATAL_FAILURE(expectState(mEffect, State::PROCESSING));
+
+    Parameter::Id id = Parameter::Id::make<Parameter::Id::commonTag>(Parameter::source);
+    ASSERT_NO_FATAL_FAILURE(
+            setAndGetParameter(id, Parameter::make<Parameter::source>(AudioSource::DEFAULT)));
+    ASSERT_NO_FATAL_FAILURE(setAndGetParameter(
+            id, Parameter::make<Parameter::source>(AudioSource::VOICE_RECOGNITION)));
+
+    ASSERT_NO_FATAL_FAILURE(command(mEffect, CommandId::STOP));
+    ASSERT_NO_FATAL_FAILURE(expectState(mEffect, State::IDLE));
+    ASSERT_NO_FATAL_FAILURE(close(mEffect));
+    ASSERT_NO_FATAL_FAILURE(destroy(mFactory, mEffect));
+}
+
+// Set and get VolumeStereo in Parameter
+TEST_P(AudioEffectTest, SetAndGetParameterVolume) {
+    ASSERT_NO_FATAL_FAILURE(create(mFactory, mEffect, mDescriptor));
+    ASSERT_NO_FATAL_FAILURE(open(mEffect));
+
+    ASSERT_NO_FATAL_FAILURE(command(mEffect, CommandId::START));
+    ASSERT_NO_FATAL_FAILURE(expectState(mEffect, State::PROCESSING));
+
+    Parameter::Id id = Parameter::Id::make<Parameter::Id::commonTag>(Parameter::volumeStereo);
+    Parameter::VolumeStereo volume = {.left = 10.0, .right = 10.0};
+    ASSERT_NO_FATAL_FAILURE(
+            setAndGetParameter(id, Parameter::make<Parameter::volumeStereo>(volume)));
+
+    ASSERT_NO_FATAL_FAILURE(command(mEffect, CommandId::STOP));
+    ASSERT_NO_FATAL_FAILURE(expectState(mEffect, State::IDLE));
+    ASSERT_NO_FATAL_FAILURE(close(mEffect));
+    ASSERT_NO_FATAL_FAILURE(destroy(mFactory, mEffect));
+}
+
 /// Data processing test
 // Send data to effects and expect it to be consumed by checking statusMQ.
 TEST_P(AudioEffectTest, ConsumeDataInProcessingState) {
diff --git a/audio/effect/all-versions/default/Effect.cpp b/audio/effect/all-versions/default/Effect.cpp
index 87e1ab7..5aecd32 100644
--- a/audio/effect/all-versions/default/Effect.cpp
+++ b/audio/effect/all-versions/default/Effect.cpp
@@ -240,16 +240,6 @@
 };
 
 bool ProcessThread::threadLoop() {
-    // For a spatializer effect, we perform scheduler adjustments to reduce glitches and power.
-    {
-        effect_descriptor_t halDescriptor{};
-        if ((*mEffect)->get_descriptor(mEffect, &halDescriptor) == NO_ERROR &&
-            memcmp(&halDescriptor.type, FX_IID_SPATIALIZER, sizeof(effect_uuid_t)) == 0) {
-            const status_t status = scheduler::updateSpatializerPriority(gettid());
-            ALOGW_IF(status != OK, "Failed to update Spatializer priority");
-        }
-    }
-
     // This implementation doesn't return control back to the Thread until it decides to stop,
     // as the Thread uses mutexes, and this can lead to priority inversion.
     while (!std::atomic_load_explicit(mStop, std::memory_order_acquire)) {
@@ -570,6 +560,15 @@
         return Void();
     }
 
+    // For a spatializer effect, we perform scheduler adjustments to reduce glitches and power.
+    // We do it here instead of the ProcessThread::threadLoop to ensure that mHandle is valid.
+    if (effect_descriptor_t halDescriptor{};
+        (*mHandle)->get_descriptor(mHandle, &halDescriptor) == NO_ERROR &&
+        memcmp(&halDescriptor.type, FX_IID_SPATIALIZER, sizeof(effect_uuid_t)) == 0) {
+        const status_t status = scheduler::updateSpatializerPriority(mProcessThread->getTid());
+        ALOGW_IF(status != OK, "Failed to update Spatializer priority");
+    }
+
     mStatusMQ = std::move(tempStatusMQ);
     _hidl_cb(Result::OK, *mStatusMQ->getDesc());
     return Void();
diff --git a/automotive/can/1.0/tools/configurator/Android.bp b/automotive/can/1.0/tools/configurator/Android.bp
index cc826bc..883d2a9 100644
--- a/automotive/can/1.0/tools/configurator/Android.bp
+++ b/automotive/can/1.0/tools/configurator/Android.bp
@@ -40,4 +40,5 @@
         "android.hardware.automotive.can@1.x-config-format",
         "android.hardware.automotive.can@libcanhaltools",
     ],
+    system_ext_specific: true,
 }
diff --git a/automotive/can/1.0/tools/configurator/canhalconfigurator.rc b/automotive/can/1.0/tools/configurator/canhalconfigurator.rc
index 12c2465..ff0efd7 100644
--- a/automotive/can/1.0/tools/configurator/canhalconfigurator.rc
+++ b/automotive/can/1.0/tools/configurator/canhalconfigurator.rc
@@ -1,3 +1,3 @@
-service canhalconfigurator /system/bin/canhalconfigurator
+service canhalconfigurator /system_ext/bin/canhalconfigurator
   class core
   oneshot
diff --git a/automotive/can/aidl/default/tools/configurator/Android.bp b/automotive/can/aidl/default/tools/configurator/Android.bp
index 1169894..4c569e6 100644
--- a/automotive/can/aidl/default/tools/configurator/Android.bp
+++ b/automotive/can/aidl/default/tools/configurator/Android.bp
@@ -40,4 +40,5 @@
         "android.hardware.automotive.can-V1-ndk",
         "android.hardware.automotive.can-aidl-config-format",
     ],
+    system_ext_specific: true,
 }
diff --git a/automotive/can/aidl/default/tools/configurator/canhalconfigurator-aidl.rc b/automotive/can/aidl/default/tools/configurator/canhalconfigurator-aidl.rc
index e1b4d35..08b1e7b 100644
--- a/automotive/can/aidl/default/tools/configurator/canhalconfigurator-aidl.rc
+++ b/automotive/can/aidl/default/tools/configurator/canhalconfigurator-aidl.rc
@@ -1,3 +1,3 @@
-service canhalconfigurator /system/bin/canhalconfigurator-aidl
+service canhalconfigurator /system_ext/bin/canhalconfigurator-aidl
   class core
   oneshot
diff --git a/automotive/evs/aidl/vts/VtsHalEvsTargetTest.cpp b/automotive/evs/aidl/vts/VtsHalEvsTargetTest.cpp
index 3cab204..2706c49 100644
--- a/automotive/evs/aidl/vts/VtsHalEvsTargetTest.cpp
+++ b/automotive/evs/aidl/vts/VtsHalEvsTargetTest.cpp
@@ -619,6 +619,7 @@
         getPhysicalCameraIds(cam.id, isLogicalCam);
         if (mIsHwModule && isLogicalCam) {
             LOG(INFO) << "Skip a logical device " << cam.id << " for HW target.";
+            ASSERT_TRUE(mEnumerator->closeDisplay(pDisplay).isOk());
             continue;
         }
 
@@ -1437,7 +1438,8 @@
         ASSERT_TRUE(pCam1->getParameterList(&cam1Cmds).isOk());
         if (cam0Cmds.size() < 1 || cam1Cmds.size() < 1) {
             // Cannot execute this test.
-            return;
+            ASSERT_TRUE(mEnumerator->closeDisplay(pDisplay).isOk());
+            continue;
         }
 
         // Set up a frame receiver object which will fire up its own thread.
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 e803e81..cfa3b0c 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
@@ -144,7 +144,7 @@
                                          (int)VehicleUnit::MILES_PER_HOUR,
                                          (int)VehicleUnit::KILOMETERS_PER_HOUR},
                  },
-         .initialValue = {.int32Values = {(int)VehicleUnit::KILOMETERS_PER_HOUR}}},
+         .initialValue = {.int32Values = {(int)VehicleUnit::MILES_PER_HOUR}}},
 
         {.config =
                  {
@@ -379,7 +379,7 @@
                          .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
                          .configArray = {(int)VehicleUnit::LITER, (int)VehicleUnit::US_GALLON},
                  },
-         .initialValue = {.int32Values = {(int)VehicleUnit::LITER}}},
+         .initialValue = {.int32Values = {(int)VehicleUnit::US_GALLON}}},
 
         {.config =
                  {
diff --git a/automotive/vehicle/Android.bp b/automotive/vehicle/Android.bp
index f4a7cd1..c0d71d7 100644
--- a/automotive/vehicle/Android.bp
+++ b/automotive/vehicle/Android.bp
@@ -22,5 +22,6 @@
     name: "VehicleHalInterfaceDefaults",
     static_libs: [
         "android.hardware.automotive.vehicle-V2-ndk",
+        "android.hardware.automotive.vehicle.property-V2-ndk",
     ],
 }
diff --git a/automotive/vehicle/aidl/Android.bp b/automotive/vehicle/aidl/Android.bp
index 18a5046..9c8d9c5 100644
--- a/automotive/vehicle/aidl/Android.bp
+++ b/automotive/vehicle/aidl/Android.bp
@@ -25,7 +25,7 @@
     name: "android.hardware.automotive.vehicle",
     vendor_available: true,
     srcs: [
-        "android/hardware/automotive/vehicle/**/*.aidl",
+        "android/hardware/automotive/vehicle/*.aidl",
     ],
     frozen: false,
     stability: "vintf",
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/.hash b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/.hash
index f478504..d9fd5ad 100644
--- a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/.hash
+++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/.hash
@@ -1 +1,2 @@
 8610b651e162c614a97542d6f4ed039c969823e5
+0678e142246842695c1ba0524592fe2c3b789fc6
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleProperty.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleProperty.aidl
deleted file mode 100644
index 914787e..0000000
--- a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleProperty.aidl
+++ /dev/null
@@ -1,250 +0,0 @@
-/*
- * Copyright (C) 2021 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-///////////////////////////////////////////////////////////////////////////////
-// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE.                          //
-///////////////////////////////////////////////////////////////////////////////
-
-// This file is a snapshot of an AIDL file. Do not edit it manually. There are
-// two cases:
-// 1). this is a frozen version file - do not edit this in any case.
-// 2). this is a 'current' file. If you make a backwards compatible change to
-//     the interface (from the latest frozen version), the build system will
-//     prompt you to update this file with `m <name>-update-api`.
-//
-// You must not make a backward incompatible change to any AIDL file built
-// with the aidl_interface module type with versions property set. The module
-// type is used to build AIDL files in a way that they can be used across
-// independently updatable components of the system. If a device is shipped
-// with such a backward incompatible change, it has a high risk of breaking
-// later when a module using the interface is updated, e.g., Mainline modules.
-
-package android.hardware.automotive.vehicle;
-@Backing(type="int") @VintfStability
-enum VehicleProperty {
-  INVALID = 0,
-  INFO_VIN = 286261504,
-  INFO_MAKE = 286261505,
-  INFO_MODEL = 286261506,
-  INFO_MODEL_YEAR = 289407235,
-  INFO_FUEL_CAPACITY = 291504388,
-  INFO_FUEL_TYPE = 289472773,
-  INFO_EV_BATTERY_CAPACITY = 291504390,
-  INFO_EV_CONNECTOR_TYPE = 289472775,
-  INFO_FUEL_DOOR_LOCATION = 289407240,
-  INFO_EV_PORT_LOCATION = 289407241,
-  INFO_DRIVER_SEAT = 356516106,
-  INFO_EXTERIOR_DIMENSIONS = 289472779,
-  INFO_MULTI_EV_PORT_LOCATIONS = 289472780,
-  PERF_ODOMETER = 291504644,
-  PERF_VEHICLE_SPEED = 291504647,
-  PERF_VEHICLE_SPEED_DISPLAY = 291504648,
-  PERF_STEERING_ANGLE = 291504649,
-  PERF_REAR_STEERING_ANGLE = 291504656,
-  ENGINE_COOLANT_TEMP = 291504897,
-  ENGINE_OIL_LEVEL = 289407747,
-  ENGINE_OIL_TEMP = 291504900,
-  ENGINE_RPM = 291504901,
-  WHEEL_TICK = 290521862,
-  FUEL_LEVEL = 291504903,
-  FUEL_DOOR_OPEN = 287310600,
-  EV_BATTERY_LEVEL = 291504905,
-  EV_CURRENT_BATTERY_CAPACITY = 291504909,
-  EV_CHARGE_PORT_OPEN = 287310602,
-  EV_CHARGE_PORT_CONNECTED = 287310603,
-  EV_BATTERY_INSTANTANEOUS_CHARGE_RATE = 291504908,
-  RANGE_REMAINING = 291504904,
-  TIRE_PRESSURE = 392168201,
-  CRITICALLY_LOW_TIRE_PRESSURE = 392168202,
-  ENGINE_IDLE_AUTO_STOP_ENABLED = 287310624,
-  GEAR_SELECTION = 289408000,
-  CURRENT_GEAR = 289408001,
-  PARKING_BRAKE_ON = 287310850,
-  PARKING_BRAKE_AUTO_APPLY = 287310851,
-  EV_BRAKE_REGENERATION_LEVEL = 289408012,
-  FUEL_LEVEL_LOW = 287310853,
-  NIGHT_MODE = 287310855,
-  TURN_SIGNAL_STATE = 289408008,
-  IGNITION_STATE = 289408009,
-  ABS_ACTIVE = 287310858,
-  TRACTION_CONTROL_ACTIVE = 287310859,
-  EV_STOPPING_MODE = 289408013,
-  HVAC_FAN_SPEED = 356517120,
-  HVAC_FAN_DIRECTION = 356517121,
-  HVAC_TEMPERATURE_CURRENT = 358614274,
-  HVAC_TEMPERATURE_SET = 358614275,
-  HVAC_DEFROSTER = 320865540,
-  HVAC_AC_ON = 354419973,
-  HVAC_MAX_AC_ON = 354419974,
-  HVAC_MAX_DEFROST_ON = 354419975,
-  HVAC_RECIRC_ON = 354419976,
-  HVAC_DUAL_ON = 354419977,
-  HVAC_AUTO_ON = 354419978,
-  HVAC_SEAT_TEMPERATURE = 356517131,
-  HVAC_SIDE_MIRROR_HEAT = 339739916,
-  HVAC_STEERING_WHEEL_HEAT = 289408269,
-  HVAC_TEMPERATURE_DISPLAY_UNITS = 289408270,
-  HVAC_ACTUAL_FAN_SPEED_RPM = 356517135,
-  HVAC_POWER_ON = 354419984,
-  HVAC_FAN_DIRECTION_AVAILABLE = 356582673,
-  HVAC_AUTO_RECIRC_ON = 354419986,
-  HVAC_SEAT_VENTILATION = 356517139,
-  HVAC_ELECTRIC_DEFROSTER_ON = 320865556,
-  HVAC_TEMPERATURE_VALUE_SUGGESTION = 291570965,
-  DISTANCE_DISPLAY_UNITS = 289408512,
-  FUEL_VOLUME_DISPLAY_UNITS = 289408513,
-  TIRE_PRESSURE_DISPLAY_UNITS = 289408514,
-  EV_BATTERY_DISPLAY_UNITS = 289408515,
-  FUEL_CONSUMPTION_UNITS_DISTANCE_OVER_VOLUME = 287311364,
-  VEHICLE_SPEED_DISPLAY_UNITS = 289408517,
-  EXTERNAL_CAR_TIME = 290457096,
-  ANDROID_EPOCH_TIME = 290457094,
-  STORAGE_ENCRYPTION_BINDING_SEED = 292554247,
-  ENV_OUTSIDE_TEMPERATURE = 291505923,
-  AP_POWER_STATE_REQ = 289475072,
-  AP_POWER_STATE_REPORT = 289475073,
-  AP_POWER_BOOTUP_REASON = 289409538,
-  DISPLAY_BRIGHTNESS = 289409539,
-  HW_KEY_INPUT = 289475088,
-  HW_KEY_INPUT_V2 = 367004177,
-  HW_MOTION_INPUT = 367004178,
-  HW_ROTARY_INPUT = 289475104,
-  HW_CUSTOM_INPUT = 289475120,
-  DOOR_POS = 373295872,
-  DOOR_MOVE = 373295873,
-  DOOR_LOCK = 371198722,
-  DOOR_CHILD_LOCK_ENABLED = 371198723,
-  MIRROR_Z_POS = 339741504,
-  MIRROR_Z_MOVE = 339741505,
-  MIRROR_Y_POS = 339741506,
-  MIRROR_Y_MOVE = 339741507,
-  MIRROR_LOCK = 287312708,
-  MIRROR_FOLD = 287312709,
-  MIRROR_AUTO_FOLD_ENABLED = 337644358,
-  MIRROR_AUTO_TILT_ENABLED = 337644359,
-  SEAT_MEMORY_SELECT = 356518784,
-  SEAT_MEMORY_SET = 356518785,
-  SEAT_BELT_BUCKLED = 354421634,
-  SEAT_BELT_HEIGHT_POS = 356518787,
-  SEAT_BELT_HEIGHT_MOVE = 356518788,
-  SEAT_FORE_AFT_POS = 356518789,
-  SEAT_FORE_AFT_MOVE = 356518790,
-  SEAT_BACKREST_ANGLE_1_POS = 356518791,
-  SEAT_BACKREST_ANGLE_1_MOVE = 356518792,
-  SEAT_BACKREST_ANGLE_2_POS = 356518793,
-  SEAT_BACKREST_ANGLE_2_MOVE = 356518794,
-  SEAT_HEIGHT_POS = 356518795,
-  SEAT_HEIGHT_MOVE = 356518796,
-  SEAT_DEPTH_POS = 356518797,
-  SEAT_DEPTH_MOVE = 356518798,
-  SEAT_TILT_POS = 356518799,
-  SEAT_TILT_MOVE = 356518800,
-  SEAT_LUMBAR_FORE_AFT_POS = 356518801,
-  SEAT_LUMBAR_FORE_AFT_MOVE = 356518802,
-  SEAT_LUMBAR_SIDE_SUPPORT_POS = 356518803,
-  SEAT_LUMBAR_SIDE_SUPPORT_MOVE = 356518804,
-  SEAT_HEADREST_HEIGHT_POS = 289409941,
-  SEAT_HEADREST_HEIGHT_POS_V2 = 356518820,
-  SEAT_HEADREST_HEIGHT_MOVE = 356518806,
-  SEAT_HEADREST_ANGLE_POS = 356518807,
-  SEAT_HEADREST_ANGLE_MOVE = 356518808,
-  SEAT_HEADREST_FORE_AFT_POS = 356518809,
-  SEAT_HEADREST_FORE_AFT_MOVE = 356518810,
-  SEAT_FOOTWELL_LIGHTS_STATE = 356518811,
-  SEAT_FOOTWELL_LIGHTS_SWITCH = 356518812,
-  SEAT_EASY_ACCESS_ENABLED = 354421661,
-  SEAT_AIRBAG_ENABLED = 354421662,
-  SEAT_CUSHION_SIDE_SUPPORT_POS = 356518815,
-  SEAT_CUSHION_SIDE_SUPPORT_MOVE = 356518816,
-  SEAT_LUMBAR_VERTICAL_POS = 356518817,
-  SEAT_LUMBAR_VERTICAL_MOVE = 356518818,
-  SEAT_WALK_IN_POS = 356518819,
-  SEAT_OCCUPANCY = 356518832,
-  WINDOW_POS = 322964416,
-  WINDOW_MOVE = 322964417,
-  WINDOW_LOCK = 320867268,
-  STEERING_WHEEL_DEPTH_POS = 289410016,
-  STEERING_WHEEL_DEPTH_MOVE = 289410017,
-  STEERING_WHEEL_HEIGHT_POS = 289410018,
-  STEERING_WHEEL_HEIGHT_MOVE = 289410019,
-  STEERING_WHEEL_THEFT_LOCK_ENABLED = 287312868,
-  STEERING_WHEEL_LOCKED = 287312869,
-  STEERING_WHEEL_EASY_ACCESS_ENABLED = 287312870,
-  VEHICLE_MAP_SERVICE = 299895808,
-  OBD2_LIVE_FRAME = 299896064,
-  OBD2_FREEZE_FRAME = 299896065,
-  OBD2_FREEZE_FRAME_INFO = 299896066,
-  OBD2_FREEZE_FRAME_CLEAR = 299896067,
-  HEADLIGHTS_STATE = 289410560,
-  HIGH_BEAM_LIGHTS_STATE = 289410561,
-  FOG_LIGHTS_STATE = 289410562,
-  HAZARD_LIGHTS_STATE = 289410563,
-  HEADLIGHTS_SWITCH = 289410576,
-  HIGH_BEAM_LIGHTS_SWITCH = 289410577,
-  FOG_LIGHTS_SWITCH = 289410578,
-  HAZARD_LIGHTS_SWITCH = 289410579,
-  CABIN_LIGHTS_STATE = 289410817,
-  CABIN_LIGHTS_SWITCH = 289410818,
-  READING_LIGHTS_STATE = 356519683,
-  READING_LIGHTS_SWITCH = 356519684,
-  STEERING_WHEEL_LIGHTS_STATE = 289410828,
-  STEERING_WHEEL_LIGHTS_SWITCH = 289410829,
-  SUPPORT_CUSTOMIZE_VENDOR_PERMISSION = 287313669,
-  DISABLED_OPTIONAL_FEATURES = 286265094,
-  INITIAL_USER_INFO = 299896583,
-  SWITCH_USER = 299896584,
-  CREATE_USER = 299896585,
-  REMOVE_USER = 299896586,
-  USER_IDENTIFICATION_ASSOCIATION = 299896587,
-  EVS_SERVICE_REQUEST = 289476368,
-  POWER_POLICY_REQ = 286265121,
-  POWER_POLICY_GROUP_REQ = 286265122,
-  CURRENT_POWER_POLICY = 286265123,
-  WATCHDOG_ALIVE = 290459441,
-  WATCHDOG_TERMINATED_PROCESS = 299896626,
-  VHAL_HEARTBEAT = 290459443,
-  CLUSTER_SWITCH_UI = 289410868,
-  CLUSTER_DISPLAY_STATE = 289476405,
-  CLUSTER_REPORT_STATE = 299896630,
-  CLUSTER_REQUEST_DISPLAY = 289410871,
-  CLUSTER_NAVIGATION_STATE = 292556600,
-  ELECTRONIC_TOLL_COLLECTION_CARD_TYPE = 289410873,
-  ELECTRONIC_TOLL_COLLECTION_CARD_STATUS = 289410874,
-  FRONT_FOG_LIGHTS_STATE = 289410875,
-  FRONT_FOG_LIGHTS_SWITCH = 289410876,
-  REAR_FOG_LIGHTS_STATE = 289410877,
-  REAR_FOG_LIGHTS_SWITCH = 289410878,
-  EV_CHARGE_CURRENT_DRAW_LIMIT = 291508031,
-  EV_CHARGE_PERCENT_LIMIT = 291508032,
-  EV_CHARGE_STATE = 289410881,
-  EV_CHARGE_SWITCH = 287313730,
-  EV_CHARGE_TIME_REMAINING = 289410883,
-  EV_REGENERATIVE_BRAKING_STATE = 289410884,
-  TRAILER_PRESENT = 289410885,
-  VEHICLE_CURB_WEIGHT = 289410886,
-  GENERAL_SAFETY_REGULATION_COMPLIANCE_REQUIREMENT = 289410887,
-  SUPPORTED_PROPERTY_IDS = 289476424,
-  SHUTDOWN_REQUEST = 289410889,
-  AUTOMATIC_EMERGENCY_BRAKING_ENABLED = 287313920,
-  FORWARD_COLLISION_WARNING_ENABLED = 287313922,
-  BLIND_SPOT_WARNING_ENABLED = 287313924,
-  LANE_DEPARTURE_WARNING_ENABLED = 287313926,
-  LANE_KEEP_ASSIST_ENABLED = 287313928,
-  LANE_CENTERING_ASSIST_ENABLED = 287313930,
-  EMERGENCY_LANE_KEEP_ASSIST_ENABLED = 287313933,
-  ADAPTIVE_CRUISE_CONTROL_ENABLED = 287313935,
-  HANDS_ON_DETECTION_ENABLED = 287313941,
-  DRIVER_ATTENTION_MONITORING_ENABLED = 287313944,
-}
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehiclePropertyAccess.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehiclePropertyAccess.aidl
index ec9587f..dde9a88 100644
--- a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehiclePropertyAccess.aidl
+++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehiclePropertyAccess.aidl
@@ -34,8 +34,8 @@
 package android.hardware.automotive.vehicle;
 @Backing(type="int") @VintfStability
 enum VehiclePropertyAccess {
-  NONE = 0,
-  READ = 1,
-  WRITE = 2,
-  READ_WRITE = 3,
+  NONE = 0x00,
+  READ = 0x01,
+  WRITE = 0x02,
+  READ_WRITE = 0x03,
 }
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehiclePropertyChangeMode.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehiclePropertyChangeMode.aidl
index 5455fdd..2f9d107 100644
--- a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehiclePropertyChangeMode.aidl
+++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehiclePropertyChangeMode.aidl
@@ -34,7 +34,7 @@
 package android.hardware.automotive.vehicle;
 @Backing(type="int") @VintfStability
 enum VehiclePropertyChangeMode {
-  STATIC = 0,
-  ON_CHANGE = 1,
-  CONTINUOUS = 2,
+  STATIC = 0x00,
+  ON_CHANGE = 0x01,
+  CONTINUOUS = 0x02,
 }
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehiclePropertyStatus.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehiclePropertyStatus.aidl
index 6d0e041..642ce83 100644
--- a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehiclePropertyStatus.aidl
+++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehiclePropertyStatus.aidl
@@ -34,7 +34,7 @@
 package android.hardware.automotive.vehicle;
 @Backing(type="int") @VintfStability
 enum VehiclePropertyStatus {
-  AVAILABLE = 0,
-  UNAVAILABLE = 1,
-  ERROR = 2,
+  AVAILABLE = 0x00,
+  UNAVAILABLE = 0x01,
+  ERROR = 0x02,
 }
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleVendorPermission.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleVendorPermission.aidl
deleted file mode 100644
index 58524f3..0000000
--- a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleVendorPermission.aidl
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Copyright (C) 2021 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-///////////////////////////////////////////////////////////////////////////////
-// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE.                          //
-///////////////////////////////////////////////////////////////////////////////
-
-// This file is a snapshot of an AIDL file. Do not edit it manually. There are
-// two cases:
-// 1). this is a frozen version file - do not edit this in any case.
-// 2). this is a 'current' file. If you make a backwards compatible change to
-//     the interface (from the latest frozen version), the build system will
-//     prompt you to update this file with `m <name>-update-api`.
-//
-// You must not make a backward incompatible change to any AIDL file built
-// with the aidl_interface module type with versions property set. The module
-// type is used to build AIDL files in a way that they can be used across
-// independently updatable components of the system. If a device is shipped
-// with such a backward incompatible change, it has a high risk of breaking
-// later when a module using the interface is updated, e.g., Mainline modules.
-
-package android.hardware.automotive.vehicle;
-@Backing(type="int") @VintfStability
-enum VehicleVendorPermission {
-  PERMISSION_DEFAULT = 0,
-  PERMISSION_SET_VENDOR_CATEGORY_WINDOW = 1,
-  PERMISSION_GET_VENDOR_CATEGORY_WINDOW = 2,
-  PERMISSION_SET_VENDOR_CATEGORY_DOOR = 3,
-  PERMISSION_GET_VENDOR_CATEGORY_DOOR = 4,
-  PERMISSION_SET_VENDOR_CATEGORY_SEAT = 5,
-  PERMISSION_GET_VENDOR_CATEGORY_SEAT = 6,
-  PERMISSION_SET_VENDOR_CATEGORY_MIRROR = 7,
-  PERMISSION_GET_VENDOR_CATEGORY_MIRROR = 8,
-  PERMISSION_SET_VENDOR_CATEGORY_INFO = 9,
-  PERMISSION_GET_VENDOR_CATEGORY_INFO = 10,
-  PERMISSION_SET_VENDOR_CATEGORY_ENGINE = 11,
-  PERMISSION_GET_VENDOR_CATEGORY_ENGINE = 12,
-  PERMISSION_SET_VENDOR_CATEGORY_HVAC = 13,
-  PERMISSION_GET_VENDOR_CATEGORY_HVAC = 14,
-  PERMISSION_SET_VENDOR_CATEGORY_LIGHT = 15,
-  PERMISSION_GET_VENDOR_CATEGORY_LIGHT = 16,
-  PERMISSION_SET_VENDOR_CATEGORY_1 = 65536,
-  PERMISSION_GET_VENDOR_CATEGORY_1 = 69632,
-  PERMISSION_SET_VENDOR_CATEGORY_2 = 131072,
-  PERMISSION_GET_VENDOR_CATEGORY_2 = 135168,
-  PERMISSION_SET_VENDOR_CATEGORY_3 = 196608,
-  PERMISSION_GET_VENDOR_CATEGORY_3 = 200704,
-  PERMISSION_SET_VENDOR_CATEGORY_4 = 262144,
-  PERMISSION_GET_VENDOR_CATEGORY_4 = 266240,
-  PERMISSION_SET_VENDOR_CATEGORY_5 = 327680,
-  PERMISSION_GET_VENDOR_CATEGORY_5 = 331776,
-  PERMISSION_SET_VENDOR_CATEGORY_6 = 393216,
-  PERMISSION_GET_VENDOR_CATEGORY_6 = 397312,
-  PERMISSION_SET_VENDOR_CATEGORY_7 = 458752,
-  PERMISSION_GET_VENDOR_CATEGORY_7 = 462848,
-  PERMISSION_SET_VENDOR_CATEGORY_8 = 524288,
-  PERMISSION_GET_VENDOR_CATEGORY_8 = 528384,
-  PERMISSION_SET_VENDOR_CATEGORY_9 = 589824,
-  PERMISSION_GET_VENDOR_CATEGORY_9 = 593920,
-  PERMISSION_SET_VENDOR_CATEGORY_10 = 655360,
-  PERMISSION_GET_VENDOR_CATEGORY_10 = 659456,
-  PERMISSION_NOT_ACCESSIBLE = -268435456,
-}
diff --git a/automotive/vehicle/aidl/aidl_test/Android.bp b/automotive/vehicle/aidl/aidl_test/Android.bp
index cf7ef1e..44d7445 100644
--- a/automotive/vehicle/aidl/aidl_test/Android.bp
+++ b/automotive/vehicle/aidl/aidl_test/Android.bp
@@ -52,6 +52,7 @@
     ],
     static_libs: [
         "android.hardware.automotive.vehicle-V2-java",
+        "android.hardware.automotive.vehicle.property-V2-java",
         "androidx.test.runner",
         "truth-prebuilt",
     ],
diff --git a/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h b/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h
index 8b77040..edd44a8 100644
--- a/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h
+++ b/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h
@@ -20,6 +20,8 @@
  * Generated by tools/generate_annotation_enums.py.
  */
 
+// clang-format off
+
 #ifndef android_hardware_automotive_vehicle_aidl_generated_lib_AccessForVehicleProperty_H_
 #define android_hardware_automotive_vehicle_aidl_generated_lib_AccessForVehicleProperty_H_
 
@@ -238,8 +240,11 @@
         {VehicleProperty::SUPPORTED_PROPERTY_IDS, VehiclePropertyAccess::READ},
         {VehicleProperty::SHUTDOWN_REQUEST, VehiclePropertyAccess::WRITE},
         {VehicleProperty::AUTOMATIC_EMERGENCY_BRAKING_ENABLED, VehiclePropertyAccess::READ_WRITE},
+        {VehicleProperty::AUTOMATIC_EMERGENCY_BRAKING_STATE, VehiclePropertyAccess::READ},
         {VehicleProperty::FORWARD_COLLISION_WARNING_ENABLED, VehiclePropertyAccess::READ_WRITE},
+        {VehicleProperty::FORWARD_COLLISION_WARNING_STATE, VehiclePropertyAccess::READ},
         {VehicleProperty::BLIND_SPOT_WARNING_ENABLED, VehiclePropertyAccess::READ_WRITE},
+        {VehicleProperty::BLIND_SPOT_WARNING_STATE, VehiclePropertyAccess::READ},
         {VehicleProperty::LANE_DEPARTURE_WARNING_ENABLED, VehiclePropertyAccess::READ_WRITE},
         {VehicleProperty::LANE_KEEP_ASSIST_ENABLED, VehiclePropertyAccess::READ_WRITE},
         {VehicleProperty::LANE_CENTERING_ASSIST_ENABLED, VehiclePropertyAccess::READ_WRITE},
diff --git a/automotive/vehicle/aidl/generated_lib/cpp/ChangeModeForVehicleProperty.h b/automotive/vehicle/aidl/generated_lib/cpp/ChangeModeForVehicleProperty.h
index d7e87e2..726bfcc 100644
--- a/automotive/vehicle/aidl/generated_lib/cpp/ChangeModeForVehicleProperty.h
+++ b/automotive/vehicle/aidl/generated_lib/cpp/ChangeModeForVehicleProperty.h
@@ -20,6 +20,8 @@
  * Generated by tools/generate_annotation_enums.py.
  */
 
+// clang-format off
+
 #ifndef android_hardware_automotive_vehicle_aidl_generated_lib_ChangeModeForVehicleProperty_H_
 #define android_hardware_automotive_vehicle_aidl_generated_lib_ChangeModeForVehicleProperty_H_
 
@@ -238,8 +240,11 @@
         {VehicleProperty::SUPPORTED_PROPERTY_IDS, VehiclePropertyChangeMode::STATIC},
         {VehicleProperty::SHUTDOWN_REQUEST, VehiclePropertyChangeMode::ON_CHANGE},
         {VehicleProperty::AUTOMATIC_EMERGENCY_BRAKING_ENABLED, VehiclePropertyChangeMode::ON_CHANGE},
+        {VehicleProperty::AUTOMATIC_EMERGENCY_BRAKING_STATE, VehiclePropertyChangeMode::ON_CHANGE},
         {VehicleProperty::FORWARD_COLLISION_WARNING_ENABLED, VehiclePropertyChangeMode::ON_CHANGE},
+        {VehicleProperty::FORWARD_COLLISION_WARNING_STATE, VehiclePropertyChangeMode::ON_CHANGE},
         {VehicleProperty::BLIND_SPOT_WARNING_ENABLED, VehiclePropertyChangeMode::ON_CHANGE},
+        {VehicleProperty::BLIND_SPOT_WARNING_STATE, VehiclePropertyChangeMode::ON_CHANGE},
         {VehicleProperty::LANE_DEPARTURE_WARNING_ENABLED, VehiclePropertyChangeMode::ON_CHANGE},
         {VehicleProperty::LANE_KEEP_ASSIST_ENABLED, VehiclePropertyChangeMode::ON_CHANGE},
         {VehicleProperty::LANE_CENTERING_ASSIST_ENABLED, VehiclePropertyChangeMode::ON_CHANGE},
diff --git a/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java b/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java
index 14600f0..36449fe 100644
--- a/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java
+++ b/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java
@@ -20,6 +20,8 @@
  * Generated by tools/generate_annotation_enums.py.
  */
 
+// clang-format off
+
 package android.hardware.automotive.vehicle;
 
 import java.util.Map;
@@ -230,8 +232,11 @@
         Map.entry(VehicleProperty.SUPPORTED_PROPERTY_IDS, VehiclePropertyAccess.READ),
         Map.entry(VehicleProperty.SHUTDOWN_REQUEST, VehiclePropertyAccess.WRITE),
         Map.entry(VehicleProperty.AUTOMATIC_EMERGENCY_BRAKING_ENABLED, VehiclePropertyAccess.READ_WRITE),
+        Map.entry(VehicleProperty.AUTOMATIC_EMERGENCY_BRAKING_STATE, VehiclePropertyAccess.READ),
         Map.entry(VehicleProperty.FORWARD_COLLISION_WARNING_ENABLED, VehiclePropertyAccess.READ_WRITE),
+        Map.entry(VehicleProperty.FORWARD_COLLISION_WARNING_STATE, VehiclePropertyAccess.READ),
         Map.entry(VehicleProperty.BLIND_SPOT_WARNING_ENABLED, VehiclePropertyAccess.READ_WRITE),
+        Map.entry(VehicleProperty.BLIND_SPOT_WARNING_STATE, VehiclePropertyAccess.READ),
         Map.entry(VehicleProperty.LANE_DEPARTURE_WARNING_ENABLED, VehiclePropertyAccess.READ_WRITE),
         Map.entry(VehicleProperty.LANE_KEEP_ASSIST_ENABLED, VehiclePropertyAccess.READ_WRITE),
         Map.entry(VehicleProperty.LANE_CENTERING_ASSIST_ENABLED, VehiclePropertyAccess.READ_WRITE),
diff --git a/automotive/vehicle/aidl/generated_lib/java/ChangeModeForVehicleProperty.java b/automotive/vehicle/aidl/generated_lib/java/ChangeModeForVehicleProperty.java
index 864f392..12e4e8f 100644
--- a/automotive/vehicle/aidl/generated_lib/java/ChangeModeForVehicleProperty.java
+++ b/automotive/vehicle/aidl/generated_lib/java/ChangeModeForVehicleProperty.java
@@ -20,6 +20,8 @@
  * Generated by tools/generate_annotation_enums.py.
  */
 
+// clang-format off
+
 package android.hardware.automotive.vehicle;
 
 import java.util.Map;
@@ -230,8 +232,11 @@
         Map.entry(VehicleProperty.SUPPORTED_PROPERTY_IDS, VehiclePropertyChangeMode.STATIC),
         Map.entry(VehicleProperty.SHUTDOWN_REQUEST, VehiclePropertyChangeMode.ON_CHANGE),
         Map.entry(VehicleProperty.AUTOMATIC_EMERGENCY_BRAKING_ENABLED, VehiclePropertyChangeMode.ON_CHANGE),
+        Map.entry(VehicleProperty.AUTOMATIC_EMERGENCY_BRAKING_STATE, VehiclePropertyChangeMode.ON_CHANGE),
         Map.entry(VehicleProperty.FORWARD_COLLISION_WARNING_ENABLED, VehiclePropertyChangeMode.ON_CHANGE),
+        Map.entry(VehicleProperty.FORWARD_COLLISION_WARNING_STATE, VehiclePropertyChangeMode.ON_CHANGE),
         Map.entry(VehicleProperty.BLIND_SPOT_WARNING_ENABLED, VehiclePropertyChangeMode.ON_CHANGE),
+        Map.entry(VehicleProperty.BLIND_SPOT_WARNING_STATE, VehiclePropertyChangeMode.ON_CHANGE),
         Map.entry(VehicleProperty.LANE_DEPARTURE_WARNING_ENABLED, VehiclePropertyChangeMode.ON_CHANGE),
         Map.entry(VehicleProperty.LANE_KEEP_ASSIST_ENABLED, VehiclePropertyChangeMode.ON_CHANGE),
         Map.entry(VehicleProperty.LANE_CENTERING_ASSIST_ENABLED, VehiclePropertyChangeMode.ON_CHANGE),
diff --git a/automotive/vehicle/aidl/impl/default_config/JsonConfigLoader/src/JsonConfigLoader.cpp b/automotive/vehicle/aidl/impl/default_config/JsonConfigLoader/src/JsonConfigLoader.cpp
index 5521ed1..d37fada 100644
--- a/automotive/vehicle/aidl/impl/default_config/JsonConfigLoader/src/JsonConfigLoader.cpp
+++ b/automotive/vehicle/aidl/impl/default_config/JsonConfigLoader/src/JsonConfigLoader.cpp
@@ -35,10 +35,14 @@
 namespace jsonconfigloader_impl {
 
 using ::aidl::android::hardware::automotive::vehicle::AccessForVehicleProperty;
+using ::aidl::android::hardware::automotive::vehicle::AutomaticEmergencyBrakingState;
+using ::aidl::android::hardware::automotive::vehicle::BlindSpotWarningState;
 using ::aidl::android::hardware::automotive::vehicle::ChangeModeForVehicleProperty;
+using ::aidl::android::hardware::automotive::vehicle::ErrorState;
 using ::aidl::android::hardware::automotive::vehicle::EvConnectorType;
 using ::aidl::android::hardware::automotive::vehicle::EvsServiceState;
 using ::aidl::android::hardware::automotive::vehicle::EvsServiceType;
+using ::aidl::android::hardware::automotive::vehicle::ForwardCollisionWarningState;
 using ::aidl::android::hardware::automotive::vehicle::FuelType;
 using ::aidl::android::hardware::automotive::vehicle::GsrComplianceRequirementType;
 using ::aidl::android::hardware::automotive::vehicle::RawPropValues;
@@ -207,6 +211,13 @@
     mConstantParsersByType["VehicleIgnitionState"] =
             std::make_unique<ConstantParser<VehicleIgnitionState>>();
     mConstantParsersByType["FuelType"] = std::make_unique<ConstantParser<FuelType>>();
+    mConstantParsersByType["ErrorState"] = std::make_unique<ConstantParser<ErrorState>>();
+    mConstantParsersByType["AutomaticEmergencyBrakingState"] =
+            std::make_unique<ConstantParser<AutomaticEmergencyBrakingState>>();
+    mConstantParsersByType["ForwardCollisionWarningState"] =
+            std::make_unique<ConstantParser<ForwardCollisionWarningState>>();
+    mConstantParsersByType["BlindSpotWarningState"] =
+            std::make_unique<ConstantParser<BlindSpotWarningState>>();
     mConstantParsersByType["Constants"] = std::make_unique<LocalVariableParser>();
 }
 
diff --git a/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json b/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json
index 8181769..3131733 100644
--- a/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json
+++ b/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json
@@ -3163,6 +3163,28 @@
             }
         },
         {
+            "property": "VehicleProperty::AUTOMATIC_EMERGENCY_BRAKING_STATE",
+            "defaultValue": {
+                "int32Values": [
+                    "AutomaticEmergencyBrakingState::ENABLED"
+                ]
+            },
+            "areas": [
+                {
+                    "areaId": 0,
+                    "supportedEnumValues": [
+                        "ErrorState::NOT_AVAILABLE_SAFETY",
+                        "ErrorState::NOT_AVAILABLE_SPEED_HIGH",
+                        "ErrorState::NOT_AVAILABLE_SPEED_LOW",
+                        "ErrorState::NOT_AVAILABLE_DISABLED",
+                        "AutomaticEmergencyBrakingState::ENABLED",
+                        "AutomaticEmergencyBrakingState::ACTIVATED",
+                        "AutomaticEmergencyBrakingState::USER_OVERRIDE"
+                    ]
+                }
+            ]
+        },
+        {
             "property": "VehicleProperty::FORWARD_COLLISION_WARNING_ENABLED",
             "defaultValue": {
                 "int32Values": [
@@ -3171,6 +3193,27 @@
             }
         },
         {
+            "property": "VehicleProperty::FORWARD_COLLISION_WARNING_STATE",
+            "defaultValue": {
+                "int32Values": [
+                    "ForwardCollisionWarningState::NO_WARNING"
+                ]
+            },
+            "areas": [
+                {
+                    "areaId": 0,
+                    "supportedEnumValues": [
+                        "ErrorState::NOT_AVAILABLE_SAFETY",
+                        "ErrorState::NOT_AVAILABLE_SPEED_HIGH",
+                        "ErrorState::NOT_AVAILABLE_SPEED_LOW",
+                        "ErrorState::NOT_AVAILABLE_DISABLED",
+                        "ForwardCollisionWarningState::NO_WARNING",
+                        "ForwardCollisionWarningState::WARNING"
+                    ]
+                }
+            ]
+        },
+        {
             "property": "VehicleProperty::BLIND_SPOT_WARNING_ENABLED",
             "defaultValue": {
                 "int32Values": [
@@ -3179,6 +3222,27 @@
             }
         },
         {
+            "property": "VehicleProperty::BLIND_SPOT_WARNING_STATE",
+            "defaultValue": {
+                "int32Values": [
+                    "BlindSpotWarningState::NO_WARNING"
+                ]
+            },
+            "areas": [
+                {
+                    "areaId": "Constants::MIRROR_DRIVER_LEFT_RIGHT",
+                    "supportedEnumValues": [
+                        "ErrorState::NOT_AVAILABLE_SAFETY",
+                        "ErrorState::NOT_AVAILABLE_SPEED_HIGH",
+                        "ErrorState::NOT_AVAILABLE_SPEED_LOW",
+                        "ErrorState::NOT_AVAILABLE_DISABLED",
+                        "BlindSpotWarningState::NO_WARNING",
+                        "BlindSpotWarningState::WARNING"
+                    ]
+                }
+            ]
+        },
+        {
             "property": "VehicleProperty::LANE_DEPARTURE_WARNING_ENABLED",
             "defaultValue": {
                 "int32Values": [
diff --git a/automotive/vehicle/aidl/impl/default_config/config/README.md b/automotive/vehicle/aidl/impl/default_config/config/README.md
index 0e3fc5e..41ce9a7 100644
--- a/automotive/vehicle/aidl/impl/default_config/config/README.md
+++ b/automotive/vehicle/aidl/impl/default_config/config/README.md
@@ -141,6 +141,14 @@
 
 * FuelType
 
+* AutomaticEmergencyBrakingState
+
+* ForwardCollisionWarningState
+
+* BlindSpotWarningState
+
+* ErrorState
+
 * Constants
 
 Every constant type except "Constants" corresponds to a enum defined in Vehicle
diff --git a/automotive/vehicle/aidl/impl/utils/common/include/VehicleHalTypes.h b/automotive/vehicle/aidl/impl/utils/common/include/VehicleHalTypes.h
index 0915701..d9d0db0 100644
--- a/automotive/vehicle/aidl/impl/utils/common/include/VehicleHalTypes.h
+++ b/automotive/vehicle/aidl/impl/utils/common/include/VehicleHalTypes.h
@@ -17,12 +17,16 @@
 #ifndef android_hardware_automotive_vehicle_aidl_impl_utils_common_include_VehicleHalTypes_H_
 #define android_hardware_automotive_vehicle_aidl_impl_utils_common_include_VehicleHalTypes_H_
 
+#include <aidl/android/hardware/automotive/vehicle/AutomaticEmergencyBrakingState.h>
+#include <aidl/android/hardware/automotive/vehicle/BlindSpotWarningState.h>
 #include <aidl/android/hardware/automotive/vehicle/DiagnosticFloatSensorIndex.h>
 #include <aidl/android/hardware/automotive/vehicle/DiagnosticIntegerSensorIndex.h>
+#include <aidl/android/hardware/automotive/vehicle/ErrorState.h>
 #include <aidl/android/hardware/automotive/vehicle/EvConnectorType.h>
 #include <aidl/android/hardware/automotive/vehicle/EvStoppingMode.h>
 #include <aidl/android/hardware/automotive/vehicle/EvsServiceState.h>
 #include <aidl/android/hardware/automotive/vehicle/EvsServiceType.h>
+#include <aidl/android/hardware/automotive/vehicle/ForwardCollisionWarningState.h>
 #include <aidl/android/hardware/automotive/vehicle/FuelType.h>
 #include <aidl/android/hardware/automotive/vehicle/GetValueRequest.h>
 #include <aidl/android/hardware/automotive/vehicle/GetValueResult.h>
diff --git a/automotive/vehicle/aidl_property/Android.bp b/automotive/vehicle/aidl_property/Android.bp
new file mode 100644
index 0000000..58ce50d
--- /dev/null
+++ b/automotive/vehicle/aidl_property/Android.bp
@@ -0,0 +1,53 @@
+// Copyright (C) 2023 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//       http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package {
+    // See: http://go/android-license-faq
+    // A large-scale-change added 'default_applicable_licenses' to import
+    // all of the 'license_kinds' from "hardware_interfaces_license"
+    // to get the below license kinds:
+    //   SPDX-license-identifier-Apache-2.0
+    default_applicable_licenses: ["hardware_interfaces_license"],
+}
+
+aidl_interface {
+    name: "android.hardware.automotive.vehicle.property",
+    vendor_available: true,
+    srcs: [
+        // This HAL was originally part of android.hardware.automotive.vehicle
+        "android/hardware/automotive/vehicle/*.aidl",
+    ],
+    frozen: false,
+    stability: "vintf",
+    backend: {
+        cpp: {
+            enabled: false,
+        },
+        java: {
+            sdk_version: "module_current",
+            min_sdk_version: "31",
+            apex_available: [
+                "//apex_available:platform",
+                "com.android.car.framework",
+            ],
+        },
+    },
+    versions_with_info: [
+        {
+            version: "1",
+            imports: [],
+        },
+    ],
+
+}
diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/.hash b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/.hash
new file mode 100644
index 0000000..02d7352
--- /dev/null
+++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/.hash
@@ -0,0 +1,2 @@
+8610b651e162c614a97542d6f4ed039c969823e5
+d80c4423311162bf7e4fdda8c7be2bad2371cc00
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/CreateUserRequest.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/CreateUserRequest.aidl
similarity index 100%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/CreateUserRequest.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/CreateUserRequest.aidl
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/CreateUserResponse.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/CreateUserResponse.aidl
similarity index 100%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/CreateUserResponse.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/CreateUserResponse.aidl
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/CreateUserStatus.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/CreateUserStatus.aidl
similarity index 100%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/CreateUserStatus.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/CreateUserStatus.aidl
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/CustomInputType.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/CustomInputType.aidl
similarity index 100%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/CustomInputType.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/CustomInputType.aidl
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/DiagnosticFloatSensorIndex.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/DiagnosticFloatSensorIndex.aidl
similarity index 100%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/DiagnosticFloatSensorIndex.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/DiagnosticFloatSensorIndex.aidl
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/DiagnosticIntegerSensorIndex.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/DiagnosticIntegerSensorIndex.aidl
similarity index 100%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/DiagnosticIntegerSensorIndex.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/DiagnosticIntegerSensorIndex.aidl
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/ElectronicTollCollectionCardStatus.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/ElectronicTollCollectionCardStatus.aidl
similarity index 100%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/ElectronicTollCollectionCardStatus.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/ElectronicTollCollectionCardStatus.aidl
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/ElectronicTollCollectionCardType.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/ElectronicTollCollectionCardType.aidl
similarity index 100%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/ElectronicTollCollectionCardType.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/ElectronicTollCollectionCardType.aidl
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/EvChargeState.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/EvChargeState.aidl
similarity index 100%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/EvChargeState.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/EvChargeState.aidl
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/EvConnectorType.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/EvConnectorType.aidl
similarity index 100%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/EvConnectorType.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/EvConnectorType.aidl
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/EvRegenerativeBrakingState.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/EvRegenerativeBrakingState.aidl
similarity index 100%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/EvRegenerativeBrakingState.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/EvRegenerativeBrakingState.aidl
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/EvsServiceRequestIndex.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/EvsServiceRequestIndex.aidl
similarity index 100%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/EvsServiceRequestIndex.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/EvsServiceRequestIndex.aidl
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/EvsServiceState.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/EvsServiceState.aidl
similarity index 100%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/EvsServiceState.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/EvsServiceState.aidl
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/EvsServiceType.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/EvsServiceType.aidl
similarity index 100%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/EvsServiceType.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/EvsServiceType.aidl
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/FuelType.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/FuelType.aidl
similarity index 100%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/FuelType.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/FuelType.aidl
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/InitialUserInfoRequest.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/InitialUserInfoRequest.aidl
similarity index 100%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/InitialUserInfoRequest.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/InitialUserInfoRequest.aidl
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/InitialUserInfoRequestType.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/InitialUserInfoRequestType.aidl
similarity index 100%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/InitialUserInfoRequestType.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/InitialUserInfoRequestType.aidl
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/InitialUserInfoResponse.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/InitialUserInfoResponse.aidl
similarity index 100%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/InitialUserInfoResponse.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/InitialUserInfoResponse.aidl
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/InitialUserInfoResponseAction.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/InitialUserInfoResponseAction.aidl
similarity index 100%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/InitialUserInfoResponseAction.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/InitialUserInfoResponseAction.aidl
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/Obd2CommonIgnitionMonitors.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/Obd2CommonIgnitionMonitors.aidl
similarity index 100%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/Obd2CommonIgnitionMonitors.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/Obd2CommonIgnitionMonitors.aidl
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/Obd2CompressionIgnitionMonitors.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/Obd2CompressionIgnitionMonitors.aidl
similarity index 100%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/Obd2CompressionIgnitionMonitors.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/Obd2CompressionIgnitionMonitors.aidl
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/Obd2FuelSystemStatus.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/Obd2FuelSystemStatus.aidl
similarity index 100%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/Obd2FuelSystemStatus.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/Obd2FuelSystemStatus.aidl
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/Obd2FuelType.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/Obd2FuelType.aidl
similarity index 100%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/Obd2FuelType.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/Obd2FuelType.aidl
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/Obd2IgnitionMonitorKind.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/Obd2IgnitionMonitorKind.aidl
similarity index 100%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/Obd2IgnitionMonitorKind.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/Obd2IgnitionMonitorKind.aidl
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/Obd2SecondaryAirStatus.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/Obd2SecondaryAirStatus.aidl
similarity index 100%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/Obd2SecondaryAirStatus.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/Obd2SecondaryAirStatus.aidl
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/Obd2SparkIgnitionMonitors.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/Obd2SparkIgnitionMonitors.aidl
similarity index 100%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/Obd2SparkIgnitionMonitors.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/Obd2SparkIgnitionMonitors.aidl
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/PortLocationType.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/PortLocationType.aidl
similarity index 100%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/PortLocationType.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/PortLocationType.aidl
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/ProcessTerminationReason.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/ProcessTerminationReason.aidl
similarity index 100%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/ProcessTerminationReason.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/ProcessTerminationReason.aidl
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/RemoveUserRequest.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/RemoveUserRequest.aidl
similarity index 100%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/RemoveUserRequest.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/RemoveUserRequest.aidl
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/RotaryInputType.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/RotaryInputType.aidl
similarity index 100%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/RotaryInputType.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/RotaryInputType.aidl
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/SwitchUserMessageType.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/SwitchUserMessageType.aidl
similarity index 100%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/SwitchUserMessageType.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/SwitchUserMessageType.aidl
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/SwitchUserRequest.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/SwitchUserRequest.aidl
similarity index 100%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/SwitchUserRequest.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/SwitchUserRequest.aidl
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/SwitchUserResponse.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/SwitchUserResponse.aidl
similarity index 100%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/SwitchUserResponse.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/SwitchUserResponse.aidl
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/SwitchUserStatus.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/SwitchUserStatus.aidl
similarity index 100%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/SwitchUserStatus.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/SwitchUserStatus.aidl
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/TrailerState.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/TrailerState.aidl
similarity index 100%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/TrailerState.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/TrailerState.aidl
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/UserIdentificationAssociation.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/UserIdentificationAssociation.aidl
similarity index 100%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/UserIdentificationAssociation.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/UserIdentificationAssociation.aidl
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/UserIdentificationAssociationSetValue.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/UserIdentificationAssociationSetValue.aidl
similarity index 100%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/UserIdentificationAssociationSetValue.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/UserIdentificationAssociationSetValue.aidl
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/UserIdentificationAssociationType.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/UserIdentificationAssociationType.aidl
similarity index 100%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/UserIdentificationAssociationType.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/UserIdentificationAssociationType.aidl
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/UserIdentificationAssociationValue.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/UserIdentificationAssociationValue.aidl
similarity index 100%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/UserIdentificationAssociationValue.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/UserIdentificationAssociationValue.aidl
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/UserIdentificationGetRequest.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/UserIdentificationGetRequest.aidl
similarity index 100%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/UserIdentificationGetRequest.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/UserIdentificationGetRequest.aidl
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/UserIdentificationResponse.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/UserIdentificationResponse.aidl
similarity index 100%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/UserIdentificationResponse.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/UserIdentificationResponse.aidl
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/UserIdentificationSetAssociation.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/UserIdentificationSetAssociation.aidl
similarity index 100%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/UserIdentificationSetAssociation.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/UserIdentificationSetAssociation.aidl
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/UserIdentificationSetRequest.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/UserIdentificationSetRequest.aidl
similarity index 100%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/UserIdentificationSetRequest.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/UserIdentificationSetRequest.aidl
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/UserInfo.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/UserInfo.aidl
similarity index 100%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/UserInfo.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/UserInfo.aidl
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/UsersInfo.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/UsersInfo.aidl
similarity index 100%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/UsersInfo.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/UsersInfo.aidl
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleApPowerStateConfigFlag.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/VehicleApPowerStateConfigFlag.aidl
similarity index 100%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleApPowerStateConfigFlag.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/VehicleApPowerStateConfigFlag.aidl
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleApPowerStateReport.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/VehicleApPowerStateReport.aidl
similarity index 100%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleApPowerStateReport.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/VehicleApPowerStateReport.aidl
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleApPowerStateReq.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/VehicleApPowerStateReq.aidl
similarity index 100%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleApPowerStateReq.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/VehicleApPowerStateReq.aidl
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleApPowerStateReqIndex.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/VehicleApPowerStateReqIndex.aidl
similarity index 100%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleApPowerStateReqIndex.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/VehicleApPowerStateReqIndex.aidl
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleApPowerStateShutdownParam.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/VehicleApPowerStateShutdownParam.aidl
similarity index 100%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleApPowerStateShutdownParam.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/VehicleApPowerStateShutdownParam.aidl
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleArea.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/VehicleArea.aidl
similarity index 100%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleArea.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/VehicleArea.aidl
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleAreaDoor.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/VehicleAreaDoor.aidl
similarity index 100%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleAreaDoor.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/VehicleAreaDoor.aidl
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleAreaMirror.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/VehicleAreaMirror.aidl
similarity index 100%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleAreaMirror.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/VehicleAreaMirror.aidl
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleAreaSeat.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/VehicleAreaSeat.aidl
similarity index 100%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleAreaSeat.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/VehicleAreaSeat.aidl
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleAreaWheel.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/VehicleAreaWheel.aidl
similarity index 100%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleAreaWheel.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/VehicleAreaWheel.aidl
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleAreaWindow.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/VehicleAreaWindow.aidl
similarity index 100%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleAreaWindow.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/VehicleAreaWindow.aidl
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleDisplay.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/VehicleDisplay.aidl
similarity index 100%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleDisplay.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/VehicleDisplay.aidl
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleGear.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/VehicleGear.aidl
similarity index 100%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleGear.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/VehicleGear.aidl
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleHvacFanDirection.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/VehicleHvacFanDirection.aidl
similarity index 100%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleHvacFanDirection.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/VehicleHvacFanDirection.aidl
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleHwKeyInputAction.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/VehicleHwKeyInputAction.aidl
similarity index 100%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleHwKeyInputAction.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/VehicleHwKeyInputAction.aidl
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleIgnitionState.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/VehicleIgnitionState.aidl
similarity index 100%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleIgnitionState.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/VehicleIgnitionState.aidl
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleLightState.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/VehicleLightState.aidl
similarity index 100%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleLightState.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/VehicleLightState.aidl
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleLightSwitch.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/VehicleLightSwitch.aidl
similarity index 100%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleLightSwitch.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/VehicleLightSwitch.aidl
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleOilLevel.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/VehicleOilLevel.aidl
similarity index 100%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleOilLevel.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/VehicleOilLevel.aidl
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleProperty.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/VehicleProperty.aidl
similarity index 100%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleProperty.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/VehicleProperty.aidl
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehiclePropertyGroup.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/VehiclePropertyGroup.aidl
similarity index 100%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehiclePropertyGroup.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/VehiclePropertyGroup.aidl
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehiclePropertyType.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/VehiclePropertyType.aidl
similarity index 100%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehiclePropertyType.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/VehiclePropertyType.aidl
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleSeatOccupancyState.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/VehicleSeatOccupancyState.aidl
similarity index 100%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleSeatOccupancyState.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/VehicleSeatOccupancyState.aidl
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleTurnSignal.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/VehicleTurnSignal.aidl
similarity index 100%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleTurnSignal.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/VehicleTurnSignal.aidl
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleUnit.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/VehicleUnit.aidl
similarity index 100%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleUnit.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/VehicleUnit.aidl
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleVendorPermission.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/VehicleVendorPermission.aidl
similarity index 100%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleVendorPermission.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/VehicleVendorPermission.aidl
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VmsAvailabilityStateIntegerValuesIndex.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/VmsAvailabilityStateIntegerValuesIndex.aidl
similarity index 100%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VmsAvailabilityStateIntegerValuesIndex.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/VmsAvailabilityStateIntegerValuesIndex.aidl
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VmsBaseMessageIntegerValuesIndex.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/VmsBaseMessageIntegerValuesIndex.aidl
similarity index 100%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VmsBaseMessageIntegerValuesIndex.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/VmsBaseMessageIntegerValuesIndex.aidl
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VmsMessageType.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/VmsMessageType.aidl
similarity index 100%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VmsMessageType.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/VmsMessageType.aidl
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VmsMessageWithLayerAndPublisherIdIntegerValuesIndex.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/VmsMessageWithLayerAndPublisherIdIntegerValuesIndex.aidl
similarity index 100%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VmsMessageWithLayerAndPublisherIdIntegerValuesIndex.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/VmsMessageWithLayerAndPublisherIdIntegerValuesIndex.aidl
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VmsMessageWithLayerIntegerValuesIndex.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/VmsMessageWithLayerIntegerValuesIndex.aidl
similarity index 100%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VmsMessageWithLayerIntegerValuesIndex.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/VmsMessageWithLayerIntegerValuesIndex.aidl
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VmsOfferingMessageIntegerValuesIndex.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/VmsOfferingMessageIntegerValuesIndex.aidl
similarity index 100%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VmsOfferingMessageIntegerValuesIndex.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/VmsOfferingMessageIntegerValuesIndex.aidl
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VmsPublisherInformationIntegerValuesIndex.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/VmsPublisherInformationIntegerValuesIndex.aidl
similarity index 100%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VmsPublisherInformationIntegerValuesIndex.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/VmsPublisherInformationIntegerValuesIndex.aidl
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VmsStartSessionMessageIntegerValuesIndex.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/VmsStartSessionMessageIntegerValuesIndex.aidl
similarity index 100%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VmsStartSessionMessageIntegerValuesIndex.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/VmsStartSessionMessageIntegerValuesIndex.aidl
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VmsSubscriptionsStateIntegerValuesIndex.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/VmsSubscriptionsStateIntegerValuesIndex.aidl
similarity index 100%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VmsSubscriptionsStateIntegerValuesIndex.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/VmsSubscriptionsStateIntegerValuesIndex.aidl
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleAreaMirror.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/AutomaticEmergencyBrakingState.aidl
similarity index 90%
copy from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleAreaMirror.aidl
copy to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/AutomaticEmergencyBrakingState.aidl
index c1e2fbd..b316df7 100644
--- a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleAreaMirror.aidl
+++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/AutomaticEmergencyBrakingState.aidl
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright (C) 2023 The Android Open Source Project
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -33,8 +33,9 @@
 
 package android.hardware.automotive.vehicle;
 @Backing(type="int") @VintfStability
-enum VehicleAreaMirror {
-  DRIVER_LEFT = 1,
-  DRIVER_RIGHT = 2,
-  DRIVER_CENTER = 4,
+enum AutomaticEmergencyBrakingState {
+  OTHER = 0,
+  ENABLED = 1,
+  ACTIVATED = 2,
+  USER_OVERRIDE = 3,
 }
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleTurnSignal.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/BlindSpotWarningState.aidl
similarity index 92%
copy from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleTurnSignal.aidl
copy to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/BlindSpotWarningState.aidl
index 78c1795..535b0b1 100644
--- a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleTurnSignal.aidl
+++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/BlindSpotWarningState.aidl
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright (C) 2023 The Android Open Source Project
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -33,8 +33,8 @@
 
 package android.hardware.automotive.vehicle;
 @Backing(type="int") @VintfStability
-enum VehicleTurnSignal {
-  NONE = 0,
-  RIGHT = 1,
-  LEFT = 2,
+enum BlindSpotWarningState {
+  OTHER = 0,
+  NO_WARNING = 1,
+  WARNING = 2,
 }
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/CreateUserRequest.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/CreateUserRequest.aidl
similarity index 100%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/CreateUserRequest.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/CreateUserRequest.aidl
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/CreateUserResponse.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/CreateUserResponse.aidl
similarity index 100%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/CreateUserResponse.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/CreateUserResponse.aidl
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/CreateUserStatus.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/CreateUserStatus.aidl
similarity index 100%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/CreateUserStatus.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/CreateUserStatus.aidl
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/CustomInputType.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/CustomInputType.aidl
similarity index 100%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/CustomInputType.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/CustomInputType.aidl
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/DiagnosticFloatSensorIndex.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/DiagnosticFloatSensorIndex.aidl
similarity index 100%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/DiagnosticFloatSensorIndex.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/DiagnosticFloatSensorIndex.aidl
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/DiagnosticIntegerSensorIndex.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/DiagnosticIntegerSensorIndex.aidl
similarity index 100%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/DiagnosticIntegerSensorIndex.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/DiagnosticIntegerSensorIndex.aidl
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/ElectronicTollCollectionCardStatus.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/ElectronicTollCollectionCardStatus.aidl
similarity index 100%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/ElectronicTollCollectionCardStatus.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/ElectronicTollCollectionCardStatus.aidl
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/ElectronicTollCollectionCardType.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/ElectronicTollCollectionCardType.aidl
similarity index 100%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/ElectronicTollCollectionCardType.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/ElectronicTollCollectionCardType.aidl
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleApPowerStateConfigFlag.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/ErrorState.aidl
similarity index 87%
copy from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleApPowerStateConfigFlag.aidl
copy to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/ErrorState.aidl
index d7b874a..aaf3565 100644
--- a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleApPowerStateConfigFlag.aidl
+++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/ErrorState.aidl
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright (C) 2023 The Android Open Source Project
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -33,8 +33,10 @@
 
 package android.hardware.automotive.vehicle;
 @Backing(type="int") @VintfStability
-enum VehicleApPowerStateConfigFlag {
-  ENABLE_DEEP_SLEEP_FLAG = 1,
-  CONFIG_SUPPORT_TIMER_POWER_ON_FLAG = 2,
-  ENABLE_HIBERNATION_FLAG = 4,
+enum ErrorState {
+  OTHER_ERROR_STATE = (-1),
+  NOT_AVAILABLE_DISABLED = (-2),
+  NOT_AVAILABLE_SPEED_LOW = (-3),
+  NOT_AVAILABLE_SPEED_HIGH = (-4),
+  NOT_AVAILABLE_SAFETY = (-5),
 }
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/EvChargeState.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/EvChargeState.aidl
similarity index 100%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/EvChargeState.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/EvChargeState.aidl
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/EvConnectorType.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/EvConnectorType.aidl
similarity index 100%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/EvConnectorType.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/EvConnectorType.aidl
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/EvRegenerativeBrakingState.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/EvRegenerativeBrakingState.aidl
similarity index 100%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/EvRegenerativeBrakingState.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/EvRegenerativeBrakingState.aidl
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/EvStoppingMode.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/EvStoppingMode.aidl
similarity index 100%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/EvStoppingMode.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/EvStoppingMode.aidl
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/EvsServiceRequestIndex.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/EvsServiceRequestIndex.aidl
similarity index 100%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/EvsServiceRequestIndex.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/EvsServiceRequestIndex.aidl
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/EvsServiceState.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/EvsServiceState.aidl
similarity index 100%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/EvsServiceState.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/EvsServiceState.aidl
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/EvsServiceType.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/EvsServiceType.aidl
similarity index 100%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/EvsServiceType.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/EvsServiceType.aidl
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleTurnSignal.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/ForwardCollisionWarningState.aidl
similarity index 92%
copy from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleTurnSignal.aidl
copy to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/ForwardCollisionWarningState.aidl
index 78c1795..371885d 100644
--- a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleTurnSignal.aidl
+++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/ForwardCollisionWarningState.aidl
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright (C) 2023 The Android Open Source Project
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -33,8 +33,8 @@
 
 package android.hardware.automotive.vehicle;
 @Backing(type="int") @VintfStability
-enum VehicleTurnSignal {
-  NONE = 0,
-  RIGHT = 1,
-  LEFT = 2,
+enum ForwardCollisionWarningState {
+  OTHER = 0,
+  NO_WARNING = 1,
+  WARNING = 2,
 }
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/FuelType.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/FuelType.aidl
similarity index 100%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/FuelType.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/FuelType.aidl
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/GsrComplianceRequirementType.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/GsrComplianceRequirementType.aidl
similarity index 100%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/GsrComplianceRequirementType.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/GsrComplianceRequirementType.aidl
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/InitialUserInfoRequest.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/InitialUserInfoRequest.aidl
similarity index 100%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/InitialUserInfoRequest.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/InitialUserInfoRequest.aidl
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/InitialUserInfoRequestType.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/InitialUserInfoRequestType.aidl
similarity index 100%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/InitialUserInfoRequestType.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/InitialUserInfoRequestType.aidl
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/InitialUserInfoResponse.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/InitialUserInfoResponse.aidl
similarity index 100%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/InitialUserInfoResponse.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/InitialUserInfoResponse.aidl
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/InitialUserInfoResponseAction.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/InitialUserInfoResponseAction.aidl
similarity index 100%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/InitialUserInfoResponseAction.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/InitialUserInfoResponseAction.aidl
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/Obd2CommonIgnitionMonitors.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/Obd2CommonIgnitionMonitors.aidl
similarity index 88%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/Obd2CommonIgnitionMonitors.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/Obd2CommonIgnitionMonitors.aidl
index 73d4a14..22eea1f 100644
--- a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/Obd2CommonIgnitionMonitors.aidl
+++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/Obd2CommonIgnitionMonitors.aidl
@@ -34,10 +34,10 @@
 package android.hardware.automotive.vehicle;
 @Backing(type="int") @VintfStability
 enum Obd2CommonIgnitionMonitors {
-  COMPONENTS_AVAILABLE = 1,
-  COMPONENTS_INCOMPLETE = 2,
-  FUEL_SYSTEM_AVAILABLE = 4,
-  FUEL_SYSTEM_INCOMPLETE = 8,
-  MISFIRE_AVAILABLE = 16,
-  MISFIRE_INCOMPLETE = 32,
+  COMPONENTS_AVAILABLE = (0x1 << 0),
+  COMPONENTS_INCOMPLETE = (0x1 << 1),
+  FUEL_SYSTEM_AVAILABLE = (0x1 << 2),
+  FUEL_SYSTEM_INCOMPLETE = (0x1 << 3),
+  MISFIRE_AVAILABLE = (0x1 << 4),
+  MISFIRE_INCOMPLETE = (0x1 << 5),
 }
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/Obd2CompressionIgnitionMonitors.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/Obd2CompressionIgnitionMonitors.aidl
similarity index 72%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/Obd2CompressionIgnitionMonitors.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/Obd2CompressionIgnitionMonitors.aidl
index 01104c1..335f0ad 100644
--- a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/Obd2CompressionIgnitionMonitors.aidl
+++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/Obd2CompressionIgnitionMonitors.aidl
@@ -34,22 +34,22 @@
 package android.hardware.automotive.vehicle;
 @Backing(type="int") @VintfStability
 enum Obd2CompressionIgnitionMonitors {
-  COMPONENTS_AVAILABLE = 1,
-  COMPONENTS_INCOMPLETE = 2,
-  FUEL_SYSTEM_AVAILABLE = 4,
-  FUEL_SYSTEM_INCOMPLETE = 8,
-  MISFIRE_AVAILABLE = 16,
-  MISFIRE_INCOMPLETE = 32,
-  EGR_OR_VVT_AVAILABLE = 64,
-  EGR_OR_VVT_INCOMPLETE = 128,
-  PM_FILTER_AVAILABLE = 256,
-  PM_FILTER_INCOMPLETE = 512,
-  EXHAUST_GAS_SENSOR_AVAILABLE = 1024,
-  EXHAUST_GAS_SENSOR_INCOMPLETE = 2048,
-  BOOST_PRESSURE_AVAILABLE = 4096,
-  BOOST_PRESSURE_INCOMPLETE = 8192,
-  NOx_SCR_AVAILABLE = 16384,
-  NOx_SCR_INCOMPLETE = 32768,
-  NMHC_CATALYST_AVAILABLE = 65536,
-  NMHC_CATALYST_INCOMPLETE = 131072,
+  COMPONENTS_AVAILABLE = (0x1 << 0),
+  COMPONENTS_INCOMPLETE = (0x1 << 1),
+  FUEL_SYSTEM_AVAILABLE = (0x1 << 2),
+  FUEL_SYSTEM_INCOMPLETE = (0x1 << 3),
+  MISFIRE_AVAILABLE = (0x1 << 4),
+  MISFIRE_INCOMPLETE = (0x1 << 5),
+  EGR_OR_VVT_AVAILABLE = (0x1 << 6),
+  EGR_OR_VVT_INCOMPLETE = (0x1 << 7),
+  PM_FILTER_AVAILABLE = (0x1 << 8),
+  PM_FILTER_INCOMPLETE = (0x1 << 9),
+  EXHAUST_GAS_SENSOR_AVAILABLE = (0x1 << 10),
+  EXHAUST_GAS_SENSOR_INCOMPLETE = (0x1 << 11),
+  BOOST_PRESSURE_AVAILABLE = (0x1 << 12),
+  BOOST_PRESSURE_INCOMPLETE = (0x1 << 13),
+  NOx_SCR_AVAILABLE = (0x1 << 14),
+  NOx_SCR_INCOMPLETE = (0x1 << 15),
+  NMHC_CATALYST_AVAILABLE = (0x1 << 16),
+  NMHC_CATALYST_INCOMPLETE = (0x1 << 17),
 }
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/Obd2FuelSystemStatus.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/Obd2FuelSystemStatus.aidl
similarity index 100%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/Obd2FuelSystemStatus.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/Obd2FuelSystemStatus.aidl
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/Obd2FuelType.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/Obd2FuelType.aidl
similarity index 100%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/Obd2FuelType.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/Obd2FuelType.aidl
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/Obd2IgnitionMonitorKind.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/Obd2IgnitionMonitorKind.aidl
similarity index 100%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/Obd2IgnitionMonitorKind.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/Obd2IgnitionMonitorKind.aidl
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/Obd2SecondaryAirStatus.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/Obd2SecondaryAirStatus.aidl
similarity index 100%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/Obd2SecondaryAirStatus.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/Obd2SecondaryAirStatus.aidl
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/Obd2SparkIgnitionMonitors.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/Obd2SparkIgnitionMonitors.aidl
similarity index 67%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/Obd2SparkIgnitionMonitors.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/Obd2SparkIgnitionMonitors.aidl
index badc29c..4fc48ce 100644
--- a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/Obd2SparkIgnitionMonitors.aidl
+++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/Obd2SparkIgnitionMonitors.aidl
@@ -34,26 +34,26 @@
 package android.hardware.automotive.vehicle;
 @Backing(type="int") @VintfStability
 enum Obd2SparkIgnitionMonitors {
-  COMPONENTS_AVAILABLE = 1,
-  COMPONENTS_INCOMPLETE = 2,
-  FUEL_SYSTEM_AVAILABLE = 4,
-  FUEL_SYSTEM_INCOMPLETE = 8,
-  MISFIRE_AVAILABLE = 16,
-  MISFIRE_INCOMPLETE = 32,
-  EGR_AVAILABLE = 64,
-  EGR_INCOMPLETE = 128,
-  OXYGEN_SENSOR_HEATER_AVAILABLE = 256,
-  OXYGEN_SENSOR_HEATER_INCOMPLETE = 512,
-  OXYGEN_SENSOR_AVAILABLE = 1024,
-  OXYGEN_SENSOR_INCOMPLETE = 2048,
-  AC_REFRIGERANT_AVAILABLE = 4096,
-  AC_REFRIGERANT_INCOMPLETE = 8192,
-  SECONDARY_AIR_SYSTEM_AVAILABLE = 16384,
-  SECONDARY_AIR_SYSTEM_INCOMPLETE = 32768,
-  EVAPORATIVE_SYSTEM_AVAILABLE = 65536,
-  EVAPORATIVE_SYSTEM_INCOMPLETE = 131072,
-  HEATED_CATALYST_AVAILABLE = 262144,
-  HEATED_CATALYST_INCOMPLETE = 524288,
-  CATALYST_AVAILABLE = 1048576,
-  CATALYST_INCOMPLETE = 2097152,
+  COMPONENTS_AVAILABLE = (0x1 << 0),
+  COMPONENTS_INCOMPLETE = (0x1 << 1),
+  FUEL_SYSTEM_AVAILABLE = (0x1 << 2),
+  FUEL_SYSTEM_INCOMPLETE = (0x1 << 3),
+  MISFIRE_AVAILABLE = (0x1 << 4),
+  MISFIRE_INCOMPLETE = (0x1 << 5),
+  EGR_AVAILABLE = (0x1 << 6),
+  EGR_INCOMPLETE = (0x1 << 7),
+  OXYGEN_SENSOR_HEATER_AVAILABLE = (0x1 << 8),
+  OXYGEN_SENSOR_HEATER_INCOMPLETE = (0x1 << 9),
+  OXYGEN_SENSOR_AVAILABLE = (0x1 << 10),
+  OXYGEN_SENSOR_INCOMPLETE = (0x1 << 11),
+  AC_REFRIGERANT_AVAILABLE = (0x1 << 12),
+  AC_REFRIGERANT_INCOMPLETE = (0x1 << 13),
+  SECONDARY_AIR_SYSTEM_AVAILABLE = (0x1 << 14),
+  SECONDARY_AIR_SYSTEM_INCOMPLETE = (0x1 << 15),
+  EVAPORATIVE_SYSTEM_AVAILABLE = (0x1 << 16),
+  EVAPORATIVE_SYSTEM_INCOMPLETE = (0x1 << 17),
+  HEATED_CATALYST_AVAILABLE = (0x1 << 18),
+  HEATED_CATALYST_INCOMPLETE = (0x1 << 19),
+  CATALYST_AVAILABLE = (0x1 << 20),
+  CATALYST_INCOMPLETE = (0x1 << 21),
 }
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/PortLocationType.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/PortLocationType.aidl
similarity index 100%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/PortLocationType.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/PortLocationType.aidl
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/ProcessTerminationReason.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/ProcessTerminationReason.aidl
similarity index 100%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/ProcessTerminationReason.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/ProcessTerminationReason.aidl
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/RemoveUserRequest.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/RemoveUserRequest.aidl
similarity index 100%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/RemoveUserRequest.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/RemoveUserRequest.aidl
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/RotaryInputType.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/RotaryInputType.aidl
similarity index 100%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/RotaryInputType.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/RotaryInputType.aidl
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/SwitchUserMessageType.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/SwitchUserMessageType.aidl
similarity index 100%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/SwitchUserMessageType.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/SwitchUserMessageType.aidl
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/SwitchUserRequest.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/SwitchUserRequest.aidl
similarity index 100%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/SwitchUserRequest.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/SwitchUserRequest.aidl
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/SwitchUserResponse.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/SwitchUserResponse.aidl
similarity index 100%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/SwitchUserResponse.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/SwitchUserResponse.aidl
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/SwitchUserStatus.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/SwitchUserStatus.aidl
similarity index 100%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/SwitchUserStatus.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/SwitchUserStatus.aidl
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/TrailerState.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/TrailerState.aidl
similarity index 100%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/TrailerState.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/TrailerState.aidl
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/UserIdentificationAssociation.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/UserIdentificationAssociation.aidl
similarity index 100%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/UserIdentificationAssociation.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/UserIdentificationAssociation.aidl
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/UserIdentificationAssociationSetValue.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/UserIdentificationAssociationSetValue.aidl
similarity index 100%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/UserIdentificationAssociationSetValue.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/UserIdentificationAssociationSetValue.aidl
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/UserIdentificationAssociationType.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/UserIdentificationAssociationType.aidl
similarity index 100%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/UserIdentificationAssociationType.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/UserIdentificationAssociationType.aidl
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/UserIdentificationAssociationValue.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/UserIdentificationAssociationValue.aidl
similarity index 100%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/UserIdentificationAssociationValue.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/UserIdentificationAssociationValue.aidl
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/UserIdentificationGetRequest.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/UserIdentificationGetRequest.aidl
similarity index 100%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/UserIdentificationGetRequest.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/UserIdentificationGetRequest.aidl
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/UserIdentificationResponse.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/UserIdentificationResponse.aidl
similarity index 100%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/UserIdentificationResponse.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/UserIdentificationResponse.aidl
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/UserIdentificationSetAssociation.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/UserIdentificationSetAssociation.aidl
similarity index 100%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/UserIdentificationSetAssociation.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/UserIdentificationSetAssociation.aidl
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/UserIdentificationSetRequest.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/UserIdentificationSetRequest.aidl
similarity index 100%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/UserIdentificationSetRequest.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/UserIdentificationSetRequest.aidl
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/UserInfo.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/UserInfo.aidl
similarity index 88%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/UserInfo.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/UserInfo.aidl
index f47d5e7..feb5a73 100644
--- a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/UserInfo.aidl
+++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/UserInfo.aidl
@@ -36,10 +36,10 @@
 parcelable UserInfo {
   int userId = 0;
   int flags;
-  const int USER_FLAG_SYSTEM = 1;
-  const int USER_FLAG_GUEST = 2;
-  const int USER_FLAG_EPHEMERAL = 4;
-  const int USER_FLAG_ADMIN = 8;
-  const int USER_FLAG_DISABLED = 16;
-  const int USER_FLAG_PROFILE = 32;
+  const int USER_FLAG_SYSTEM = 0x01;
+  const int USER_FLAG_GUEST = 0x02;
+  const int USER_FLAG_EPHEMERAL = 0x04;
+  const int USER_FLAG_ADMIN = 0x08;
+  const int USER_FLAG_DISABLED = 0x10;
+  const int USER_FLAG_PROFILE = 0x20;
 }
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/UsersInfo.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/UsersInfo.aidl
similarity index 100%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/UsersInfo.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/UsersInfo.aidl
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleApPowerBootupReason.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleApPowerBootupReason.aidl
similarity index 100%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleApPowerBootupReason.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleApPowerBootupReason.aidl
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleApPowerStateConfigFlag.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleApPowerStateConfigFlag.aidl
similarity index 94%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleApPowerStateConfigFlag.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleApPowerStateConfigFlag.aidl
index d7b874a..cc12490 100644
--- a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleApPowerStateConfigFlag.aidl
+++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleApPowerStateConfigFlag.aidl
@@ -34,7 +34,7 @@
 package android.hardware.automotive.vehicle;
 @Backing(type="int") @VintfStability
 enum VehicleApPowerStateConfigFlag {
-  ENABLE_DEEP_SLEEP_FLAG = 1,
-  CONFIG_SUPPORT_TIMER_POWER_ON_FLAG = 2,
-  ENABLE_HIBERNATION_FLAG = 4,
+  ENABLE_DEEP_SLEEP_FLAG = 0x1,
+  CONFIG_SUPPORT_TIMER_POWER_ON_FLAG = 0x2,
+  ENABLE_HIBERNATION_FLAG = 0x4,
 }
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleApPowerStateReport.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleApPowerStateReport.aidl
similarity index 87%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleApPowerStateReport.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleApPowerStateReport.aidl
index fc669ec..e4f7e54 100644
--- a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleApPowerStateReport.aidl
+++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleApPowerStateReport.aidl
@@ -34,14 +34,14 @@
 package android.hardware.automotive.vehicle;
 @Backing(type="int") @VintfStability
 enum VehicleApPowerStateReport {
-  WAIT_FOR_VHAL = 1,
-  DEEP_SLEEP_ENTRY = 2,
-  DEEP_SLEEP_EXIT = 3,
-  SHUTDOWN_POSTPONE = 4,
-  SHUTDOWN_START = 5,
-  ON = 6,
-  SHUTDOWN_PREPARE = 7,
-  SHUTDOWN_CANCELLED = 8,
-  HIBERNATION_ENTRY = 9,
-  HIBERNATION_EXIT = 10,
+  WAIT_FOR_VHAL = 0x1,
+  DEEP_SLEEP_ENTRY = 0x2,
+  DEEP_SLEEP_EXIT = 0x3,
+  SHUTDOWN_POSTPONE = 0x4,
+  SHUTDOWN_START = 0x5,
+  ON = 0x6,
+  SHUTDOWN_PREPARE = 0x7,
+  SHUTDOWN_CANCELLED = 0x8,
+  HIBERNATION_ENTRY = 0x9,
+  HIBERNATION_EXIT = 0xA,
 }
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleApPowerStateReq.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleApPowerStateReq.aidl
similarity index 100%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleApPowerStateReq.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleApPowerStateReq.aidl
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleApPowerStateReqIndex.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleApPowerStateReqIndex.aidl
similarity index 100%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleApPowerStateReqIndex.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleApPowerStateReqIndex.aidl
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleApPowerStateShutdownParam.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleApPowerStateShutdownParam.aidl
similarity index 100%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleApPowerStateShutdownParam.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleApPowerStateShutdownParam.aidl
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleArea.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleArea.aidl
similarity index 91%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleArea.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleArea.aidl
index 4f8b917..db867f4 100644
--- a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleArea.aidl
+++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleArea.aidl
@@ -34,11 +34,11 @@
 package android.hardware.automotive.vehicle;
 @Backing(type="int") @VintfStability
 enum VehicleArea {
-  GLOBAL = 16777216,
-  WINDOW = 50331648,
-  MIRROR = 67108864,
-  SEAT = 83886080,
-  DOOR = 100663296,
-  WHEEL = 117440512,
-  MASK = 251658240,
+  GLOBAL = 0x01000000,
+  WINDOW = 0x03000000,
+  MIRROR = 0x04000000,
+  SEAT = 0x05000000,
+  DOOR = 0x06000000,
+  WHEEL = 0x07000000,
+  MASK = 0x0f000000,
 }
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleAreaDoor.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleAreaDoor.aidl
similarity index 89%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleAreaDoor.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleAreaDoor.aidl
index 11139f9..04976d6 100644
--- a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleAreaDoor.aidl
+++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleAreaDoor.aidl
@@ -34,12 +34,12 @@
 package android.hardware.automotive.vehicle;
 @Backing(type="int") @VintfStability
 enum VehicleAreaDoor {
-  ROW_1_LEFT = 1,
-  ROW_1_RIGHT = 4,
-  ROW_2_LEFT = 16,
-  ROW_2_RIGHT = 64,
-  ROW_3_LEFT = 256,
-  ROW_3_RIGHT = 1024,
-  HOOD = 268435456,
-  REAR = 536870912,
+  ROW_1_LEFT = 0x00000001,
+  ROW_1_RIGHT = 0x00000004,
+  ROW_2_LEFT = 0x00000010,
+  ROW_2_RIGHT = 0x00000040,
+  ROW_3_LEFT = 0x00000100,
+  ROW_3_RIGHT = 0x00000400,
+  HOOD = 0x10000000,
+  REAR = 0x20000000,
 }
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleAreaMirror.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleAreaMirror.aidl
similarity index 95%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleAreaMirror.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleAreaMirror.aidl
index c1e2fbd..2d1c048 100644
--- a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleAreaMirror.aidl
+++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleAreaMirror.aidl
@@ -34,7 +34,7 @@
 package android.hardware.automotive.vehicle;
 @Backing(type="int") @VintfStability
 enum VehicleAreaMirror {
-  DRIVER_LEFT = 1,
-  DRIVER_RIGHT = 2,
-  DRIVER_CENTER = 4,
+  DRIVER_LEFT = 0x00000001,
+  DRIVER_RIGHT = 0x00000002,
+  DRIVER_CENTER = 0x00000004,
 }
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleAreaSeat.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleAreaSeat.aidl
similarity index 89%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleAreaSeat.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleAreaSeat.aidl
index e76de32..44c9d54 100644
--- a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleAreaSeat.aidl
+++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleAreaSeat.aidl
@@ -34,13 +34,13 @@
 package android.hardware.automotive.vehicle;
 @Backing(type="int") @VintfStability
 enum VehicleAreaSeat {
-  ROW_1_LEFT = 1,
-  ROW_1_CENTER = 2,
-  ROW_1_RIGHT = 4,
-  ROW_2_LEFT = 16,
-  ROW_2_CENTER = 32,
-  ROW_2_RIGHT = 64,
-  ROW_3_LEFT = 256,
-  ROW_3_CENTER = 512,
-  ROW_3_RIGHT = 1024,
+  ROW_1_LEFT = 0x0001,
+  ROW_1_CENTER = 0x0002,
+  ROW_1_RIGHT = 0x0004,
+  ROW_2_LEFT = 0x0010,
+  ROW_2_CENTER = 0x0020,
+  ROW_2_RIGHT = 0x0040,
+  ROW_3_LEFT = 0x0100,
+  ROW_3_CENTER = 0x0200,
+  ROW_3_RIGHT = 0x0400,
 }
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleAreaWheel.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleAreaWheel.aidl
similarity index 94%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleAreaWheel.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleAreaWheel.aidl
index 9e83434..d1b314e 100644
--- a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleAreaWheel.aidl
+++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleAreaWheel.aidl
@@ -34,9 +34,9 @@
 package android.hardware.automotive.vehicle;
 @Backing(type="int") @VintfStability
 enum VehicleAreaWheel {
-  UNKNOWN = 0,
-  LEFT_FRONT = 1,
-  RIGHT_FRONT = 2,
-  LEFT_REAR = 4,
-  RIGHT_REAR = 8,
+  UNKNOWN = 0x0,
+  LEFT_FRONT = 0x1,
+  RIGHT_FRONT = 0x2,
+  LEFT_REAR = 0x4,
+  RIGHT_REAR = 0x8,
 }
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleAreaWindow.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleAreaWindow.aidl
similarity index 86%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleAreaWindow.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleAreaWindow.aidl
index 6ec26fe..2afcca3 100644
--- a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleAreaWindow.aidl
+++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleAreaWindow.aidl
@@ -34,14 +34,14 @@
 package android.hardware.automotive.vehicle;
 @Backing(type="int") @VintfStability
 enum VehicleAreaWindow {
-  FRONT_WINDSHIELD = 1,
-  REAR_WINDSHIELD = 2,
-  ROW_1_LEFT = 16,
-  ROW_1_RIGHT = 64,
-  ROW_2_LEFT = 256,
-  ROW_2_RIGHT = 1024,
-  ROW_3_LEFT = 4096,
-  ROW_3_RIGHT = 16384,
-  ROOF_TOP_1 = 65536,
-  ROOF_TOP_2 = 131072,
+  FRONT_WINDSHIELD = 0x00000001,
+  REAR_WINDSHIELD = 0x00000002,
+  ROW_1_LEFT = 0x00000010,
+  ROW_1_RIGHT = 0x00000040,
+  ROW_2_LEFT = 0x00000100,
+  ROW_2_RIGHT = 0x00000400,
+  ROW_3_LEFT = 0x00001000,
+  ROW_3_RIGHT = 0x00004000,
+  ROOF_TOP_1 = 0x00010000,
+  ROOF_TOP_2 = 0x00020000,
 }
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleDisplay.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleDisplay.aidl
similarity index 100%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleDisplay.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleDisplay.aidl
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleGear.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleGear.aidl
similarity index 85%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleGear.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleGear.aidl
index db4760d..b8a299c 100644
--- a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleGear.aidl
+++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleGear.aidl
@@ -34,18 +34,18 @@
 package android.hardware.automotive.vehicle;
 @Backing(type="int") @VintfStability
 enum VehicleGear {
-  GEAR_UNKNOWN = 0,
-  GEAR_NEUTRAL = 1,
-  GEAR_REVERSE = 2,
-  GEAR_PARK = 4,
-  GEAR_DRIVE = 8,
-  GEAR_1 = 16,
-  GEAR_2 = 32,
-  GEAR_3 = 64,
-  GEAR_4 = 128,
-  GEAR_5 = 256,
-  GEAR_6 = 512,
-  GEAR_7 = 1024,
-  GEAR_8 = 2048,
-  GEAR_9 = 4096,
+  GEAR_UNKNOWN = 0x0000,
+  GEAR_NEUTRAL = 0x0001,
+  GEAR_REVERSE = 0x0002,
+  GEAR_PARK = 0x0004,
+  GEAR_DRIVE = 0x0008,
+  GEAR_1 = 0x0010,
+  GEAR_2 = 0x0020,
+  GEAR_3 = 0x0040,
+  GEAR_4 = 0x0080,
+  GEAR_5 = 0x0100,
+  GEAR_6 = 0x0200,
+  GEAR_7 = 0x0400,
+  GEAR_8 = 0x0800,
+  GEAR_9 = 0x1000,
 }
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleHvacFanDirection.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleHvacFanDirection.aidl
similarity index 93%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleHvacFanDirection.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleHvacFanDirection.aidl
index a85751f..4f9870a 100644
--- a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleHvacFanDirection.aidl
+++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleHvacFanDirection.aidl
@@ -34,10 +34,10 @@
 package android.hardware.automotive.vehicle;
 @Backing(type="int") @VintfStability
 enum VehicleHvacFanDirection {
-  UNKNOWN = 0,
-  FACE = 1,
-  FLOOR = 2,
-  FACE_AND_FLOOR = 3,
-  DEFROST = 4,
-  DEFROST_AND_FLOOR = 6,
+  UNKNOWN = 0x0,
+  FACE = 0x1,
+  FLOOR = 0x2,
+  FACE_AND_FLOOR = 0x3,
+  DEFROST = 0x4,
+  DEFROST_AND_FLOOR = 0x06,
 }
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleHwKeyInputAction.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleHwKeyInputAction.aidl
similarity index 100%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleHwKeyInputAction.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleHwKeyInputAction.aidl
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleHwMotionButtonStateFlag.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleHwMotionButtonStateFlag.aidl
similarity index 89%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleHwMotionButtonStateFlag.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleHwMotionButtonStateFlag.aidl
index a7fee08..29c5ed6 100644
--- a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleHwMotionButtonStateFlag.aidl
+++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleHwMotionButtonStateFlag.aidl
@@ -34,11 +34,11 @@
 package android.hardware.automotive.vehicle;
 @Backing(type="int") @VintfStability
 enum VehicleHwMotionButtonStateFlag {
-  BUTTON_PRIMARY = 1,
-  BUTTON_SECONDARY = 2,
-  BUTTON_TERTIARY = 4,
-  BUTTON_BACK = 8,
-  BUTTON_FORWARD = 16,
-  BUTTON_STYLUS_PRIMARY = 32,
-  BUTTON_STYLUS_SECONDARY = 64,
+  BUTTON_PRIMARY = 0x0001,
+  BUTTON_SECONDARY = 0x0002,
+  BUTTON_TERTIARY = 0x0004,
+  BUTTON_BACK = 0x0008,
+  BUTTON_FORWARD = 0x0010,
+  BUTTON_STYLUS_PRIMARY = 0x0020,
+  BUTTON_STYLUS_SECONDARY = 0x0040,
 }
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleHwMotionInputAction.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleHwMotionInputAction.aidl
similarity index 100%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleHwMotionInputAction.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleHwMotionInputAction.aidl
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleHwMotionInputSource.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleHwMotionInputSource.aidl
similarity index 100%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleHwMotionInputSource.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleHwMotionInputSource.aidl
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleHwMotionToolType.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleHwMotionToolType.aidl
similarity index 100%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleHwMotionToolType.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleHwMotionToolType.aidl
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleIgnitionState.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleIgnitionState.aidl
similarity index 97%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleIgnitionState.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleIgnitionState.aidl
index 09d5423..f572a12 100644
--- a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleIgnitionState.aidl
+++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleIgnitionState.aidl
@@ -36,8 +36,8 @@
 enum VehicleIgnitionState {
   UNDEFINED = 0,
   LOCK = 1,
-  OFF = 2,
-  ACC = 3,
-  ON = 4,
-  START = 5,
+  OFF,
+  ACC,
+  ON,
+  START,
 }
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleLightState.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleLightState.aidl
similarity index 100%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleLightState.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleLightState.aidl
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleLightSwitch.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleLightSwitch.aidl
similarity index 98%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleLightSwitch.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleLightSwitch.aidl
index 0d3c636..f244884 100644
--- a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleLightSwitch.aidl
+++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleLightSwitch.aidl
@@ -37,5 +37,5 @@
   OFF = 0,
   ON = 1,
   DAYTIME_RUNNING = 2,
-  AUTOMATIC = 256,
+  AUTOMATIC = 0x100,
 }
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleOilLevel.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleOilLevel.aidl
similarity index 100%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleOilLevel.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleOilLevel.aidl
diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleProperty.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleProperty.aidl
new file mode 100644
index 0000000..61e7add
--- /dev/null
+++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleProperty.aidl
@@ -0,0 +1,253 @@
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE.                          //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+//     the interface (from the latest frozen version), the build system will
+//     prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.automotive.vehicle;
+@Backing(type="int") @VintfStability
+enum VehicleProperty {
+  INVALID = 0x00000000,
+  INFO_VIN = (((0x0100 + 0x10000000) + 0x01000000) + 0x00100000),
+  INFO_MAKE = (((0x0101 + 0x10000000) + 0x01000000) + 0x00100000),
+  INFO_MODEL = (((0x0102 + 0x10000000) + 0x01000000) + 0x00100000),
+  INFO_MODEL_YEAR = (((0x0103 + 0x10000000) + 0x01000000) + 0x00400000),
+  INFO_FUEL_CAPACITY = (((0x0104 + 0x10000000) + 0x01000000) + 0x00600000),
+  INFO_FUEL_TYPE = (((0x0105 + 0x10000000) + 0x01000000) + 0x00410000),
+  INFO_EV_BATTERY_CAPACITY = (((0x0106 + 0x10000000) + 0x01000000) + 0x00600000),
+  INFO_EV_CONNECTOR_TYPE = (((0x0107 + 0x10000000) + 0x01000000) + 0x00410000),
+  INFO_FUEL_DOOR_LOCATION = (((0x0108 + 0x10000000) + 0x01000000) + 0x00400000),
+  INFO_EV_PORT_LOCATION = (((0x0109 + 0x10000000) + 0x01000000) + 0x00400000),
+  INFO_DRIVER_SEAT = (((0x010A + 0x10000000) + 0x05000000) + 0x00400000),
+  INFO_EXTERIOR_DIMENSIONS = (((0x010B + 0x10000000) + 0x01000000) + 0x00410000),
+  INFO_MULTI_EV_PORT_LOCATIONS = (((0x010C + 0x10000000) + 0x01000000) + 0x00410000),
+  PERF_ODOMETER = (((0x0204 + 0x10000000) + 0x01000000) + 0x00600000),
+  PERF_VEHICLE_SPEED = (((0x0207 + 0x10000000) + 0x01000000) + 0x00600000),
+  PERF_VEHICLE_SPEED_DISPLAY = (((0x0208 + 0x10000000) + 0x01000000) + 0x00600000),
+  PERF_STEERING_ANGLE = (((0x0209 + 0x10000000) + 0x01000000) + 0x00600000),
+  PERF_REAR_STEERING_ANGLE = (((0x0210 + 0x10000000) + 0x01000000) + 0x00600000),
+  ENGINE_COOLANT_TEMP = (((0x0301 + 0x10000000) + 0x01000000) + 0x00600000),
+  ENGINE_OIL_LEVEL = (((0x0303 + 0x10000000) + 0x01000000) + 0x00400000),
+  ENGINE_OIL_TEMP = (((0x0304 + 0x10000000) + 0x01000000) + 0x00600000),
+  ENGINE_RPM = (((0x0305 + 0x10000000) + 0x01000000) + 0x00600000),
+  WHEEL_TICK = (((0x0306 + 0x10000000) + 0x01000000) + 0x00510000),
+  FUEL_LEVEL = (((0x0307 + 0x10000000) + 0x01000000) + 0x00600000),
+  FUEL_DOOR_OPEN = (((0x0308 + 0x10000000) + 0x01000000) + 0x00200000),
+  EV_BATTERY_LEVEL = (((0x0309 + 0x10000000) + 0x01000000) + 0x00600000),
+  EV_CURRENT_BATTERY_CAPACITY = (((0x030D + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.FLOAT),
+  EV_CHARGE_PORT_OPEN = (((0x030A + 0x10000000) + 0x01000000) + 0x00200000),
+  EV_CHARGE_PORT_CONNECTED = (((0x030B + 0x10000000) + 0x01000000) + 0x00200000),
+  EV_BATTERY_INSTANTANEOUS_CHARGE_RATE = (((0x030C + 0x10000000) + 0x01000000) + 0x00600000),
+  RANGE_REMAINING = (((0x0308 + 0x10000000) + 0x01000000) + 0x00600000),
+  TIRE_PRESSURE = (((0x0309 + 0x10000000) + 0x07000000) + 0x00600000),
+  CRITICALLY_LOW_TIRE_PRESSURE = (((0x030A + 0x10000000) + 0x07000000) + 0x00600000),
+  ENGINE_IDLE_AUTO_STOP_ENABLED = (((0x0320 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.BOOLEAN),
+  GEAR_SELECTION = (((0x0400 + 0x10000000) + 0x01000000) + 0x00400000),
+  CURRENT_GEAR = (((0x0401 + 0x10000000) + 0x01000000) + 0x00400000),
+  PARKING_BRAKE_ON = (((0x0402 + 0x10000000) + 0x01000000) + 0x00200000),
+  PARKING_BRAKE_AUTO_APPLY = (((0x0403 + 0x10000000) + 0x01000000) + 0x00200000),
+  EV_BRAKE_REGENERATION_LEVEL = (((0x040C + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32),
+  FUEL_LEVEL_LOW = (((0x0405 + 0x10000000) + 0x01000000) + 0x00200000),
+  NIGHT_MODE = (((0x0407 + 0x10000000) + 0x01000000) + 0x00200000),
+  TURN_SIGNAL_STATE = (((0x0408 + 0x10000000) + 0x01000000) + 0x00400000),
+  IGNITION_STATE = (((0x0409 + 0x10000000) + 0x01000000) + 0x00400000),
+  ABS_ACTIVE = (((0x040A + 0x10000000) + 0x01000000) + 0x00200000),
+  TRACTION_CONTROL_ACTIVE = (((0x040B + 0x10000000) + 0x01000000) + 0x00200000),
+  EV_STOPPING_MODE = (((0x040D + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32),
+  HVAC_FAN_SPEED = (((0x0500 + 0x10000000) + 0x05000000) + 0x00400000),
+  HVAC_FAN_DIRECTION = (((0x0501 + 0x10000000) + 0x05000000) + 0x00400000),
+  HVAC_TEMPERATURE_CURRENT = (((0x0502 + 0x10000000) + 0x05000000) + 0x00600000),
+  HVAC_TEMPERATURE_SET = (((0x0503 + 0x10000000) + 0x05000000) + 0x00600000),
+  HVAC_DEFROSTER = (((0x0504 + 0x10000000) + 0x03000000) + 0x00200000),
+  HVAC_AC_ON = (((0x0505 + 0x10000000) + 0x05000000) + 0x00200000),
+  HVAC_MAX_AC_ON = (((0x0506 + 0x10000000) + 0x05000000) + 0x00200000),
+  HVAC_MAX_DEFROST_ON = (((0x0507 + 0x10000000) + 0x05000000) + 0x00200000),
+  HVAC_RECIRC_ON = (((0x0508 + 0x10000000) + 0x05000000) + 0x00200000),
+  HVAC_DUAL_ON = (((0x0509 + 0x10000000) + 0x05000000) + 0x00200000),
+  HVAC_AUTO_ON = (((0x050A + 0x10000000) + 0x05000000) + 0x00200000),
+  HVAC_SEAT_TEMPERATURE = (((0x050B + 0x10000000) + 0x05000000) + 0x00400000),
+  HVAC_SIDE_MIRROR_HEAT = (((0x050C + 0x10000000) + 0x04000000) + 0x00400000),
+  HVAC_STEERING_WHEEL_HEAT = (((0x050D + 0x10000000) + 0x01000000) + 0x00400000),
+  HVAC_TEMPERATURE_DISPLAY_UNITS = (((0x050E + 0x10000000) + 0x01000000) + 0x00400000),
+  HVAC_ACTUAL_FAN_SPEED_RPM = (((0x050F + 0x10000000) + 0x05000000) + 0x00400000),
+  HVAC_POWER_ON = (((0x0510 + 0x10000000) + 0x05000000) + 0x00200000),
+  HVAC_FAN_DIRECTION_AVAILABLE = (((0x0511 + 0x10000000) + 0x05000000) + 0x00410000),
+  HVAC_AUTO_RECIRC_ON = (((0x0512 + 0x10000000) + 0x05000000) + 0x00200000),
+  HVAC_SEAT_VENTILATION = (((0x0513 + 0x10000000) + 0x05000000) + 0x00400000),
+  HVAC_ELECTRIC_DEFROSTER_ON = (((0x0514 + 0x10000000) + 0x03000000) + 0x00200000),
+  HVAC_TEMPERATURE_VALUE_SUGGESTION = (((0x0515 + 0x10000000) + 0x01000000) + 0x00610000),
+  DISTANCE_DISPLAY_UNITS = (((0x0600 + 0x10000000) + 0x01000000) + 0x00400000),
+  FUEL_VOLUME_DISPLAY_UNITS = (((0x0601 + 0x10000000) + 0x01000000) + 0x00400000),
+  TIRE_PRESSURE_DISPLAY_UNITS = (((0x0602 + 0x10000000) + 0x01000000) + 0x00400000),
+  EV_BATTERY_DISPLAY_UNITS = (((0x0603 + 0x10000000) + 0x01000000) + 0x00400000),
+  FUEL_CONSUMPTION_UNITS_DISTANCE_OVER_VOLUME = (((0x0604 + 0x10000000) + 0x01000000) + 0x00200000),
+  VEHICLE_SPEED_DISPLAY_UNITS = (((0x0605 + 0x10000000) + 0x01000000) + 0x00400000),
+  EXTERNAL_CAR_TIME = (((0x0608 + 0x10000000) + 0x01000000) + 0x00500000),
+  ANDROID_EPOCH_TIME = (((0x0606 + 0x10000000) + 0x01000000) + 0x00500000),
+  STORAGE_ENCRYPTION_BINDING_SEED = (((0x0607 + 0x10000000) + 0x01000000) + 0x00700000),
+  ENV_OUTSIDE_TEMPERATURE = (((0x0703 + 0x10000000) + 0x01000000) + 0x00600000),
+  AP_POWER_STATE_REQ = (((0x0A00 + 0x10000000) + 0x01000000) + 0x00410000),
+  AP_POWER_STATE_REPORT = (((0x0A01 + 0x10000000) + 0x01000000) + 0x00410000),
+  AP_POWER_BOOTUP_REASON = (((0x0A02 + 0x10000000) + 0x01000000) + 0x00400000),
+  DISPLAY_BRIGHTNESS = (((0x0A03 + 0x10000000) + 0x01000000) + 0x00400000),
+  HW_KEY_INPUT = (((0x0A10 + 0x10000000) + 0x01000000) + 0x00410000),
+  HW_KEY_INPUT_V2 = (((0x0A11 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.SEAT) + android.hardware.automotive.vehicle.VehiclePropertyType.MIXED),
+  HW_MOTION_INPUT = (((0x0A12 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.SEAT) + android.hardware.automotive.vehicle.VehiclePropertyType.MIXED),
+  HW_ROTARY_INPUT = (((0x0A20 + 0x10000000) + 0x01000000) + 0x00410000),
+  HW_CUSTOM_INPUT = (((0X0A30 + 0x10000000) + 0x01000000) + 0x00410000),
+  DOOR_POS = (((0x0B00 + 0x10000000) + 0x06000000) + 0x00400000),
+  DOOR_MOVE = (((0x0B01 + 0x10000000) + 0x06000000) + 0x00400000),
+  DOOR_LOCK = (((0x0B02 + 0x10000000) + 0x06000000) + 0x00200000),
+  DOOR_CHILD_LOCK_ENABLED = (((0x0B03 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.DOOR) + android.hardware.automotive.vehicle.VehiclePropertyType.BOOLEAN),
+  MIRROR_Z_POS = (((0x0B40 + 0x10000000) + 0x04000000) + 0x00400000),
+  MIRROR_Z_MOVE = (((0x0B41 + 0x10000000) + 0x04000000) + 0x00400000),
+  MIRROR_Y_POS = (((0x0B42 + 0x10000000) + 0x04000000) + 0x00400000),
+  MIRROR_Y_MOVE = (((0x0B43 + 0x10000000) + 0x04000000) + 0x00400000),
+  MIRROR_LOCK = (((0x0B44 + 0x10000000) + 0x01000000) + 0x00200000),
+  MIRROR_FOLD = (((0x0B45 + 0x10000000) + 0x01000000) + 0x00200000),
+  MIRROR_AUTO_FOLD_ENABLED = (((0x0B46 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.MIRROR) + android.hardware.automotive.vehicle.VehiclePropertyType.BOOLEAN),
+  MIRROR_AUTO_TILT_ENABLED = (((0x0B47 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.MIRROR) + android.hardware.automotive.vehicle.VehiclePropertyType.BOOLEAN),
+  SEAT_MEMORY_SELECT = (((0x0B80 + 0x10000000) + 0x05000000) + 0x00400000),
+  SEAT_MEMORY_SET = (((0x0B81 + 0x10000000) + 0x05000000) + 0x00400000),
+  SEAT_BELT_BUCKLED = (((0x0B82 + 0x10000000) + 0x05000000) + 0x00200000),
+  SEAT_BELT_HEIGHT_POS = (((0x0B83 + 0x10000000) + 0x05000000) + 0x00400000),
+  SEAT_BELT_HEIGHT_MOVE = (((0x0B84 + 0x10000000) + 0x05000000) + 0x00400000),
+  SEAT_FORE_AFT_POS = (((0x0B85 + 0x10000000) + 0x05000000) + 0x00400000),
+  SEAT_FORE_AFT_MOVE = (((0x0B86 + 0x10000000) + 0x05000000) + 0x00400000),
+  SEAT_BACKREST_ANGLE_1_POS = (((0x0B87 + 0x10000000) + 0x05000000) + 0x00400000),
+  SEAT_BACKREST_ANGLE_1_MOVE = (((0x0B88 + 0x10000000) + 0x05000000) + 0x00400000),
+  SEAT_BACKREST_ANGLE_2_POS = (((0x0B89 + 0x10000000) + 0x05000000) + 0x00400000),
+  SEAT_BACKREST_ANGLE_2_MOVE = (((0x0B8A + 0x10000000) + 0x05000000) + 0x00400000),
+  SEAT_HEIGHT_POS = (((0x0B8B + 0x10000000) + 0x05000000) + 0x00400000),
+  SEAT_HEIGHT_MOVE = (((0x0B8C + 0x10000000) + 0x05000000) + 0x00400000),
+  SEAT_DEPTH_POS = (((0x0B8D + 0x10000000) + 0x05000000) + 0x00400000),
+  SEAT_DEPTH_MOVE = (((0x0B8E + 0x10000000) + 0x05000000) + 0x00400000),
+  SEAT_TILT_POS = (((0x0B8F + 0x10000000) + 0x05000000) + 0x00400000),
+  SEAT_TILT_MOVE = (((0x0B90 + 0x10000000) + 0x05000000) + 0x00400000),
+  SEAT_LUMBAR_FORE_AFT_POS = (((0x0B91 + 0x10000000) + 0x05000000) + 0x00400000),
+  SEAT_LUMBAR_FORE_AFT_MOVE = (((0x0B92 + 0x10000000) + 0x05000000) + 0x00400000),
+  SEAT_LUMBAR_SIDE_SUPPORT_POS = (((0x0B93 + 0x10000000) + 0x05000000) + 0x00400000),
+  SEAT_LUMBAR_SIDE_SUPPORT_MOVE = (((0x0B94 + 0x10000000) + 0x05000000) + 0x00400000),
+  SEAT_HEADREST_HEIGHT_POS = (((0x0B95 + 0x10000000) + 0x01000000) + 0x00400000),
+  SEAT_HEADREST_HEIGHT_POS_V2 = (((0x0BA4 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.SEAT) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32),
+  SEAT_HEADREST_HEIGHT_MOVE = (((0x0B96 + 0x10000000) + 0x05000000) + 0x00400000),
+  SEAT_HEADREST_ANGLE_POS = (((0x0B97 + 0x10000000) + 0x05000000) + 0x00400000),
+  SEAT_HEADREST_ANGLE_MOVE = (((0x0B98 + 0x10000000) + 0x05000000) + 0x00400000),
+  SEAT_HEADREST_FORE_AFT_POS = (((0x0B99 + 0x10000000) + 0x05000000) + 0x00400000),
+  SEAT_HEADREST_FORE_AFT_MOVE = (((0x0B9A + 0x10000000) + 0x05000000) + 0x00400000),
+  SEAT_FOOTWELL_LIGHTS_STATE = (((0x0B9B + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.SEAT) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32),
+  SEAT_FOOTWELL_LIGHTS_SWITCH = (((0x0B9C + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.SEAT) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32),
+  SEAT_EASY_ACCESS_ENABLED = (((0x0B9D + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.SEAT) + android.hardware.automotive.vehicle.VehiclePropertyType.BOOLEAN),
+  SEAT_AIRBAG_ENABLED = (((0x0B9E + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.SEAT) + android.hardware.automotive.vehicle.VehiclePropertyType.BOOLEAN),
+  SEAT_CUSHION_SIDE_SUPPORT_POS = (((0x0B9F + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.SEAT) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32),
+  SEAT_CUSHION_SIDE_SUPPORT_MOVE = (((0x0BA0 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.SEAT) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32),
+  SEAT_LUMBAR_VERTICAL_POS = (((0x0BA1 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.SEAT) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32),
+  SEAT_LUMBAR_VERTICAL_MOVE = (((0x0BA2 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.SEAT) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32),
+  SEAT_WALK_IN_POS = (((0x0BA3 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.SEAT) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32),
+  SEAT_OCCUPANCY = (((0x0BB0 + 0x10000000) + 0x05000000) + 0x00400000),
+  WINDOW_POS = (((0x0BC0 + 0x10000000) + 0x03000000) + 0x00400000),
+  WINDOW_MOVE = (((0x0BC1 + 0x10000000) + 0x03000000) + 0x00400000),
+  WINDOW_LOCK = (((0x0BC4 + 0x10000000) + 0x03000000) + 0x00200000),
+  STEERING_WHEEL_DEPTH_POS = (((0x0BE0 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32),
+  STEERING_WHEEL_DEPTH_MOVE = (((0x0BE1 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32),
+  STEERING_WHEEL_HEIGHT_POS = (((0x0BE2 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32),
+  STEERING_WHEEL_HEIGHT_MOVE = (((0x0BE3 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32),
+  STEERING_WHEEL_THEFT_LOCK_ENABLED = (((0x0BE4 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.BOOLEAN),
+  STEERING_WHEEL_LOCKED = (((0x0BE5 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.BOOLEAN),
+  STEERING_WHEEL_EASY_ACCESS_ENABLED = (((0x0BE6 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.BOOLEAN),
+  VEHICLE_MAP_SERVICE = (((0x0C00 + 0x10000000) + 0x01000000) + 0x00e00000),
+  OBD2_LIVE_FRAME = (((0x0D00 + 0x10000000) + 0x01000000) + 0x00e00000),
+  OBD2_FREEZE_FRAME = (((0x0D01 + 0x10000000) + 0x01000000) + 0x00e00000),
+  OBD2_FREEZE_FRAME_INFO = (((0x0D02 + 0x10000000) + 0x01000000) + 0x00e00000),
+  OBD2_FREEZE_FRAME_CLEAR = (((0x0D03 + 0x10000000) + 0x01000000) + 0x00e00000),
+  HEADLIGHTS_STATE = (((0x0E00 + 0x10000000) + 0x01000000) + 0x00400000),
+  HIGH_BEAM_LIGHTS_STATE = (((0x0E01 + 0x10000000) + 0x01000000) + 0x00400000),
+  FOG_LIGHTS_STATE = (((0x0E02 + 0x10000000) + 0x01000000) + 0x00400000),
+  HAZARD_LIGHTS_STATE = (((0x0E03 + 0x10000000) + 0x01000000) + 0x00400000),
+  HEADLIGHTS_SWITCH = (((0x0E10 + 0x10000000) + 0x01000000) + 0x00400000),
+  HIGH_BEAM_LIGHTS_SWITCH = (((0x0E11 + 0x10000000) + 0x01000000) + 0x00400000),
+  FOG_LIGHTS_SWITCH = (((0x0E12 + 0x10000000) + 0x01000000) + 0x00400000),
+  HAZARD_LIGHTS_SWITCH = (((0x0E13 + 0x10000000) + 0x01000000) + 0x00400000),
+  CABIN_LIGHTS_STATE = (((0x0F01 + 0x10000000) + 0x01000000) + 0x00400000),
+  CABIN_LIGHTS_SWITCH = (((0x0F02 + 0x10000000) + 0x01000000) + 0x00400000),
+  READING_LIGHTS_STATE = (((0x0F03 + 0x10000000) + 0x05000000) + 0x00400000),
+  READING_LIGHTS_SWITCH = (((0x0F04 + 0x10000000) + 0x05000000) + 0x00400000),
+  STEERING_WHEEL_LIGHTS_STATE = (((0x0F0C + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32),
+  STEERING_WHEEL_LIGHTS_SWITCH = (((0x0F0D + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32),
+  SUPPORT_CUSTOMIZE_VENDOR_PERMISSION = (((0x0F05 + 0x10000000) + 0x01000000) + 0x00200000),
+  DISABLED_OPTIONAL_FEATURES = (((0x0F06 + 0x10000000) + 0x01000000) + 0x00100000),
+  INITIAL_USER_INFO = (((0x0F07 + 0x10000000) + 0x01000000) + 0x00e00000),
+  SWITCH_USER = (((0x0F08 + 0x10000000) + 0x01000000) + 0x00e00000),
+  CREATE_USER = (((0x0F09 + 0x10000000) + 0x01000000) + 0x00e00000),
+  REMOVE_USER = (((0x0F0A + 0x10000000) + 0x01000000) + 0x00e00000),
+  USER_IDENTIFICATION_ASSOCIATION = (((0x0F0B + 0x10000000) + 0x01000000) + 0x00e00000),
+  EVS_SERVICE_REQUEST = (((0x0F10 + 0x10000000) + 0x01000000) + 0x00410000),
+  POWER_POLICY_REQ = (((0x0F21 + 0x10000000) + 0x01000000) + 0x00100000),
+  POWER_POLICY_GROUP_REQ = (((0x0F22 + 0x10000000) + 0x01000000) + 0x00100000),
+  CURRENT_POWER_POLICY = (((0x0F23 + 0x10000000) + 0x01000000) + 0x00100000),
+  WATCHDOG_ALIVE = (((0xF31 + 0x10000000) + 0x01000000) + 0x00500000),
+  WATCHDOG_TERMINATED_PROCESS = (((0x0F32 + 0x10000000) + 0x01000000) + 0x00e00000),
+  VHAL_HEARTBEAT = (((0x0F33 + 0x10000000) + 0x01000000) + 0x00500000),
+  CLUSTER_SWITCH_UI = (((0x0F34 + 0x10000000) + 0x01000000) + 0x00400000),
+  CLUSTER_DISPLAY_STATE = (((0x0F35 + 0x10000000) + 0x01000000) + 0x00410000),
+  CLUSTER_REPORT_STATE = (((0x0F36 + 0x10000000) + 0x01000000) + 0x00e00000),
+  CLUSTER_REQUEST_DISPLAY = (((0x0F37 + 0x10000000) + 0x01000000) + 0x00400000),
+  CLUSTER_NAVIGATION_STATE = (((0x0F38 + 0x10000000) + 0x01000000) + 0x00700000),
+  ELECTRONIC_TOLL_COLLECTION_CARD_TYPE = (((0x0F39 + 0x10000000) + 0x01000000) + 0x00400000),
+  ELECTRONIC_TOLL_COLLECTION_CARD_STATUS = (((0x0F3A + 0x10000000) + 0x01000000) + 0x00400000),
+  FRONT_FOG_LIGHTS_STATE = (((0x0F3B + 0x10000000) + 0x01000000) + 0x00400000),
+  FRONT_FOG_LIGHTS_SWITCH = (((0x0F3C + 0x10000000) + 0x01000000) + 0x00400000),
+  REAR_FOG_LIGHTS_STATE = (((0x0F3D + 0x10000000) + 0x01000000) + 0x00400000),
+  REAR_FOG_LIGHTS_SWITCH = (((0x0F3E + 0x10000000) + 0x01000000) + 0x00400000),
+  EV_CHARGE_CURRENT_DRAW_LIMIT = (((0x0F3F + 0x10000000) + 0x01000000) + 0x00600000),
+  EV_CHARGE_PERCENT_LIMIT = (((0x0F40 + 0x10000000) + 0x01000000) + 0x00600000),
+  EV_CHARGE_STATE = (((0x0F41 + 0x10000000) + 0x01000000) + 0x00400000),
+  EV_CHARGE_SWITCH = (((0x0F42 + 0x10000000) + 0x01000000) + 0x00200000),
+  EV_CHARGE_TIME_REMAINING = (((0x0F43 + 0x10000000) + 0x01000000) + 0x00400000),
+  EV_REGENERATIVE_BRAKING_STATE = (((0x0F44 + 0x10000000) + 0x01000000) + 0x00400000),
+  TRAILER_PRESENT = (((0x0F45 + 0x10000000) + 0x01000000) + 0x00400000),
+  VEHICLE_CURB_WEIGHT = (((0x0F46 + 0x10000000) + 0x01000000) + 0x00400000),
+  GENERAL_SAFETY_REGULATION_COMPLIANCE_REQUIREMENT = (((0x0F47 + 0x10000000) + 0x01000000) + 0x00400000),
+  SUPPORTED_PROPERTY_IDS = (((0x0F48 + 0x10000000) + 0x01000000) + 0x00410000),
+  SHUTDOWN_REQUEST = (((0x0F49 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32),
+  AUTOMATIC_EMERGENCY_BRAKING_ENABLED = (((0x1000 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.BOOLEAN),
+  AUTOMATIC_EMERGENCY_BRAKING_STATE = (((0x1001 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32),
+  FORWARD_COLLISION_WARNING_ENABLED = (((0x1002 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.BOOLEAN),
+  FORWARD_COLLISION_WARNING_STATE = (((0x1003 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32),
+  BLIND_SPOT_WARNING_ENABLED = (((0x1004 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.BOOLEAN),
+  BLIND_SPOT_WARNING_STATE = (((0x1005 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.MIRROR) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32),
+  LANE_DEPARTURE_WARNING_ENABLED = (((0x1006 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.BOOLEAN),
+  LANE_KEEP_ASSIST_ENABLED = (((0x1008 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.BOOLEAN),
+  LANE_CENTERING_ASSIST_ENABLED = (((0x100A + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.BOOLEAN),
+  EMERGENCY_LANE_KEEP_ASSIST_ENABLED = (((0x100D + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.BOOLEAN),
+  ADAPTIVE_CRUISE_CONTROL_ENABLED = (((0x100F + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.BOOLEAN),
+  HANDS_ON_DETECTION_ENABLED = (((0x1016 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.BOOLEAN),
+  DRIVER_ATTENTION_MONITORING_ENABLED = (((0x1019 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.BOOLEAN),
+}
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehiclePropertyGroup.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehiclePropertyGroup.aidl
similarity index 96%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehiclePropertyGroup.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehiclePropertyGroup.aidl
index 0c049c4..714d514 100644
--- a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehiclePropertyGroup.aidl
+++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehiclePropertyGroup.aidl
@@ -34,7 +34,7 @@
 package android.hardware.automotive.vehicle;
 @Backing(type="int") @VintfStability
 enum VehiclePropertyGroup {
-  SYSTEM = 268435456,
-  VENDOR = 536870912,
-  MASK = -268435456,
+  SYSTEM = 0x10000000,
+  VENDOR = 0x20000000,
+  MASK = 0xf0000000,
 }
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehiclePropertyType.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehiclePropertyType.aidl
similarity index 87%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehiclePropertyType.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehiclePropertyType.aidl
index da6d2c2..7525cbb 100644
--- a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehiclePropertyType.aidl
+++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehiclePropertyType.aidl
@@ -34,15 +34,15 @@
 package android.hardware.automotive.vehicle;
 @Backing(type="int") @VintfStability
 enum VehiclePropertyType {
-  STRING = 1048576,
-  BOOLEAN = 2097152,
-  INT32 = 4194304,
-  INT32_VEC = 4259840,
-  INT64 = 5242880,
-  INT64_VEC = 5308416,
-  FLOAT = 6291456,
-  FLOAT_VEC = 6356992,
-  BYTES = 7340032,
-  MIXED = 14680064,
-  MASK = 16711680,
+  STRING = 0x00100000,
+  BOOLEAN = 0x00200000,
+  INT32 = 0x00400000,
+  INT32_VEC = 0x00410000,
+  INT64 = 0x00500000,
+  INT64_VEC = 0x00510000,
+  FLOAT = 0x00600000,
+  FLOAT_VEC = 0x00610000,
+  BYTES = 0x00700000,
+  MIXED = 0x00e00000,
+  MASK = 0x00ff0000,
 }
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleSeatOccupancyState.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleSeatOccupancyState.aidl
similarity index 100%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleSeatOccupancyState.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleSeatOccupancyState.aidl
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleTurnSignal.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleTurnSignal.aidl
similarity index 97%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleTurnSignal.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleTurnSignal.aidl
index 78c1795..0431b45 100644
--- a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleTurnSignal.aidl
+++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleTurnSignal.aidl
@@ -34,7 +34,7 @@
 package android.hardware.automotive.vehicle;
 @Backing(type="int") @VintfStability
 enum VehicleTurnSignal {
-  NONE = 0,
-  RIGHT = 1,
-  LEFT = 2,
+  NONE = 0x00,
+  RIGHT = 0x01,
+  LEFT = 0x02,
 }
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleUnit.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleUnit.aidl
similarity index 73%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleUnit.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleUnit.aidl
index c80fdbb..8a18d4a 100644
--- a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleUnit.aidl
+++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleUnit.aidl
@@ -34,37 +34,37 @@
 package android.hardware.automotive.vehicle;
 @Backing(type="int") @VintfStability
 enum VehicleUnit {
-  SHOULD_NOT_USE = 0,
-  METER_PER_SEC = 1,
-  RPM = 2,
-  HERTZ = 3,
-  PERCENTILE = 16,
-  MILLIMETER = 32,
-  METER = 33,
-  KILOMETER = 35,
-  MILE = 36,
-  CELSIUS = 48,
-  FAHRENHEIT = 49,
-  KELVIN = 50,
-  MILLILITER = 64,
-  LITER = 65,
-  GALLON = 66,
-  US_GALLON = 66,
-  IMPERIAL_GALLON = 67,
-  NANO_SECS = 80,
-  SECS = 83,
-  YEAR = 89,
-  WATT_HOUR = 96,
-  MILLIAMPERE = 97,
-  MILLIVOLT = 98,
-  MILLIWATTS = 99,
-  AMPERE_HOURS = 100,
-  KILOWATT_HOUR = 101,
-  AMPERE = 102,
-  KILOPASCAL = 112,
-  PSI = 113,
-  BAR = 114,
-  DEGREES = 128,
-  MILES_PER_HOUR = 144,
-  KILOMETERS_PER_HOUR = 145,
+  SHOULD_NOT_USE = 0x000,
+  METER_PER_SEC = 0x01,
+  RPM = 0x02,
+  HERTZ = 0x03,
+  PERCENTILE = 0x10,
+  MILLIMETER = 0x20,
+  METER = 0x21,
+  KILOMETER = 0x23,
+  MILE = 0x24,
+  CELSIUS = 0x30,
+  FAHRENHEIT = 0x31,
+  KELVIN = 0x32,
+  MILLILITER = 0x40,
+  LITER = 0x41,
+  GALLON = 0x42,
+  US_GALLON = 0x42,
+  IMPERIAL_GALLON = 0x43,
+  NANO_SECS = 0x50,
+  SECS = 0x53,
+  YEAR = 0x59,
+  WATT_HOUR = 0x60,
+  MILLIAMPERE = 0x61,
+  MILLIVOLT = 0x62,
+  MILLIWATTS = 0x63,
+  AMPERE_HOURS = 0x64,
+  KILOWATT_HOUR = 0x65,
+  AMPERE = 0x66,
+  KILOPASCAL = 0x70,
+  PSI = 0x71,
+  BAR = 0x72,
+  DEGREES = 0x80,
+  MILES_PER_HOUR = 0x90,
+  KILOMETERS_PER_HOUR = 0x91,
 }
diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleVendorPermission.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleVendorPermission.aidl
new file mode 100644
index 0000000..3aa326c
--- /dev/null
+++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleVendorPermission.aidl
@@ -0,0 +1,75 @@
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE.                          //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+//     the interface (from the latest frozen version), the build system will
+//     prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.automotive.vehicle;
+@Backing(type="int") @VintfStability
+enum VehicleVendorPermission {
+  PERMISSION_DEFAULT = 0x00000000,
+  PERMISSION_SET_VENDOR_CATEGORY_WINDOW = 0X00000001,
+  PERMISSION_GET_VENDOR_CATEGORY_WINDOW = 0x00000002,
+  PERMISSION_SET_VENDOR_CATEGORY_DOOR = 0x00000003,
+  PERMISSION_GET_VENDOR_CATEGORY_DOOR = 0x00000004,
+  PERMISSION_SET_VENDOR_CATEGORY_SEAT = 0x00000005,
+  PERMISSION_GET_VENDOR_CATEGORY_SEAT = 0x00000006,
+  PERMISSION_SET_VENDOR_CATEGORY_MIRROR = 0x00000007,
+  PERMISSION_GET_VENDOR_CATEGORY_MIRROR = 0x00000008,
+  PERMISSION_SET_VENDOR_CATEGORY_INFO = 0x00000009,
+  PERMISSION_GET_VENDOR_CATEGORY_INFO = 0x0000000A,
+  PERMISSION_SET_VENDOR_CATEGORY_ENGINE = 0x0000000B,
+  PERMISSION_GET_VENDOR_CATEGORY_ENGINE = 0x0000000C,
+  PERMISSION_SET_VENDOR_CATEGORY_HVAC = 0x0000000D,
+  PERMISSION_GET_VENDOR_CATEGORY_HVAC = 0x0000000E,
+  PERMISSION_SET_VENDOR_CATEGORY_LIGHT = 0x0000000F,
+  PERMISSION_GET_VENDOR_CATEGORY_LIGHT = 0x00000010,
+  PERMISSION_SET_VENDOR_CATEGORY_1 = 0x00010000,
+  PERMISSION_GET_VENDOR_CATEGORY_1 = 0x00011000,
+  PERMISSION_SET_VENDOR_CATEGORY_2 = 0x00020000,
+  PERMISSION_GET_VENDOR_CATEGORY_2 = 0x00021000,
+  PERMISSION_SET_VENDOR_CATEGORY_3 = 0x00030000,
+  PERMISSION_GET_VENDOR_CATEGORY_3 = 0x00031000,
+  PERMISSION_SET_VENDOR_CATEGORY_4 = 0x00040000,
+  PERMISSION_GET_VENDOR_CATEGORY_4 = 0x00041000,
+  PERMISSION_SET_VENDOR_CATEGORY_5 = 0x00050000,
+  PERMISSION_GET_VENDOR_CATEGORY_5 = 0x00051000,
+  PERMISSION_SET_VENDOR_CATEGORY_6 = 0x00060000,
+  PERMISSION_GET_VENDOR_CATEGORY_6 = 0x00061000,
+  PERMISSION_SET_VENDOR_CATEGORY_7 = 0x00070000,
+  PERMISSION_GET_VENDOR_CATEGORY_7 = 0x00071000,
+  PERMISSION_SET_VENDOR_CATEGORY_8 = 0x00080000,
+  PERMISSION_GET_VENDOR_CATEGORY_8 = 0x00081000,
+  PERMISSION_SET_VENDOR_CATEGORY_9 = 0x00090000,
+  PERMISSION_GET_VENDOR_CATEGORY_9 = 0x00091000,
+  PERMISSION_SET_VENDOR_CATEGORY_10 = 0x000A0000,
+  PERMISSION_GET_VENDOR_CATEGORY_10 = 0x000A1000,
+  PERMISSION_NOT_ACCESSIBLE = 0xF0000000,
+}
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VmsAvailabilityStateIntegerValuesIndex.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VmsAvailabilityStateIntegerValuesIndex.aidl
similarity index 100%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VmsAvailabilityStateIntegerValuesIndex.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VmsAvailabilityStateIntegerValuesIndex.aidl
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VmsBaseMessageIntegerValuesIndex.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VmsBaseMessageIntegerValuesIndex.aidl
similarity index 100%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VmsBaseMessageIntegerValuesIndex.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VmsBaseMessageIntegerValuesIndex.aidl
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VmsMessageType.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VmsMessageType.aidl
similarity index 100%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VmsMessageType.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VmsMessageType.aidl
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VmsMessageWithLayerAndPublisherIdIntegerValuesIndex.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VmsMessageWithLayerAndPublisherIdIntegerValuesIndex.aidl
similarity index 100%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VmsMessageWithLayerAndPublisherIdIntegerValuesIndex.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VmsMessageWithLayerAndPublisherIdIntegerValuesIndex.aidl
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VmsMessageWithLayerIntegerValuesIndex.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VmsMessageWithLayerIntegerValuesIndex.aidl
similarity index 100%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VmsMessageWithLayerIntegerValuesIndex.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VmsMessageWithLayerIntegerValuesIndex.aidl
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VmsOfferingMessageIntegerValuesIndex.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VmsOfferingMessageIntegerValuesIndex.aidl
similarity index 100%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VmsOfferingMessageIntegerValuesIndex.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VmsOfferingMessageIntegerValuesIndex.aidl
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VmsPublisherInformationIntegerValuesIndex.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VmsPublisherInformationIntegerValuesIndex.aidl
similarity index 100%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VmsPublisherInformationIntegerValuesIndex.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VmsPublisherInformationIntegerValuesIndex.aidl
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VmsStartSessionMessageIntegerValuesIndex.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VmsStartSessionMessageIntegerValuesIndex.aidl
similarity index 100%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VmsStartSessionMessageIntegerValuesIndex.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VmsStartSessionMessageIntegerValuesIndex.aidl
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VmsSubscriptionsStateIntegerValuesIndex.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VmsSubscriptionsStateIntegerValuesIndex.aidl
similarity index 100%
rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VmsSubscriptionsStateIntegerValuesIndex.aidl
rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VmsSubscriptionsStateIntegerValuesIndex.aidl
diff --git a/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/AutomaticEmergencyBrakingState.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/AutomaticEmergencyBrakingState.aidl
new file mode 100644
index 0000000..540c663
--- /dev/null
+++ b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/AutomaticEmergencyBrakingState.aidl
@@ -0,0 +1,49 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.automotive.vehicle;
+
+/**
+ * Used to enumerate the state of Automatic Emergency Braking (AEB).
+ */
+@VintfStability
+@Backing(type="int")
+enum AutomaticEmergencyBrakingState {
+
+    /**
+     * This state is used as an alternative to any AutomaticEmergencyBrakingState value that is not
+     * defined in the platform. Ideally, implementations of
+     * VehicleProperty#AUTOMATIC_EMERGENCY_BRAKING_STATE should not use this state. The framework
+     * can use this field to remain backwards compatible if AutomaticEmergencyBrakingState is
+     * extended to include additional states.
+     */
+    OTHER = 0,
+    /**
+     * AEB is enabled and monitoring safety, but brakes are not activated.
+     */
+    ENABLED = 1,
+    /**
+     * AEB is enabled and currently has the brakes applied for the vehicle.
+     */
+    ACTIVATED = 2,
+    /**
+     * Many AEB implementations allow the driver to override AEB. This means that the car has
+     * determined it should brake, but a user decides to take over and do something else. This is
+     * often done for safety reasons and to ensure that the driver can always take control of the
+     * vehicle. This state should be set when the user is actively overriding the AEB system.
+     */
+    USER_OVERRIDE = 3,
+}
diff --git a/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/BlindSpotWarningState.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/BlindSpotWarningState.aidl
new file mode 100644
index 0000000..3f567c0
--- /dev/null
+++ b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/BlindSpotWarningState.aidl
@@ -0,0 +1,44 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.automotive.vehicle;
+
+/**
+ * Used to enumerate the state of Blind Spot Warning State (BSW).
+ */
+@VintfStability
+@Backing(type="int")
+enum BlindSpotWarningState {
+
+    /**
+     * This state is used as an alternative to any BlindSpotWarningState value that is not
+     * defined in the platform. Ideally, implementations of
+     * VehicleProperty#BLIND_SPOT_WARNING_STATE should not use this state. The framework
+     * can use this field to remain backwards compatible if BlindSpotWarningState is
+     * extended to include additional states.
+     */
+    OTHER = 0,
+    /**
+     * BSW is enabled and monitoring safety, but no vehicle or object detected in the vehicle's
+     * blind spot.
+     */
+    NO_WARNING = 1,
+    /**
+     * BSW is enabled, detects a vehicle or object in the vehicle's blind spot, and is actively
+     * warning the user.
+     */
+    WARNING = 2,
+}
diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/CreateUserRequest.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/CreateUserRequest.aidl
similarity index 100%
rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/CreateUserRequest.aidl
rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/CreateUserRequest.aidl
diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/CreateUserResponse.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/CreateUserResponse.aidl
similarity index 100%
rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/CreateUserResponse.aidl
rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/CreateUserResponse.aidl
diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/CreateUserStatus.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/CreateUserStatus.aidl
similarity index 100%
rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/CreateUserStatus.aidl
rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/CreateUserStatus.aidl
diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/CustomInputType.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/CustomInputType.aidl
similarity index 100%
rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/CustomInputType.aidl
rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/CustomInputType.aidl
diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/DiagnosticFloatSensorIndex.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/DiagnosticFloatSensorIndex.aidl
similarity index 100%
rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/DiagnosticFloatSensorIndex.aidl
rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/DiagnosticFloatSensorIndex.aidl
diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/DiagnosticIntegerSensorIndex.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/DiagnosticIntegerSensorIndex.aidl
similarity index 100%
rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/DiagnosticIntegerSensorIndex.aidl
rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/DiagnosticIntegerSensorIndex.aidl
diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/ElectronicTollCollectionCardStatus.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/ElectronicTollCollectionCardStatus.aidl
similarity index 100%
rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/ElectronicTollCollectionCardStatus.aidl
rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/ElectronicTollCollectionCardStatus.aidl
diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/ElectronicTollCollectionCardType.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/ElectronicTollCollectionCardType.aidl
similarity index 100%
rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/ElectronicTollCollectionCardType.aidl
rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/ElectronicTollCollectionCardType.aidl
diff --git a/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/ErrorState.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/ErrorState.aidl
new file mode 100644
index 0000000..0c62575
--- /dev/null
+++ b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/ErrorState.aidl
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.automotive.vehicle;
+
+/**
+ * Used to enumerate the possible error states. For version 2 of this interface, ErrorState is used
+ * by ADAS STATE properties, but its use may be expanded in future releases.
+ */
+@VintfStability
+@Backing(type="int")
+enum ErrorState {
+
+    /**
+     * This state is used as an alternative to any ErrorState value that is not defined in the
+     * platform. Ideally, implementations of vehicle properties should not use this state. The
+     * framework can use this field to remain backwards compatible if this enum is extended to
+     * include additional states.
+     */
+    OTHER_ERROR_STATE = -1,
+    NOT_AVAILABLE_DISABLED = -2,
+    NOT_AVAILABLE_SPEED_LOW = -3,
+    NOT_AVAILABLE_SPEED_HIGH = -4,
+    NOT_AVAILABLE_SAFETY = -5,
+}
diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/EvChargeState.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/EvChargeState.aidl
similarity index 100%
rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/EvChargeState.aidl
rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/EvChargeState.aidl
diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/EvConnectorType.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/EvConnectorType.aidl
similarity index 100%
rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/EvConnectorType.aidl
rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/EvConnectorType.aidl
diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/EvRegenerativeBrakingState.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/EvRegenerativeBrakingState.aidl
similarity index 100%
rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/EvRegenerativeBrakingState.aidl
rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/EvRegenerativeBrakingState.aidl
diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/EvStoppingMode.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/EvStoppingMode.aidl
similarity index 100%
rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/EvStoppingMode.aidl
rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/EvStoppingMode.aidl
diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/EvsServiceRequestIndex.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/EvsServiceRequestIndex.aidl
similarity index 100%
rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/EvsServiceRequestIndex.aidl
rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/EvsServiceRequestIndex.aidl
diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/EvsServiceState.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/EvsServiceState.aidl
similarity index 100%
rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/EvsServiceState.aidl
rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/EvsServiceState.aidl
diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/EvsServiceType.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/EvsServiceType.aidl
similarity index 100%
rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/EvsServiceType.aidl
rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/EvsServiceType.aidl
diff --git a/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/ForwardCollisionWarningState.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/ForwardCollisionWarningState.aidl
new file mode 100644
index 0000000..b20cf25
--- /dev/null
+++ b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/ForwardCollisionWarningState.aidl
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.automotive.vehicle;
+
+/**
+ * Used to enumerate the state of Forward Collision Warning State (FCW).
+ */
+@VintfStability
+@Backing(type="int")
+enum ForwardCollisionWarningState {
+
+    /**
+     * This state is used as an alternative to any ForwardCollisionWarningState value that is not
+     * defined in the platform. Ideally, implementations of
+     * VehicleProperty#FORWARD_COLLISION_WARNING_STATE should not use this state. The framework
+     * can use this field to remain backwards compatible if ForwardCollisionWarningState is
+     * extended to include additional states.
+     */
+    OTHER = 0,
+    /**
+     * FCW is enabled and monitoring safety, but no potential collision is detected.
+     */
+    NO_WARNING = 1,
+    /**
+     * FCW is enabled, detects a potential collision, and is actively warning the user.
+     */
+    WARNING = 2,
+}
diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/FuelType.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/FuelType.aidl
similarity index 100%
rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/FuelType.aidl
rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/FuelType.aidl
diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/GsrComplianceRequirementType.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/GsrComplianceRequirementType.aidl
similarity index 100%
rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/GsrComplianceRequirementType.aidl
rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/GsrComplianceRequirementType.aidl
diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/InitialUserInfoRequest.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/InitialUserInfoRequest.aidl
similarity index 100%
rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/InitialUserInfoRequest.aidl
rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/InitialUserInfoRequest.aidl
diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/InitialUserInfoRequestType.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/InitialUserInfoRequestType.aidl
similarity index 100%
rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/InitialUserInfoRequestType.aidl
rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/InitialUserInfoRequestType.aidl
diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/InitialUserInfoResponse.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/InitialUserInfoResponse.aidl
similarity index 100%
rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/InitialUserInfoResponse.aidl
rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/InitialUserInfoResponse.aidl
diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/InitialUserInfoResponseAction.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/InitialUserInfoResponseAction.aidl
similarity index 100%
rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/InitialUserInfoResponseAction.aidl
rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/InitialUserInfoResponseAction.aidl
diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/Obd2CommonIgnitionMonitors.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/Obd2CommonIgnitionMonitors.aidl
similarity index 100%
rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/Obd2CommonIgnitionMonitors.aidl
rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/Obd2CommonIgnitionMonitors.aidl
diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/Obd2CompressionIgnitionMonitors.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/Obd2CompressionIgnitionMonitors.aidl
similarity index 100%
rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/Obd2CompressionIgnitionMonitors.aidl
rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/Obd2CompressionIgnitionMonitors.aidl
diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/Obd2FuelSystemStatus.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/Obd2FuelSystemStatus.aidl
similarity index 100%
rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/Obd2FuelSystemStatus.aidl
rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/Obd2FuelSystemStatus.aidl
diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/Obd2FuelType.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/Obd2FuelType.aidl
similarity index 100%
rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/Obd2FuelType.aidl
rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/Obd2FuelType.aidl
diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/Obd2IgnitionMonitorKind.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/Obd2IgnitionMonitorKind.aidl
similarity index 100%
rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/Obd2IgnitionMonitorKind.aidl
rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/Obd2IgnitionMonitorKind.aidl
diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/Obd2SecondaryAirStatus.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/Obd2SecondaryAirStatus.aidl
similarity index 100%
rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/Obd2SecondaryAirStatus.aidl
rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/Obd2SecondaryAirStatus.aidl
diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/Obd2SparkIgnitionMonitors.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/Obd2SparkIgnitionMonitors.aidl
similarity index 100%
rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/Obd2SparkIgnitionMonitors.aidl
rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/Obd2SparkIgnitionMonitors.aidl
diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/PortLocationType.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/PortLocationType.aidl
similarity index 100%
rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/PortLocationType.aidl
rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/PortLocationType.aidl
diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/ProcessTerminationReason.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/ProcessTerminationReason.aidl
similarity index 100%
rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/ProcessTerminationReason.aidl
rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/ProcessTerminationReason.aidl
diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/RemoveUserRequest.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/RemoveUserRequest.aidl
similarity index 100%
rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/RemoveUserRequest.aidl
rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/RemoveUserRequest.aidl
diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/RotaryInputType.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/RotaryInputType.aidl
similarity index 100%
rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/RotaryInputType.aidl
rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/RotaryInputType.aidl
diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/SwitchUserMessageType.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/SwitchUserMessageType.aidl
similarity index 100%
rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/SwitchUserMessageType.aidl
rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/SwitchUserMessageType.aidl
diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/SwitchUserRequest.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/SwitchUserRequest.aidl
similarity index 100%
rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/SwitchUserRequest.aidl
rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/SwitchUserRequest.aidl
diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/SwitchUserResponse.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/SwitchUserResponse.aidl
similarity index 100%
rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/SwitchUserResponse.aidl
rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/SwitchUserResponse.aidl
diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/SwitchUserStatus.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/SwitchUserStatus.aidl
similarity index 100%
rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/SwitchUserStatus.aidl
rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/SwitchUserStatus.aidl
diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/TrailerState.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/TrailerState.aidl
similarity index 100%
rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/TrailerState.aidl
rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/TrailerState.aidl
diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/UserIdentificationAssociation.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/UserIdentificationAssociation.aidl
similarity index 100%
rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/UserIdentificationAssociation.aidl
rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/UserIdentificationAssociation.aidl
diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/UserIdentificationAssociationSetValue.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/UserIdentificationAssociationSetValue.aidl
similarity index 100%
rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/UserIdentificationAssociationSetValue.aidl
rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/UserIdentificationAssociationSetValue.aidl
diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/UserIdentificationAssociationType.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/UserIdentificationAssociationType.aidl
similarity index 100%
rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/UserIdentificationAssociationType.aidl
rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/UserIdentificationAssociationType.aidl
diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/UserIdentificationAssociationValue.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/UserIdentificationAssociationValue.aidl
similarity index 100%
rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/UserIdentificationAssociationValue.aidl
rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/UserIdentificationAssociationValue.aidl
diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/UserIdentificationGetRequest.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/UserIdentificationGetRequest.aidl
similarity index 100%
rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/UserIdentificationGetRequest.aidl
rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/UserIdentificationGetRequest.aidl
diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/UserIdentificationResponse.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/UserIdentificationResponse.aidl
similarity index 100%
rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/UserIdentificationResponse.aidl
rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/UserIdentificationResponse.aidl
diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/UserIdentificationSetAssociation.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/UserIdentificationSetAssociation.aidl
similarity index 100%
rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/UserIdentificationSetAssociation.aidl
rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/UserIdentificationSetAssociation.aidl
diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/UserIdentificationSetRequest.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/UserIdentificationSetRequest.aidl
similarity index 100%
rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/UserIdentificationSetRequest.aidl
rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/UserIdentificationSetRequest.aidl
diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/UserInfo.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/UserInfo.aidl
similarity index 100%
rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/UserInfo.aidl
rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/UserInfo.aidl
diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/UsersInfo.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/UsersInfo.aidl
similarity index 100%
rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/UsersInfo.aidl
rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/UsersInfo.aidl
diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleApPowerBootupReason.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleApPowerBootupReason.aidl
similarity index 100%
rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleApPowerBootupReason.aidl
rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleApPowerBootupReason.aidl
diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleApPowerStateConfigFlag.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleApPowerStateConfigFlag.aidl
similarity index 100%
rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleApPowerStateConfigFlag.aidl
rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleApPowerStateConfigFlag.aidl
diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleApPowerStateReport.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleApPowerStateReport.aidl
similarity index 100%
rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleApPowerStateReport.aidl
rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleApPowerStateReport.aidl
diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleApPowerStateReq.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleApPowerStateReq.aidl
similarity index 100%
rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleApPowerStateReq.aidl
rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleApPowerStateReq.aidl
diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleApPowerStateReqIndex.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleApPowerStateReqIndex.aidl
similarity index 100%
rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleApPowerStateReqIndex.aidl
rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleApPowerStateReqIndex.aidl
diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleApPowerStateShutdownParam.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleApPowerStateShutdownParam.aidl
similarity index 100%
rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleApPowerStateShutdownParam.aidl
rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleApPowerStateShutdownParam.aidl
diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleArea.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleArea.aidl
similarity index 100%
rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleArea.aidl
rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleArea.aidl
diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleAreaDoor.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleAreaDoor.aidl
similarity index 100%
rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleAreaDoor.aidl
rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleAreaDoor.aidl
diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleAreaMirror.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleAreaMirror.aidl
similarity index 100%
rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleAreaMirror.aidl
rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleAreaMirror.aidl
diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleAreaSeat.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleAreaSeat.aidl
similarity index 100%
rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleAreaSeat.aidl
rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleAreaSeat.aidl
diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleAreaWheel.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleAreaWheel.aidl
similarity index 100%
rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleAreaWheel.aidl
rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleAreaWheel.aidl
diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleAreaWindow.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleAreaWindow.aidl
similarity index 100%
rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleAreaWindow.aidl
rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleAreaWindow.aidl
diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleDisplay.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleDisplay.aidl
similarity index 100%
rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleDisplay.aidl
rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleDisplay.aidl
diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleGear.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleGear.aidl
similarity index 100%
rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleGear.aidl
rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleGear.aidl
diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleHvacFanDirection.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleHvacFanDirection.aidl
similarity index 100%
rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleHvacFanDirection.aidl
rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleHvacFanDirection.aidl
diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleHwKeyInputAction.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleHwKeyInputAction.aidl
similarity index 100%
rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleHwKeyInputAction.aidl
rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleHwKeyInputAction.aidl
diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleHwMotionButtonStateFlag.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleHwMotionButtonStateFlag.aidl
similarity index 100%
rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleHwMotionButtonStateFlag.aidl
rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleHwMotionButtonStateFlag.aidl
diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleHwMotionInputAction.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleHwMotionInputAction.aidl
similarity index 100%
rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleHwMotionInputAction.aidl
rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleHwMotionInputAction.aidl
diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleHwMotionInputSource.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleHwMotionInputSource.aidl
similarity index 100%
rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleHwMotionInputSource.aidl
rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleHwMotionInputSource.aidl
diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleHwMotionToolType.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleHwMotionToolType.aidl
similarity index 100%
rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleHwMotionToolType.aidl
rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleHwMotionToolType.aidl
diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleIgnitionState.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleIgnitionState.aidl
similarity index 100%
rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleIgnitionState.aidl
rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleIgnitionState.aidl
diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleLightState.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleLightState.aidl
similarity index 100%
rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleLightState.aidl
rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleLightState.aidl
diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleLightSwitch.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleLightSwitch.aidl
similarity index 100%
rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleLightSwitch.aidl
rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleLightSwitch.aidl
diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleOilLevel.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleOilLevel.aidl
similarity index 100%
rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleOilLevel.aidl
rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleOilLevel.aidl
diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleProperty.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleProperty.aidl
similarity index 97%
rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleProperty.aidl
rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleProperty.aidl
index e776154..39d8433 100644
--- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleProperty.aidl
+++ b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleProperty.aidl
@@ -3429,6 +3429,10 @@
      * Set true to enable AEB and false to disable AEB. When AEB is enabled, the ADAS system in the
      * vehicle should be turned on and monitoring to avoid potential collisions.
      *
+     * If AEB is not available, IVehicle#get must not return any NOT_AVAILABLE value in StatusCode.
+     * Other StatusCode values like TRY_AGAIN may still be used as needed. For example, if AEB is
+     * not available because the vehicle speed is too low, IVehicle#get must return false.
+     *
      * This property is defined as read_write, but OEMs have the option to implement it as read
      * only.
      *
@@ -3439,11 +3443,37 @@
             0x1000 + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.BOOLEAN,
 
     /**
+     * Automatic Emergency Braking (AEB) state.
+     *
+     * Returns the current state of AEB. This property must always return a valid state defined in
+     * AutomaticEmergencyBrakingState or ErrorState. It must not surface errors through StatusCode
+     * and must use the supported error states instead.
+     *
+     * If AEB includes forward collision warnings before activating the brakes, those warnings must
+     * be surfaced through the Forward Collision Warning (FCW) properties.
+     *
+     * For the global area ID (0), the VehicleAreaConfig#supportedEnumValues array must be defined
+     * unless all states of both AutomaticEmergencyBrakingState (including OTHER, which is not
+     * recommended) and ErrorState are supported.
+     *
+     * @change_mode VehiclePropertyChangeMode.ON_CHANGE
+     * @access VehiclePropertyAccess.READ
+     * @data_enum AutomaticEmergencyBrakingState
+     * @data_enum ErrorState
+     */
+    AUTOMATIC_EMERGENCY_BRAKING_STATE =
+            0x1001 + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.INT32,
+
+    /**
      * Enable or disable forward collision warning (FCW).
      *
      * Set true to enable FCW and false to disable FCW. When FCW is enabled, the ADAS system in the
      * vehicle should be turned on and monitoring for potential collisions.
      *
+     * If FCW is not available, IVehicle#get must not return any NOT_AVAILABLE value in StatusCode.
+     * Other StatusCode values like TRY_AGAIN may still be used as needed. For example, if FCW is
+     * not available because the vehicle speed is too low, IVehicle#get must return false.
+     *
      * This property is defined as read_write, but OEMs have the option to implement it as read
      * only.
      *
@@ -3454,11 +3484,34 @@
             0x1002 + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.BOOLEAN,
 
     /**
+     * Forward Collision Warning (FCW) state.
+     *
+     * Returns the current state of FCW. This property must always return a valid state defined in
+     * ForwardCollisionWarningState or ErrorState. It must not surface errors through StatusCode
+     * and must use the supported error states instead.
+     *
+     * For the global area ID (0), the VehicleAreaConfig#supportedEnumValues array must be defined
+     * unless all states of both ForwardCollisionWarningState (including OTHER, which is not
+     * recommended) and ErrorState are supported.
+     *
+     * @change_mode VehiclePropertyChangeMode.ON_CHANGE
+     * @access VehiclePropertyAccess.READ
+     * @data_enum ForwardCollisionWarningState
+     * @data_enum ErrorState
+     */
+    FORWARD_COLLISION_WARNING_STATE =
+            0x1003 + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.INT32,
+
+    /**
      * Enable and disable blind spot warning (BSW).
      *
      * Set true to enable BSW and false to disable BSW. When BSW is enabled, the ADAS system in the
      * vehicle should be turned on and monitoring for objects in the vehicle’s blind spots.
      *
+     * If BSW is not available, IVehicle#get must not return any NOT_AVAILABLE value in StatusCode.
+     * Other StatusCode values like TRY_AGAIN may still be used as needed. For example, if BSW is
+     * not available because the vehicle speed is too low, IVehicle#get must return false.
+     *
      * This property is defined as read_write, but OEMs have the option to implement it as read
      * only.
      *
@@ -3469,6 +3522,25 @@
             0x1004 + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.BOOLEAN,
 
     /**
+     * Blind Spot Warning (BSW) state.
+     *
+     * Returns the current state of BSW. This property must always return a valid state defined in
+     * BlindSpotWarningState or ErrorState. It must not surface errors through StatusCode
+     * and must use the supported error states instead.
+     *
+     * For each supported area ID, the VehicleAreaConfig#supportedEnumValues array must be defined
+     * unless all states of both BlindSpotWarningState (including OTHER, which is not
+     * recommended) and ErrorState are supported.
+     *
+     * @change_mode VehiclePropertyChangeMode.ON_CHANGE
+     * @access VehiclePropertyAccess.READ
+     * @data_enum BlindSpotWarningState
+     * @data_enum ErrorState
+     */
+    BLIND_SPOT_WARNING_STATE =
+            0x1005 + VehiclePropertyGroup.SYSTEM + VehicleArea.MIRROR + VehiclePropertyType.INT32,
+
+    /**
      * Enable or disable lane departure warning (LDW).
      *
      * Set true to enable LDW and false to disable LDW. When LDW is enabled, the ADAS system in the
@@ -3574,7 +3646,7 @@
      * @access VehiclePropertyAccess.READ_WRITE
      */
     HANDS_ON_DETECTION_ENABLED =
-            0x1015 + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.BOOLEAN,
+            0x1016 + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.BOOLEAN,
 
     /**
      * Enable or disable driver attention monitoring.
@@ -3591,7 +3663,7 @@
      * @access VehiclePropertyAccess.READ_WRITE
      */
     DRIVER_ATTENTION_MONITORING_ENABLED =
-            0x1018 + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.BOOLEAN,
+            0x1019 + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.BOOLEAN,
 
     /***************************************************************************
      * End of ADAS Properties
diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehiclePropertyGroup.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehiclePropertyGroup.aidl
similarity index 100%
rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehiclePropertyGroup.aidl
rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehiclePropertyGroup.aidl
diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehiclePropertyType.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehiclePropertyType.aidl
similarity index 100%
rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehiclePropertyType.aidl
rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehiclePropertyType.aidl
diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleSeatOccupancyState.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleSeatOccupancyState.aidl
similarity index 100%
rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleSeatOccupancyState.aidl
rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleSeatOccupancyState.aidl
diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleTurnSignal.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleTurnSignal.aidl
similarity index 100%
rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleTurnSignal.aidl
rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleTurnSignal.aidl
diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleUnit.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleUnit.aidl
similarity index 100%
rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleUnit.aidl
rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleUnit.aidl
diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleVendorPermission.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleVendorPermission.aidl
similarity index 100%
rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleVendorPermission.aidl
rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleVendorPermission.aidl
diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VmsAvailabilityStateIntegerValuesIndex.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VmsAvailabilityStateIntegerValuesIndex.aidl
similarity index 100%
rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/VmsAvailabilityStateIntegerValuesIndex.aidl
rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VmsAvailabilityStateIntegerValuesIndex.aidl
diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VmsBaseMessageIntegerValuesIndex.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VmsBaseMessageIntegerValuesIndex.aidl
similarity index 100%
rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/VmsBaseMessageIntegerValuesIndex.aidl
rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VmsBaseMessageIntegerValuesIndex.aidl
diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VmsMessageType.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VmsMessageType.aidl
similarity index 100%
rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/VmsMessageType.aidl
rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VmsMessageType.aidl
diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VmsMessageWithLayerAndPublisherIdIntegerValuesIndex.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VmsMessageWithLayerAndPublisherIdIntegerValuesIndex.aidl
similarity index 100%
rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/VmsMessageWithLayerAndPublisherIdIntegerValuesIndex.aidl
rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VmsMessageWithLayerAndPublisherIdIntegerValuesIndex.aidl
diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VmsMessageWithLayerIntegerValuesIndex.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VmsMessageWithLayerIntegerValuesIndex.aidl
similarity index 100%
rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/VmsMessageWithLayerIntegerValuesIndex.aidl
rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VmsMessageWithLayerIntegerValuesIndex.aidl
diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VmsOfferingMessageIntegerValuesIndex.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VmsOfferingMessageIntegerValuesIndex.aidl
similarity index 100%
rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/VmsOfferingMessageIntegerValuesIndex.aidl
rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VmsOfferingMessageIntegerValuesIndex.aidl
diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VmsPublisherInformationIntegerValuesIndex.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VmsPublisherInformationIntegerValuesIndex.aidl
similarity index 100%
rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/VmsPublisherInformationIntegerValuesIndex.aidl
rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VmsPublisherInformationIntegerValuesIndex.aidl
diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VmsStartSessionMessageIntegerValuesIndex.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VmsStartSessionMessageIntegerValuesIndex.aidl
similarity index 100%
rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/VmsStartSessionMessageIntegerValuesIndex.aidl
rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VmsStartSessionMessageIntegerValuesIndex.aidl
diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VmsSubscriptionsStateIntegerValuesIndex.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VmsSubscriptionsStateIntegerValuesIndex.aidl
similarity index 100%
rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/VmsSubscriptionsStateIntegerValuesIndex.aidl
rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VmsSubscriptionsStateIntegerValuesIndex.aidl
diff --git a/automotive/vehicle/tools/generate_annotation_enums.py b/automotive/vehicle/tools/generate_annotation_enums.py
index fc6f157..c36cbb0 100644
--- a/automotive/vehicle/tools/generate_annotation_enums.py
+++ b/automotive/vehicle/tools/generate_annotation_enums.py
@@ -27,8 +27,8 @@
 import re
 import sys
 
-PROP_AIDL_FILE_PATH = ("hardware/interfaces/automotive/vehicle/aidl/android/hardware/automotive/" +
-    "vehicle/VehicleProperty.aidl")
+PROP_AIDL_FILE_PATH = ("hardware/interfaces/automotive/vehicle/aidl_property/android/hardware/" +
+    "automotive/vehicle/VehicleProperty.aidl")
 CHANGE_MODE_CPP_FILE_PATH = ("hardware/interfaces/automotive/vehicle/aidl/generated_lib/cpp/" +
     "ChangeModeForVehicleProperty.h")
 ACCESS_CPP_FILE_PATH = ("hardware/interfaces/automotive/vehicle/aidl/generated_lib/cpp/" +
@@ -69,6 +69,8 @@
  * Generated by tools/generate_annotation_enums.py.
  */
 
+// clang-format off
+
 """
 
 CHANGE_MODE_CPP_HEADER = """#ifndef android_hardware_automotive_vehicle_aidl_generated_lib_ChangeModeForVehicleProperty_H_
diff --git a/automotive/vehicle/vhal_static_cpp_lib.mk b/automotive/vehicle/vhal_static_cpp_lib.mk
index b15b26c..995589c 100644
--- a/automotive/vehicle/vhal_static_cpp_lib.mk
+++ b/automotive/vehicle/vhal_static_cpp_lib.mk
@@ -15,4 +15,6 @@
 # This make file contains the latest version of static cpp libraries for VHAL
 # interface and VHAL properties.
 
-LOCAL_STATIC_LIBRARIES += android.hardware.automotive.vehicle-V2-ndk
+LOCAL_STATIC_LIBRARIES += \
+    android.hardware.automotive.vehicle-V2-ndk \
+    android.hardware.automotive.vehicle.property-V2-ndk
diff --git a/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp b/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp
index 848edb8..6b0fb1b 100644
--- a/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp
+++ b/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp
@@ -684,18 +684,36 @@
                    VehiclePropertyGroup::SYSTEM, VehicleArea::GLOBAL, VehiclePropertyType::BOOLEAN);
 }
 
+TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyAutomaticEmergencyBrakingStateConfig) {
+    verifyProperty(VehicleProperty::AUTOMATIC_EMERGENCY_BRAKING_STATE, VehiclePropertyAccess::READ,
+                   VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM,
+                   VehicleArea::GLOBAL, VehiclePropertyType::INT32);
+}
+
 TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyForwardCollisionWarningEnabledConfig) {
     verifyProperty(VehicleProperty::FORWARD_COLLISION_WARNING_ENABLED,
                    VehiclePropertyAccess::READ_WRITE, VehiclePropertyChangeMode::ON_CHANGE,
                    VehiclePropertyGroup::SYSTEM, VehicleArea::GLOBAL, VehiclePropertyType::BOOLEAN);
 }
 
+TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyForwardCollisionWarningStateConfig) {
+    verifyProperty(VehicleProperty::FORWARD_COLLISION_WARNING_STATE, VehiclePropertyAccess::READ,
+                   VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM,
+                   VehicleArea::GLOBAL, VehiclePropertyType::INT32);
+}
+
 TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyBlindSpotWarningEnabledConfig) {
     verifyProperty(VehicleProperty::BLIND_SPOT_WARNING_ENABLED, VehiclePropertyAccess::READ_WRITE,
                    VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM,
                    VehicleArea::GLOBAL, VehiclePropertyType::BOOLEAN);
 }
 
+TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyBlindSpotWarningStateConfig) {
+    verifyProperty(VehicleProperty::BLIND_SPOT_WARNING_STATE, VehiclePropertyAccess::READ,
+                   VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM,
+                   VehicleArea::MIRROR, VehiclePropertyType::INT32);
+}
+
 TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyLaneDepartureWarningEnabledConfig) {
     verifyProperty(VehicleProperty::LANE_DEPARTURE_WARNING_ENABLED,
                    VehiclePropertyAccess::READ_WRITE, VehiclePropertyChangeMode::ON_CHANGE,
diff --git a/bluetooth/aidl/TEST_MAPPING b/bluetooth/aidl/TEST_MAPPING
new file mode 100644
index 0000000..342a1e4
--- /dev/null
+++ b/bluetooth/aidl/TEST_MAPPING
@@ -0,0 +1,7 @@
+{
+  "presubmit" : [
+    {
+      "name" : "VtsHalBluetoothTargetTest"
+    }
+  ]
+}
diff --git a/bluetooth/aidl/default/Android.bp b/bluetooth/aidl/default/Android.bp
index d1761f5..3f4ba99 100644
--- a/bluetooth/aidl/default/Android.bp
+++ b/bluetooth/aidl/default/Android.bp
@@ -30,6 +30,7 @@
     defaults: ["android.hardware.bluetooth-service-build-defaults"],
     srcs: [
         "BluetoothHci.cpp",
+        "net_bluetooth_mgmt.cpp",
     ],
 }
 
@@ -37,7 +38,7 @@
     name: "android.hardware.bluetooth-service.default",
     relative_install_path: "hw",
     init_rc: ["bluetooth-service-default.rc"],
-    vintf_fragments: ["bluetooth-service-default.xml"],
+    vintf_fragments: [":manifest_android.hardware.bluetooth-service.default.xml"],
     vendor: true,
     defaults: ["android.hardware.bluetooth-service-build-defaults"],
     srcs: [
@@ -77,3 +78,8 @@
         ],
     },
 }
+
+filegroup {
+    name: "manifest_android.hardware.bluetooth-service.default.xml",
+    srcs: ["bluetooth-service-default.xml"],
+}
diff --git a/bluetooth/aidl/default/BluetoothHci.cpp b/bluetooth/aidl/default/BluetoothHci.cpp
index 4d4896d..eebbbc0 100644
--- a/bluetooth/aidl/default/BluetoothHci.cpp
+++ b/bluetooth/aidl/default/BluetoothHci.cpp
@@ -44,6 +44,7 @@
 
 using namespace ::android::hardware::bluetooth::hci;
 using namespace ::android::hardware::bluetooth::async;
+using aidl::android::hardware::bluetooth::Status;
 
 namespace aidl::android::hardware::bluetooth::impl {
 
@@ -97,21 +98,25 @@
   mDeathRecipient = std::make_shared<BluetoothDeathRecipient>(this);
 }
 
-ndk::ScopedAStatus BluetoothHci::initialize(
-    const std::shared_ptr<IBluetoothHciCallbacks>& cb) {
-  ALOGI(__func__);
-
-  mFd = open(mDevPath.c_str(), O_RDWR);
-  if (mFd < 0) {
+int BluetoothHci::getFdFromDevPath() {
+  int fd = open(mDevPath.c_str(), O_RDWR);
+  if (fd < 0) {
     ALOGE("Could not connect to bt: %s (%s)", mDevPath.c_str(),
           strerror(errno));
-    return ndk::ScopedAStatus::fromServiceSpecificError(STATUS_BAD_VALUE);
+    return fd;
   }
   if (int ret = SetTerminalRaw(mFd) < 0) {
     ALOGE("Could not make %s a raw terminal %d(%s)", mDevPath.c_str(), ret,
           strerror(errno));
-    return ndk::ScopedAStatus::fromServiceSpecificError(STATUS_BAD_VALUE);
+    ::close(fd);
+    return -1;
   }
+  return fd;
+}
+
+ndk::ScopedAStatus BluetoothHci::initialize(
+    const std::shared_ptr<IBluetoothHciCallbacks>& cb) {
+  ALOGI(__func__);
 
   mCb = cb;
   if (mCb == nullptr) {
@@ -119,32 +124,36 @@
     return ndk::ScopedAStatus::fromServiceSpecificError(STATUS_BAD_VALUE);
   }
 
+  management_.reset(new NetBluetoothMgmt);
+  mFd = management_->openHci();
+  if (mFd < 0) {
+    management_.reset();
+
+    ALOGI("Unable to open Linux interface, trying default path.");
+    mFd = getFdFromDevPath();
+    if (mFd < 0) {
+      return ndk::ScopedAStatus::fromServiceSpecificError(STATUS_BAD_VALUE);
+    }
+  }
+
   mDeathRecipient->LinkToDeath(mCb);
 
-  auto init_ret = cb->initializationComplete(Status::SUCCESS);
-  if (!init_ret.isOk()) {
-    if (!mDeathRecipient->getHasDied()) {
-      ALOGE("Error sending init callback, but no death notification.");
-    }
-    return ndk::ScopedAStatus::fromServiceSpecificError(
-        STATUS_FAILED_TRANSACTION);
-  }
   mH4 = std::make_shared<H4Protocol>(
       mFd,
       [](const std::vector<uint8_t>& /* raw_command */) {
         LOG_ALWAYS_FATAL("Unexpected command!");
       },
+      [this](const std::vector<uint8_t>& raw_acl) {
+        mCb->aclDataReceived(raw_acl);
+      },
+      [this](const std::vector<uint8_t>& raw_sco) {
+        mCb->scoDataReceived(raw_sco);
+      },
       [this](const std::vector<uint8_t>& raw_event) {
         mCb->hciEventReceived(raw_event);
       },
-      [this](const std::vector<uint8_t>& raw_acl) {
-        mCb->hciEventReceived(raw_acl);
-      },
-      [this](const std::vector<uint8_t>& raw_sco) {
-        mCb->hciEventReceived(raw_sco);
-      },
       [this](const std::vector<uint8_t>& raw_iso) {
-        mCb->hciEventReceived(raw_iso);
+        mCb->isoDataReceived(raw_iso);
       },
       [this]() {
         ALOGI("HCI socket device disconnected");
@@ -152,13 +161,29 @@
       });
   mFdWatcher.WatchFdForNonBlockingReads(mFd,
                                         [this](int) { mH4->OnDataReady(); });
+
+  ALOGI("initialization complete");
+  auto status = mCb->initializationComplete(Status::SUCCESS);
+  if (!status.isOk()) {
+    if (!mDeathRecipient->getHasDied()) {
+      ALOGE("Error sending init callback, but no death notification");
+    }
+    close();
+    return ndk::ScopedAStatus::fromServiceSpecificError(
+        STATUS_FAILED_TRANSACTION);
+  }
+
   return ndk::ScopedAStatus::ok();
 }
 
 ndk::ScopedAStatus BluetoothHci::close() {
   ALOGI(__func__);
   mFdWatcher.StopWatchingFileDescriptors();
-  ::close(mFd);
+  if (management_) {
+    management_->closeHci();
+  } else {
+    ::close(mFd);
+  }
 
   return ndk::ScopedAStatus::ok();
 }
diff --git a/bluetooth/aidl/default/BluetoothHci.h b/bluetooth/aidl/default/BluetoothHci.h
index 0ed0623..a0908f8 100644
--- a/bluetooth/aidl/default/BluetoothHci.h
+++ b/bluetooth/aidl/default/BluetoothHci.h
@@ -24,6 +24,7 @@
 
 #include "async_fd_watcher.h"
 #include "h4_protocol.h"
+#include "net_bluetooth_mgmt.h"
 
 namespace aidl::android::hardware::bluetooth::impl {
 
@@ -64,8 +65,10 @@
 
   ::android::hardware::bluetooth::async::AsyncFdWatcher mFdWatcher;
 
+  int getFdFromDevPath();
   void send(::android::hardware::bluetooth::hci::PacketType type,
             const std::vector<uint8_t>& packet);
+  std::unique_ptr<NetBluetoothMgmt> management_{};
 };
 
 }  // namespace aidl::android::hardware::bluetooth::impl
diff --git a/bluetooth/aidl/default/bluetooth-service-default.rc b/bluetooth/aidl/default/bluetooth-service-default.rc
index 1841c77..dc78698 100644
--- a/bluetooth/aidl/default/bluetooth-service-default.rc
+++ b/bluetooth/aidl/default/bluetooth-service-default.rc
@@ -1,4 +1,4 @@
-service bluetooth_hal_service /vendor/bin/hw/android.hardware.bluetooth-service.default
+service vendor.bluetooth-default /vendor/bin/hw/android.hardware.bluetooth-service.default
     class hal
     capabilities BLOCK_SUSPEND NET_ADMIN SYS_NICE
     user bluetooth
diff --git a/bluetooth/aidl/default/net_bluetooth_mgmt.cpp b/bluetooth/aidl/default/net_bluetooth_mgmt.cpp
new file mode 100644
index 0000000..937cd57
--- /dev/null
+++ b/bluetooth/aidl/default/net_bluetooth_mgmt.cpp
@@ -0,0 +1,296 @@
+/*
+ * Copyright 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#define LOG_TAG "android.hardware.bluetooth.service.default"
+
+#include "net_bluetooth_mgmt.h"
+
+#include <fcntl.h>
+#include <log/log.h>
+#include <poll.h>
+#include <sys/socket.h>
+#include <unistd.h>
+
+#include <cerrno>
+#include <cstdint>
+#include <cstdlib>
+#include <cstring>
+
+// Definitions imported from <linux/net/bluetooth/bluetooth.h>
+#define BTPROTO_HCI 1
+
+// Definitions imported from <linux/net/bluetooth/hci_sock.h>
+#define HCI_CHANNEL_USER 1
+#define HCI_CHANNEL_CONTROL 3
+#define HCI_DEV_NONE 0xffff
+
+struct sockaddr_hci {
+  sa_family_t hci_family;
+  unsigned short hci_dev;
+  unsigned short hci_channel;
+};
+
+// Definitions imported from <linux/net/bluetooth/mgmt.h>
+#define MGMT_OP_READ_INDEX_LIST 0x0003
+#define MGMT_EV_INDEX_ADDED 0x0004
+#define MGMT_EV_CMD_COMPLETE 0x0001
+#define MGMT_PKT_SIZE_MAX 1024
+#define MGMT_INDEX_NONE 0xFFFF
+
+struct mgmt_pkt {
+  uint16_t opcode;
+  uint16_t index;
+  uint16_t len;
+  uint8_t data[MGMT_PKT_SIZE_MAX];
+} __attribute__((packed));
+
+struct mgmt_ev_read_index_list {
+  uint16_t opcode;
+  uint8_t status;
+  uint16_t num_controllers;
+  uint16_t index[];
+} __attribute__((packed));
+
+// Definitions imported from <linux/rfkill.h>
+#define RFKILL_STATE_SOFT_BLOCKED 0
+#define RFKILL_STATE_UNBLOCKED 1
+#define RFKILL_STATE_HARD_BLOCKED 2
+
+#define RFKILL_TYPE_BLUETOOTH 2
+
+#define RFKILL_OP_ADD 0
+#define RFKILL_OP_CHANGE 2
+
+struct rfkill_event {
+  uint32_t idx;
+  uint8_t type;
+  uint8_t op;
+  uint8_t soft;
+  uint8_t hard;
+} __attribute__((packed));
+
+namespace aidl::android::hardware::bluetooth::impl {
+
+// Wait indefinitely for the selected HCI interface to be enabled in the
+// bluetooth driver.
+int NetBluetoothMgmt::waitHciDev(int hci_interface) {
+  ALOGI("waiting for hci interface %d", hci_interface);
+
+  int ret = -1;
+  struct mgmt_pkt cmd;
+  struct pollfd pollfd;
+  struct sockaddr_hci hci_addr = {
+      .hci_family = AF_BLUETOOTH,
+      .hci_dev = HCI_DEV_NONE,
+      .hci_channel = HCI_CHANNEL_CONTROL,
+  };
+
+  // Open and bind a socket to the bluetooth control interface in the
+  // kernel driver, used to send control commands and receive control
+  // events.
+  int fd = socket(PF_BLUETOOTH, SOCK_RAW, BTPROTO_HCI);
+  if (fd < 0) {
+    ALOGE("unable to open raw bluetooth socket: %s", strerror(errno));
+    return -1;
+  }
+
+  if (bind(fd, (struct sockaddr*)&hci_addr, sizeof(hci_addr)) < 0) {
+    ALOGE("unable to bind bluetooth control channel: %s", strerror(errno));
+    goto end;
+  }
+
+  // Send the control command [Read Index List].
+  cmd = {
+      .opcode = MGMT_OP_READ_INDEX_LIST,
+      .index = MGMT_INDEX_NONE,
+      .len = 0,
+  };
+
+  if (write(fd, &cmd, 6) != 6) {
+    ALOGE("error writing mgmt command: %s", strerror(errno));
+    goto end;
+  }
+
+  // Poll the control socket waiting for the command response,
+  // and subsequent [Index Added] events. The loops continue without
+  // timeout until the selected hci interface is detected.
+  pollfd = {.fd = fd, .events = POLLIN};
+
+  for (;;) {
+    ret = poll(&pollfd, 1, -1);
+
+    // Poll interrupted, try again.
+    if (ret == -1 && (errno == EINTR || errno == EAGAIN)) {
+      continue;
+    }
+
+    // Poll failure, abandon.
+    if (ret == -1) {
+      ALOGE("poll error: %s", strerror(errno));
+      break;
+    }
+
+    // Spurious wakeup, try again.
+    if (ret == 0 || (pollfd.revents & POLLIN) == 0) {
+      continue;
+    }
+
+    // Read the next control event.
+    struct mgmt_pkt ev {};
+    ret = read(fd, &ev, sizeof(ev));
+    if (ret < 0) {
+      ALOGE("error reading mgmt event: %s", strerror(errno));
+      goto end;
+    }
+
+    // Received [Read Index List] command response.
+    if (ev.opcode == MGMT_EV_CMD_COMPLETE) {
+      struct mgmt_ev_read_index_list* data =
+          (struct mgmt_ev_read_index_list*)ev.data;
+
+      for (int i = 0; i < data->num_controllers; i++) {
+        if (data->index[i] == hci_interface) {
+          ALOGI("hci interface %d found", hci_interface);
+          ret = 0;
+          goto end;
+        }
+      }
+    }
+
+    // Received [Index Added] event.
+    if (ev.opcode == MGMT_EV_INDEX_ADDED && ev.index == hci_interface) {
+      ALOGI("hci interface %d added", hci_interface);
+      ret = 0;
+      goto end;
+    }
+  }
+
+end:
+  ::close(fd);
+  return ret;
+}
+
+int NetBluetoothMgmt::openRfkill() {
+  int fd = open("/dev/rfkill", O_RDWR);
+  if (fd < 0) {
+    ALOGE("unable to open /dev/rfkill: %s", strerror(errno));
+    return -1;
+  }
+
+  if (fcntl(fd, F_SETFL, O_NONBLOCK) < 0) {
+    ALOGE("unable to set rfkill control device to non-blocking: %s",
+          strerror(errno));
+    ::close(fd);
+    return -1;
+  }
+
+  for (;;) {
+    struct rfkill_event event {};
+    ssize_t res = read(fd, &event, sizeof(event));
+    if (res < 0) {
+      ALOGE("error reading rfkill events: %s", strerror(errno));
+      break;
+    }
+
+    ALOGI("index:%d type:%d op:%d", event.idx, event.type, event.op);
+
+    if (event.op == RFKILL_OP_ADD && event.type == RFKILL_TYPE_BLUETOOTH) {
+      rfkill_bt_index_ = event.idx;
+      rfkill_fd_ = fd;
+      return 0;
+    }
+  }
+
+  ::close(fd);
+  return -1;
+}
+
+// Block or unblock Bluetooth.
+int NetBluetoothMgmt::rfkill(int block) {
+  if (rfkill_fd_ == -1) {
+    openRfkill();
+  }
+
+  if (rfkill_fd_ == -1) {
+    ALOGE("rfkill unavailable");
+    return -1;
+  }
+
+  struct rfkill_event event = {
+      .idx = static_cast<uint32_t>(rfkill_bt_index_),
+      .type = RFKILL_TYPE_BLUETOOTH,
+      .op = RFKILL_OP_CHANGE,
+      .soft = static_cast<uint8_t>(block),
+      .hard = 0,
+  };
+
+  int res = write(rfkill_fd_, &event, sizeof(event));
+  if (res < 0) {
+    ALOGE("error writing rfkill command: %s", strerror(errno));
+    return -1;
+  }
+
+  return 0;
+}
+
+int NetBluetoothMgmt::openHci(int hci_interface) {
+  ALOGI("opening hci interface %d", hci_interface);
+
+  // Block Bluetooth.
+  rfkill(1);
+
+  // Wait for the HCI interface to complete initialization or to come online.
+  if (waitHciDev(hci_interface)) {
+    ALOGE("hci interface %d not found", hci_interface);
+    return -1;
+  }
+
+  // Open the raw HCI socket.
+  int fd = socket(AF_BLUETOOTH, SOCK_RAW, BTPROTO_HCI);
+  if (fd < 0) {
+    ALOGE("unable to open raw bluetooth socket: %s", strerror(errno));
+    return -1;
+  }
+
+  struct sockaddr_hci hci_addr = {
+      .hci_family = AF_BLUETOOTH,
+      .hci_dev = static_cast<uint16_t>(hci_interface),
+      .hci_channel = HCI_CHANNEL_USER,
+  };
+
+  // Bind the socket to the selected interface.
+  if (bind(fd, (struct sockaddr*)&hci_addr, sizeof(hci_addr)) < 0) {
+    ALOGE("unable to bind bluetooth user channel: %s", strerror(errno));
+    ::close(fd);
+    return -1;
+  }
+
+  ALOGI("hci interface %d ready", hci_interface);
+  bt_fd_ = fd;
+  return fd;
+}
+
+void NetBluetoothMgmt::closeHci() {
+  if (bt_fd_ != -1) {
+    ::close(bt_fd_);
+    bt_fd_ = -1;
+  }
+
+  // Unblock Bluetooth.
+  rfkill(0);
+}
+
+}  // namespace aidl::android::hardware::bluetooth::impl
diff --git a/bluetooth/aidl/default/net_bluetooth_mgmt.h b/bluetooth/aidl/default/net_bluetooth_mgmt.h
new file mode 100644
index 0000000..5c473f2
--- /dev/null
+++ b/bluetooth/aidl/default/net_bluetooth_mgmt.h
@@ -0,0 +1,47 @@
+/*
+ * Copyright 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+#include <unistd.h>
+
+namespace aidl::android::hardware::bluetooth::impl {
+
+class NetBluetoothMgmt {
+ public:
+  NetBluetoothMgmt() {}
+  ~NetBluetoothMgmt() {
+    ::close(rfkill_fd_);
+    ::close(bt_fd_);
+  }
+
+  int openHci(int hci_interface = 0);
+  void closeHci();
+
+ private:
+  int waitHciDev(int hci_interface);
+  int openRfkill();
+  int rfkill(int block);
+
+  // Index of the first rfkill device of type bluetooth.
+  int rfkill_bt_index_{-1};
+  // File descriptor opened to /dev/rfkill.
+  int rfkill_fd_{-1};
+  // File descriptor opened to the bluetooth user channel.
+  int bt_fd_{-1};
+};
+
+}  // namespace aidl::android::hardware::bluetooth::impl
diff --git a/bluetooth/aidl/vts/Android.bp b/bluetooth/aidl/vts/Android.bp
new file mode 100644
index 0000000..414f707
--- /dev/null
+++ b/bluetooth/aidl/vts/Android.bp
@@ -0,0 +1,48 @@
+package {
+    // See: http://go/android-license-faq
+    // A large-scale-change added 'default_applicable_licenses' to import
+    // all of the 'license_kinds' from "hardware_interfaces_license"
+    // to get the below license kinds:
+    //   SPDX-license-identifier-Apache-2.0
+    default_applicable_licenses: ["hardware_interfaces_license"],
+}
+
+cc_test {
+    name: "VtsHalBluetoothTargetTest",
+    defaults: [
+        "VtsHalTargetTestDefaults",
+        "use_libaidlvintf_gtest_helper_static",
+    ],
+    srcs: ["VtsHalBluetoothTargetTest.cpp"],
+    shared_libs: [
+        "libbase",
+        "libbinder_ndk",
+        "libcutils",
+    ],
+    static_libs: [
+        "android.hardware.bluetooth-V1-ndk",
+        "libbluetooth-types",
+    ],
+    test_config: "VtsHalBluetoothTargetTest.xml",
+    test_suites: [
+        "general-tests",
+        "vts",
+    ],
+    tidy: true,
+    tidy_checks: [
+        "-*",
+        "readability-inconsistent-declaration-parameter-name",
+        "readability-*",
+        "-readability-function-size",
+        "-readability-identifier-length",
+        "-readability-implicit-bool-conversion",
+        "-readability-magic-numbers",
+        "-readability-use-anyofallof",
+    ],
+    tidy_checks_as_errors: [
+        "readability-*",
+    ],
+    tidy_flags: [
+        "--header-filter=^.*tools\\/rootcanal\\/(model|include|net|desktop)\\/(.(?!\\.pb\\.h))*$",
+    ],
+}
diff --git a/bluetooth/aidl/vts/VtsHalBluetoothTargetTest.cpp b/bluetooth/aidl/vts/VtsHalBluetoothTargetTest.cpp
new file mode 100644
index 0000000..57a3361
--- /dev/null
+++ b/bluetooth/aidl/vts/VtsHalBluetoothTargetTest.cpp
@@ -0,0 +1,896 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <aidl/Gtest.h>
+#include <aidl/Vintf.h>
+#include <aidl/android/hardware/bluetooth/BnBluetoothHciCallbacks.h>
+#include <aidl/android/hardware/bluetooth/IBluetoothHci.h>
+#include <aidl/android/hardware/bluetooth/IBluetoothHciCallbacks.h>
+#include <aidl/android/hardware/bluetooth/Status.h>
+#include <android/binder_auto_utils.h>
+#include <android/binder_manager.h>
+#include <android/binder_process.h>
+#include <binder/IServiceManager.h>
+#include <binder/ProcessState.h>
+
+#include <atomic>
+#include <chrono>
+#include <condition_variable>
+#include <future>
+#include <mutex>
+#include <queue>
+#include <thread>
+#include <vector>
+
+using aidl::android::hardware::bluetooth::IBluetoothHci;
+using aidl::android::hardware::bluetooth::IBluetoothHciCallbacks;
+using aidl::android::hardware::bluetooth::Status;
+using ndk::ScopedAStatus;
+using ndk::SpAIBinder;
+
+// Bluetooth Core Specification 3.0 + HS
+static constexpr uint8_t kHciMinimumHciVersion = 5;
+// Bluetooth Core Specification 3.0 + HS
+static constexpr uint8_t kHciMinimumLmpVersion = 5;
+
+static constexpr size_t kNumHciCommandsBandwidth = 100;
+static constexpr size_t kNumScoPacketsBandwidth = 100;
+static constexpr size_t kNumAclPacketsBandwidth = 100;
+static constexpr std::chrono::milliseconds kWaitForInitTimeout(2000);
+static constexpr std::chrono::milliseconds kWaitForHciEventTimeout(2000);
+static constexpr std::chrono::milliseconds kWaitForScoDataTimeout(1000);
+static constexpr std::chrono::milliseconds kWaitForAclDataTimeout(1000);
+static constexpr std::chrono::milliseconds kInterfaceCloseDelayMs(200);
+
+static constexpr uint8_t kCommandHciShouldBeUnknown[] = {
+    0xff, 0x3B, 0x08, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07};
+static constexpr uint8_t kCommandHciReadLocalVersionInformation[] = {0x01, 0x10,
+                                                                     0x00};
+static constexpr uint8_t kCommandHciReadBufferSize[] = {0x05, 0x10, 0x00};
+static constexpr uint8_t kCommandHciWriteLoopbackModeLocal[] = {0x02, 0x18,
+                                                                0x01, 0x01};
+static constexpr uint8_t kCommandHciReset[] = {0x03, 0x0c, 0x00};
+static constexpr uint8_t kCommandHciSynchronousFlowControlEnable[] = {
+    0x2f, 0x0c, 0x01, 0x01};
+static constexpr uint8_t kCommandHciWriteLocalName[] = {0x13, 0x0c, 0xf8};
+static constexpr uint8_t kHciStatusSuccess = 0x00;
+static constexpr uint8_t kHciStatusUnknownHciCommand = 0x01;
+
+static constexpr uint8_t kEventConnectionComplete = 0x03;
+static constexpr uint8_t kEventCommandComplete = 0x0e;
+static constexpr uint8_t kEventCommandStatus = 0x0f;
+static constexpr uint8_t kEventNumberOfCompletedPackets = 0x13;
+static constexpr uint8_t kEventLoopbackCommand = 0x19;
+
+static constexpr size_t kEventCodeByte = 0;
+static constexpr size_t kEventLengthByte = 1;
+static constexpr size_t kEventFirstPayloadByte = 2;
+static constexpr size_t kEventCommandStatusStatusByte = 2;
+static constexpr size_t kEventCommandStatusOpcodeLsByte = 4;    // Bytes 4 and 5
+static constexpr size_t kEventCommandCompleteOpcodeLsByte = 3;  // Bytes 3 and 4
+static constexpr size_t kEventCommandCompleteStatusByte = 5;
+static constexpr size_t kEventCommandCompleteFirstParamByte = 6;
+static constexpr size_t kEventLocalHciVersionByte =
+    kEventCommandCompleteFirstParamByte;
+static constexpr size_t kEventLocalLmpVersionByte =
+    kEventLocalHciVersionByte + 3;
+
+static constexpr size_t kEventConnectionCompleteParamLength = 11;
+static constexpr size_t kEventConnectionCompleteType = 11;
+static constexpr size_t kEventConnectionCompleteTypeSco = 0;
+static constexpr size_t kEventConnectionCompleteTypeAcl = 1;
+static constexpr size_t kEventConnectionCompleteHandleLsByte = 3;
+
+static constexpr size_t kEventNumberOfCompletedPacketsNumHandles = 2;
+
+static constexpr size_t kAclBroadcastFlagOffset = 6;
+static constexpr uint8_t kAclBroadcastFlagPointToPoint = 0x0;
+static constexpr uint8_t kAclBroadcastPointToPoint =
+    (kAclBroadcastFlagPointToPoint << kAclBroadcastFlagOffset);
+
+static constexpr uint8_t kAclPacketBoundaryFlagOffset = 4;
+static constexpr uint8_t kAclPacketBoundaryFlagFirstAutoFlushable = 0x2;
+static constexpr uint8_t kAclPacketBoundaryFirstAutoFlushable =
+    kAclPacketBoundaryFlagFirstAutoFlushable << kAclPacketBoundaryFlagOffset;
+
+// To discard Qualcomm ACL debugging
+static constexpr uint16_t kAclHandleQcaDebugMessage = 0xedc;
+
+class ThroughputLogger {
+ public:
+  ThroughputLogger(std::string task)
+      : total_bytes_(0),
+        task_(task),
+        start_time_(std::chrono::steady_clock::now()) {}
+
+  ~ThroughputLogger() {
+    if (total_bytes_ == 0) {
+      return;
+    }
+    std::chrono::duration<double> duration =
+        std::chrono::steady_clock::now() - start_time_;
+    double s = duration.count();
+    if (s == 0) {
+      return;
+    }
+    double rate_kb = (static_cast<double>(total_bytes_) / s) / 1024;
+    ALOGD("%s %.1f KB/s (%zu bytes in %.3fs)", task_.c_str(), rate_kb,
+          total_bytes_, s);
+  }
+
+  void setTotalBytes(size_t total_bytes) { total_bytes_ = total_bytes; }
+
+ private:
+  size_t total_bytes_;
+  std::string task_;
+  std::chrono::steady_clock::time_point start_time_;
+};
+
+// The main test class for Bluetooth HAL.
+class BluetoothAidlTest : public ::testing::TestWithParam<std::string> {
+ public:
+  virtual void SetUp() override {
+    // currently test passthrough mode only
+    hci = IBluetoothHci::fromBinder(
+        SpAIBinder(AServiceManager_waitForService(GetParam().c_str())));
+    ASSERT_NE(hci, nullptr);
+    ALOGI("%s: getService() for bluetooth hci is %s", __func__,
+          hci->isRemote() ? "remote" : "local");
+
+    // Lambda function
+    auto on_binder_death = [](void* /*cookie*/) { FAIL(); };
+
+    bluetooth_hci_death_recipient =
+        AIBinder_DeathRecipient_new(on_binder_death);
+    ASSERT_NE(bluetooth_hci_death_recipient, nullptr);
+    ASSERT_EQ(STATUS_OK,
+              AIBinder_linkToDeath(hci->asBinder().get(),
+                                   bluetooth_hci_death_recipient, 0));
+
+    hci_cb = ndk::SharedRefBase::make<BluetoothHciCallbacks>(*this);
+    ASSERT_NE(hci_cb, nullptr);
+
+    max_acl_data_packet_length = 0;
+    max_sco_data_packet_length = 0;
+    max_acl_data_packets = 0;
+    max_sco_data_packets = 0;
+
+    event_cb_count = 0;
+    acl_cb_count = 0;
+    sco_cb_count = 0;
+
+    ASSERT_TRUE(hci->initialize(hci_cb).isOk());
+    auto future = initialized_promise.get_future();
+    auto timeout_status = future.wait_for(kWaitForInitTimeout);
+    ASSERT_EQ(timeout_status, std::future_status::ready);
+    ASSERT_TRUE(future.get());
+  }
+
+  virtual void TearDown() override {
+    ALOGI("TearDown");
+    // Should not be checked in production code
+    ASSERT_TRUE(hci->close().isOk());
+    std::this_thread::sleep_for(kInterfaceCloseDelayMs);
+    handle_no_ops();
+    discard_qca_debugging();
+    EXPECT_EQ(static_cast<size_t>(0), event_queue.size());
+    EXPECT_EQ(static_cast<size_t>(0), sco_queue.size());
+    EXPECT_EQ(static_cast<size_t>(0), acl_queue.size());
+    EXPECT_EQ(static_cast<size_t>(0), iso_queue.size());
+  }
+
+  void setBufferSizes();
+  void setSynchronousFlowControlEnable();
+
+  // Functions called from within tests in loopback mode
+  void sendAndCheckHci(int num_packets);
+  void sendAndCheckSco(int num_packets, size_t size, uint16_t handle);
+  void sendAndCheckAcl(int num_packets, size_t size, uint16_t handle);
+
+  // Helper functions to try to get a handle on verbosity
+  void reset();
+  void enterLoopbackMode();
+  void handle_no_ops();
+  void discard_qca_debugging();
+  void wait_for_event(bool timeout_is_error);
+  void wait_for_command_complete_event(std::vector<uint8_t> cmd);
+  int wait_for_completed_packets_event(uint16_t handle);
+
+  // A simple test implementation of BluetoothHciCallbacks.
+  class BluetoothHciCallbacks
+      : public aidl::android::hardware::bluetooth::BnBluetoothHciCallbacks {
+    BluetoothAidlTest& parent_;
+
+   public:
+    BluetoothHciCallbacks(BluetoothAidlTest& parent) : parent_(parent){};
+
+    virtual ~BluetoothHciCallbacks() = default;
+
+    ndk::ScopedAStatus initializationComplete(Status status) {
+      parent_.initialized_promise.set_value(status == Status::SUCCESS);
+      ALOGV("%s (status = %d)", __func__, static_cast<int>(status));
+      return ScopedAStatus::ok();
+    };
+
+    ndk::ScopedAStatus hciEventReceived(const std::vector<uint8_t>& event) {
+      parent_.event_cb_count++;
+      parent_.event_queue.push(event);
+      ALOGV("Event received (length = %d)", static_cast<int>(event.size()));
+      return ScopedAStatus::ok();
+    };
+
+    ndk::ScopedAStatus aclDataReceived(const std::vector<uint8_t>& data) {
+      parent_.acl_cb_count++;
+      parent_.acl_queue.push(data);
+      return ScopedAStatus::ok();
+    };
+
+    ndk::ScopedAStatus scoDataReceived(const std::vector<uint8_t>& data) {
+      parent_.sco_cb_count++;
+      parent_.sco_queue.push(data);
+      return ScopedAStatus::ok();
+    };
+
+    ndk::ScopedAStatus isoDataReceived(const std::vector<uint8_t>& data) {
+      parent_.iso_cb_count++;
+      parent_.iso_queue.push(data);
+      return ScopedAStatus::ok();
+    };
+  };
+
+  template <class T>
+  class WaitQueue {
+   public:
+    WaitQueue(){};
+
+    virtual ~WaitQueue() = default;
+
+    bool empty() const {
+      std::lock_guard<std::mutex> lock(m_);
+      return q_.empty();
+    };
+
+    size_t size() const {
+      std::lock_guard<std::mutex> lock(m_);
+      return q_.size();
+    };
+
+    void push(const T& v) {
+      std::lock_guard<std::mutex> lock(m_);
+      q_.push(v);
+      ready_.notify_one();
+    };
+
+    bool pop(T& v) {
+      std::lock_guard<std::mutex> lock(m_);
+      if (q_.empty()) {
+        return false;
+      }
+      v = std::move(q_.front());
+      q_.pop();
+      return true;
+    };
+
+    bool front(T& v) {
+      std::lock_guard<std::mutex> lock(m_);
+      if (q_.empty()) {
+        return false;
+      }
+      v = q_.front();
+      return true;
+    };
+
+    void wait() {
+      std::unique_lock<std::mutex> lock(m_);
+      while (q_.empty()) {
+        ready_.wait(lock);
+      }
+    };
+
+    bool waitWithTimeout(std::chrono::milliseconds timeout) {
+      std::unique_lock<std::mutex> lock(m_);
+      while (q_.empty()) {
+        if (ready_.wait_for(lock, timeout) == std::cv_status::timeout) {
+          return false;
+        }
+      }
+      return true;
+    };
+
+    bool tryPopWithTimeout(T& v, std::chrono::milliseconds timeout) {
+      std::unique_lock<std::mutex> lock(m_);
+      while (q_.empty()) {
+        if (ready_.wait_for(lock, timeout) == std::cv_status::timeout) {
+          return false;
+        }
+      }
+      v = std::move(q_.front());
+      q_.pop();
+      return true;
+    };
+
+   private:
+    mutable std::mutex m_;
+    std::queue<T> q_;
+    std::condition_variable_any ready_;
+  };
+
+  std::shared_ptr<IBluetoothHci> hci;
+  std::shared_ptr<BluetoothHciCallbacks> hci_cb;
+  AIBinder_DeathRecipient* bluetooth_hci_death_recipient;
+  WaitQueue<std::vector<uint8_t>> event_queue;
+  WaitQueue<std::vector<uint8_t>> acl_queue;
+  WaitQueue<std::vector<uint8_t>> sco_queue;
+  WaitQueue<std::vector<uint8_t>> iso_queue;
+
+  std::promise<bool> initialized_promise;
+  int event_cb_count;
+  int sco_cb_count;
+  int acl_cb_count;
+  int iso_cb_count;
+
+  int max_acl_data_packet_length;
+  int max_sco_data_packet_length;
+  int max_acl_data_packets;
+  int max_sco_data_packets;
+
+  std::vector<uint16_t> sco_connection_handles;
+  std::vector<uint16_t> acl_connection_handles;
+};
+
+// Discard NO-OPs from the event queue.
+void BluetoothAidlTest::handle_no_ops() {
+  while (!event_queue.empty()) {
+    std::vector<uint8_t> event;
+    event_queue.front(event);
+    ASSERT_GE(event.size(),
+              static_cast<size_t>(kEventCommandCompleteStatusByte));
+    bool event_is_no_op =
+        (event[kEventCodeByte] == kEventCommandComplete) &&
+        (event[kEventCommandCompleteOpcodeLsByte] == 0x00) &&
+        (event[kEventCommandCompleteOpcodeLsByte + 1] == 0x00);
+    event_is_no_op |= (event[kEventCodeByte] == kEventCommandStatus) &&
+                      (event[kEventCommandStatusOpcodeLsByte] == 0x00) &&
+                      (event[kEventCommandStatusOpcodeLsByte + 1] == 0x00);
+    if (event_is_no_op) {
+      event_queue.pop(event);
+    } else {
+      break;
+    }
+  }
+}
+
+// Discard Qualcomm ACL debugging
+void BluetoothAidlTest::discard_qca_debugging() {
+  while (!acl_queue.empty()) {
+    std::vector<uint8_t> acl_packet;
+    acl_queue.front(acl_packet);
+    uint16_t connection_handle = acl_packet[1] & 0xF;
+    connection_handle <<= 8;
+    connection_handle |= acl_packet[0];
+    bool packet_is_no_op = connection_handle == kAclHandleQcaDebugMessage;
+    if (packet_is_no_op) {
+      acl_queue.pop(acl_packet);
+    } else {
+      break;
+    }
+  }
+}
+
+// Receive an event, discarding NO-OPs.
+void BluetoothAidlTest::wait_for_event(bool timeout_is_error = true) {
+  // Wait until we get something that's not a no-op.
+  while (true) {
+    bool event_ready = event_queue.waitWithTimeout(kWaitForHciEventTimeout);
+    ASSERT_TRUE(event_ready || !timeout_is_error);
+    if (event_queue.empty()) {
+      // waitWithTimeout timed out
+      return;
+    }
+    handle_no_ops();
+    if (!event_queue.empty()) {
+      // There's an event in the queue that's not a no-op.
+      return;
+    }
+  }
+}
+
+// Wait until a command complete is received.
+void BluetoothAidlTest::wait_for_command_complete_event(
+    std::vector<uint8_t> cmd) {
+  ASSERT_NO_FATAL_FAILURE(wait_for_event());
+  std::vector<uint8_t> event;
+  ASSERT_FALSE(event_queue.empty());
+  ASSERT_TRUE(event_queue.pop(event));
+
+  ASSERT_GT(event.size(), static_cast<size_t>(kEventCommandCompleteStatusByte));
+  ASSERT_EQ(kEventCommandComplete, event[kEventCodeByte]);
+  ASSERT_EQ(cmd[0], event[kEventCommandCompleteOpcodeLsByte]);
+  ASSERT_EQ(cmd[1], event[kEventCommandCompleteOpcodeLsByte + 1]);
+  ASSERT_EQ(kHciStatusSuccess, event[kEventCommandCompleteStatusByte]);
+}
+
+// Send the command to read the controller's buffer sizes.
+void BluetoothAidlTest::setBufferSizes() {
+  std::vector<uint8_t> cmd{
+      kCommandHciReadBufferSize,
+      kCommandHciReadBufferSize + sizeof(kCommandHciReadBufferSize)};
+  hci->sendHciCommand(cmd);
+
+  ASSERT_NO_FATAL_FAILURE(wait_for_event());
+  if (event_queue.empty()) {
+    return;
+  }
+  std::vector<uint8_t> event;
+  ASSERT_TRUE(event_queue.pop(event));
+
+  ASSERT_EQ(kEventCommandComplete, event[kEventCodeByte]);
+  ASSERT_EQ(cmd[0], event[kEventCommandCompleteOpcodeLsByte]);
+  ASSERT_EQ(cmd[1], event[kEventCommandCompleteOpcodeLsByte + 1]);
+  ASSERT_EQ(kHciStatusSuccess, event[kEventCommandCompleteStatusByte]);
+
+  max_acl_data_packet_length =
+      event[kEventCommandCompleteStatusByte + 1] +
+      (event[kEventCommandCompleteStatusByte + 2] << 8);
+  max_sco_data_packet_length = event[kEventCommandCompleteStatusByte + 3];
+  max_acl_data_packets = event[kEventCommandCompleteStatusByte + 4] +
+                         (event[kEventCommandCompleteStatusByte + 5] << 8);
+  max_sco_data_packets = event[kEventCommandCompleteStatusByte + 6] +
+                         (event[kEventCommandCompleteStatusByte + 7] << 8);
+
+  ALOGD("%s: ACL max %d num %d SCO max %d num %d", __func__,
+        static_cast<int>(max_acl_data_packet_length),
+        static_cast<int>(max_acl_data_packets),
+        static_cast<int>(max_sco_data_packet_length),
+        static_cast<int>(max_sco_data_packets));
+}
+
+// Enable flow control packets for SCO
+void BluetoothAidlTest::setSynchronousFlowControlEnable() {
+  std::vector<uint8_t> cmd{kCommandHciSynchronousFlowControlEnable,
+                           kCommandHciSynchronousFlowControlEnable +
+                               sizeof(kCommandHciSynchronousFlowControlEnable)};
+  hci->sendHciCommand(cmd);
+
+  wait_for_command_complete_event(cmd);
+}
+
+// Send an HCI command (in Loopback mode) and check the response.
+void BluetoothAidlTest::sendAndCheckHci(int num_packets) {
+  ThroughputLogger logger = {__func__};
+  int command_size = 0;
+  for (int n = 0; n < num_packets; n++) {
+    // Send an HCI packet
+    std::vector<uint8_t> write_name{
+        kCommandHciWriteLocalName,
+        kCommandHciWriteLocalName + sizeof(kCommandHciWriteLocalName)};
+    // With a name
+    char new_name[] = "John Jacob Jingleheimer Schmidt ___________________0";
+    size_t new_name_length = strlen(new_name);
+    for (size_t i = 0; i < new_name_length; i++) {
+      write_name.push_back(static_cast<uint8_t>(new_name[i]));
+    }
+    // And the packet number
+    size_t i = new_name_length - 1;
+    for (int digits = n; digits > 0; digits = digits / 10, i--) {
+      write_name[i] = static_cast<uint8_t>('0' + digits % 10);
+    }
+    // And padding
+    for (size_t i = 0; i < 248 - new_name_length; i++) {
+      write_name.push_back(static_cast<uint8_t>(0));
+    }
+
+    hci->sendHciCommand(write_name);
+
+    // Check the loopback of the HCI packet
+    ASSERT_NO_FATAL_FAILURE(wait_for_event());
+
+    std::vector<uint8_t> event;
+    ASSERT_TRUE(event_queue.pop(event));
+
+    size_t compare_length = (write_name.size() > static_cast<size_t>(0xff)
+                                 ? static_cast<size_t>(0xff)
+                                 : write_name.size());
+    ASSERT_GT(event.size(), compare_length + kEventFirstPayloadByte - 1);
+
+    ASSERT_EQ(kEventLoopbackCommand, event[kEventCodeByte]);
+    ASSERT_EQ(compare_length, event[kEventLengthByte]);
+
+    // Don't compare past the end of the event.
+    if (compare_length + kEventFirstPayloadByte > event.size()) {
+      compare_length = event.size() - kEventFirstPayloadByte;
+      ALOGE("Only comparing %d bytes", static_cast<int>(compare_length));
+    }
+
+    if (n == num_packets - 1) {
+      command_size = write_name.size();
+    }
+
+    for (size_t i = 0; i < compare_length; i++) {
+      ASSERT_EQ(write_name[i], event[kEventFirstPayloadByte + i]);
+    }
+  }
+  logger.setTotalBytes(command_size * num_packets * 2);
+}
+
+// Send a SCO data packet (in Loopback mode) and check the response.
+void BluetoothAidlTest::sendAndCheckSco(int num_packets, size_t size,
+                                        uint16_t handle) {
+  ThroughputLogger logger = {__func__};
+  for (int n = 0; n < num_packets; n++) {
+    // Send a SCO packet
+    std::vector<uint8_t> sco_packet;
+    sco_packet.push_back(static_cast<uint8_t>(handle & 0xff));
+    sco_packet.push_back(static_cast<uint8_t>((handle & 0x0f00) >> 8));
+    sco_packet.push_back(static_cast<uint8_t>(size & 0xff));
+    for (size_t i = 0; i < size; i++) {
+      sco_packet.push_back(static_cast<uint8_t>(i + n));
+    }
+    hci->sendScoData(sco_packet);
+
+    // Check the loopback of the SCO packet
+    std::vector<uint8_t> sco_loopback;
+    ASSERT_TRUE(
+        sco_queue.tryPopWithTimeout(sco_loopback, kWaitForScoDataTimeout));
+
+    ASSERT_EQ(sco_packet.size(), sco_loopback.size());
+    size_t successful_bytes = 0;
+
+    for (size_t i = 0; i < sco_packet.size(); i++) {
+      if (sco_packet[i] == sco_loopback[i]) {
+        successful_bytes = i;
+      } else {
+        ALOGE("Miscompare at %d (expected %x, got %x)", static_cast<int>(i),
+              sco_packet[i], sco_loopback[i]);
+        ALOGE("At %d (expected %x, got %x)", static_cast<int>(i + 1),
+              sco_packet[i + 1], sco_loopback[i + 1]);
+        break;
+      }
+    }
+    ASSERT_EQ(sco_packet.size(), successful_bytes + 1);
+  }
+  logger.setTotalBytes(num_packets * size * 2);
+}
+
+// Send an ACL data packet (in Loopback mode) and check the response.
+void BluetoothAidlTest::sendAndCheckAcl(int num_packets, size_t size,
+                                        uint16_t handle) {
+  ThroughputLogger logger = {__func__};
+  for (int n = 0; n < num_packets; n++) {
+    // Send an ACL packet
+    std::vector<uint8_t> acl_packet;
+    acl_packet.push_back(static_cast<uint8_t>(handle & 0xff));
+    acl_packet.push_back(static_cast<uint8_t>((handle & 0x0f00) >> 8) |
+                         kAclBroadcastPointToPoint |
+                         kAclPacketBoundaryFirstAutoFlushable);
+    acl_packet.push_back(static_cast<uint8_t>(size & 0xff));
+    acl_packet.push_back(static_cast<uint8_t>((size & 0xff00) >> 8));
+    for (size_t i = 0; i < size; i++) {
+      acl_packet.push_back(static_cast<uint8_t>(i + n));
+    }
+    hci->sendAclData(acl_packet);
+
+    std::vector<uint8_t> acl_loopback;
+    // Check the loopback of the ACL packet
+    ASSERT_TRUE(
+        acl_queue.tryPopWithTimeout(acl_loopback, kWaitForAclDataTimeout));
+
+    ASSERT_EQ(acl_packet.size(), acl_loopback.size());
+    size_t successful_bytes = 0;
+
+    for (size_t i = 0; i < acl_packet.size(); i++) {
+      if (acl_packet[i] == acl_loopback[i]) {
+        successful_bytes = i;
+      } else {
+        ALOGE("Miscompare at %d (expected %x, got %x)", static_cast<int>(i),
+              acl_packet[i], acl_loopback[i]);
+        ALOGE("At %d (expected %x, got %x)", static_cast<int>(i + 1),
+              acl_packet[i + 1], acl_loopback[i + 1]);
+        break;
+      }
+    }
+    ASSERT_EQ(acl_packet.size(), successful_bytes + 1);
+  }
+  logger.setTotalBytes(num_packets * size * 2);
+}
+
+// Return the number of completed packets reported by the controller.
+int BluetoothAidlTest::wait_for_completed_packets_event(uint16_t handle) {
+  int packets_processed = 0;
+  wait_for_event(false);
+  if (event_queue.empty()) {
+    ALOGW("%s: waitForBluetoothCallback timed out.", __func__);
+    return packets_processed;
+  }
+  while (!event_queue.empty()) {
+    std::vector<uint8_t> event;
+    EXPECT_TRUE(event_queue.pop(event));
+
+    EXPECT_EQ(kEventNumberOfCompletedPackets, event[kEventCodeByte]);
+    EXPECT_EQ(1, event[kEventNumberOfCompletedPacketsNumHandles]);
+
+    uint16_t event_handle = event[3] + (event[4] << 8);
+    EXPECT_EQ(handle, event_handle);
+
+    packets_processed += event[5] + (event[6] << 8);
+  }
+  return packets_processed;
+}
+
+// Send the reset command and wait for a response.
+void BluetoothAidlTest::reset() {
+  std::vector<uint8_t> reset{kCommandHciReset,
+                             kCommandHciReset + sizeof(kCommandHciReset)};
+  hci->sendHciCommand(reset);
+
+  wait_for_command_complete_event(reset);
+}
+
+// Send local loopback command and initialize SCO and ACL handles.
+void BluetoothAidlTest::enterLoopbackMode() {
+  std::vector<uint8_t> cmd{kCommandHciWriteLoopbackModeLocal,
+                           kCommandHciWriteLoopbackModeLocal +
+                               sizeof(kCommandHciWriteLoopbackModeLocal)};
+  hci->sendHciCommand(cmd);
+
+  // Receive connection complete events with data channels
+  int connection_event_count = 0;
+  bool command_complete_received = false;
+  while (true) {
+    wait_for_event(false);
+    if (event_queue.empty()) {
+      // Fail if there was no event received or no connections completed.
+      ASSERT_TRUE(command_complete_received);
+      ASSERT_LT(0, connection_event_count);
+      return;
+    }
+    std::vector<uint8_t> event;
+    ASSERT_TRUE(event_queue.pop(event));
+    ASSERT_GT(event.size(),
+              static_cast<size_t>(kEventCommandCompleteStatusByte));
+    if (event[kEventCodeByte] == kEventConnectionComplete) {
+      ASSERT_GT(event.size(),
+                static_cast<size_t>(kEventConnectionCompleteType));
+      ASSERT_EQ(event[kEventLengthByte], kEventConnectionCompleteParamLength);
+      uint8_t connection_type = event[kEventConnectionCompleteType];
+
+      ASSERT_TRUE(connection_type == kEventConnectionCompleteTypeSco ||
+                  connection_type == kEventConnectionCompleteTypeAcl);
+
+      // Save handles
+      uint16_t handle = event[kEventConnectionCompleteHandleLsByte] |
+                        event[kEventConnectionCompleteHandleLsByte + 1] << 8;
+      if (connection_type == kEventConnectionCompleteTypeSco) {
+        sco_connection_handles.push_back(handle);
+      } else {
+        acl_connection_handles.push_back(handle);
+      }
+
+      ALOGD("Connect complete type = %d handle = %d",
+            event[kEventConnectionCompleteType], handle);
+      connection_event_count++;
+    } else {
+      ASSERT_EQ(kEventCommandComplete, event[kEventCodeByte]);
+      ASSERT_EQ(cmd[0], event[kEventCommandCompleteOpcodeLsByte]);
+      ASSERT_EQ(cmd[1], event[kEventCommandCompleteOpcodeLsByte + 1]);
+      ASSERT_EQ(kHciStatusSuccess, event[kEventCommandCompleteStatusByte]);
+      command_complete_received = true;
+    }
+  }
+}
+
+// Empty test: Initialize()/Close() are called in SetUp()/TearDown().
+TEST_P(BluetoothAidlTest, InitializeAndClose) {}
+
+// Send an HCI Reset with sendHciCommand and wait for a command complete event.
+TEST_P(BluetoothAidlTest, HciReset) { reset(); }
+
+// Read and check the HCI version of the controller.
+TEST_P(BluetoothAidlTest, HciVersionTest) {
+  reset();
+  std::vector<uint8_t> cmd{kCommandHciReadLocalVersionInformation,
+                           kCommandHciReadLocalVersionInformation +
+                               sizeof(kCommandHciReadLocalVersionInformation)};
+  hci->sendHciCommand(cmd);
+
+  ASSERT_NO_FATAL_FAILURE(wait_for_event());
+
+  std::vector<uint8_t> event;
+  ASSERT_TRUE(event_queue.pop(event));
+  ASSERT_GT(event.size(), static_cast<size_t>(kEventLocalLmpVersionByte));
+
+  ASSERT_EQ(kEventCommandComplete, event[kEventCodeByte]);
+  ASSERT_EQ(cmd[0], event[kEventCommandCompleteOpcodeLsByte]);
+  ASSERT_EQ(cmd[1], event[kEventCommandCompleteOpcodeLsByte + 1]);
+  ASSERT_EQ(kHciStatusSuccess, event[kEventCommandCompleteStatusByte]);
+
+  ASSERT_LE(kHciMinimumHciVersion, event[kEventLocalHciVersionByte]);
+  ASSERT_LE(kHciMinimumLmpVersion, event[kEventLocalLmpVersionByte]);
+}
+
+// Send an unknown HCI command and wait for the error message.
+TEST_P(BluetoothAidlTest, HciUnknownCommand) {
+  reset();
+  std::vector<uint8_t> cmd{
+      kCommandHciShouldBeUnknown,
+      kCommandHciShouldBeUnknown + sizeof(kCommandHciShouldBeUnknown)};
+  hci->sendHciCommand(cmd);
+
+  ASSERT_NO_FATAL_FAILURE(wait_for_event());
+
+  std::vector<uint8_t> event;
+  ASSERT_TRUE(event_queue.pop(event));
+
+  ASSERT_GT(event.size(), static_cast<size_t>(kEventCommandCompleteStatusByte));
+  if (event[kEventCodeByte] == kEventCommandComplete) {
+    ASSERT_EQ(cmd[0], event[kEventCommandCompleteOpcodeLsByte]);
+    ASSERT_EQ(cmd[1], event[kEventCommandCompleteOpcodeLsByte + 1]);
+    ASSERT_EQ(kHciStatusUnknownHciCommand,
+              event[kEventCommandCompleteStatusByte]);
+  } else {
+    ASSERT_EQ(kEventCommandStatus, event[kEventCodeByte]);
+    ASSERT_EQ(cmd[0], event[kEventCommandStatusOpcodeLsByte]);
+    ASSERT_EQ(cmd[1], event[kEventCommandStatusOpcodeLsByte + 1]);
+    ASSERT_EQ(kHciStatusUnknownHciCommand,
+              event[kEventCommandStatusStatusByte]);
+  }
+}
+
+// Enter loopback mode, but don't send any packets.
+TEST_P(BluetoothAidlTest, WriteLoopbackMode) {
+  reset();
+  enterLoopbackMode();
+}
+
+// Enter loopback mode and send a single command.
+TEST_P(BluetoothAidlTest, LoopbackModeSingleCommand) {
+  reset();
+  setBufferSizes();
+
+  enterLoopbackMode();
+
+  sendAndCheckHci(1);
+}
+
+// Enter loopback mode and send a single SCO packet.
+TEST_P(BluetoothAidlTest, LoopbackModeSingleSco) {
+  reset();
+  setBufferSizes();
+  setSynchronousFlowControlEnable();
+
+  enterLoopbackMode();
+
+  if (!sco_connection_handles.empty()) {
+    ASSERT_LT(0, max_sco_data_packet_length);
+    sendAndCheckSco(1, max_sco_data_packet_length, sco_connection_handles[0]);
+    int sco_packets_sent = 1;
+    int completed_packets =
+        wait_for_completed_packets_event(sco_connection_handles[0]);
+    if (sco_packets_sent != completed_packets) {
+      ALOGW("%s: packets_sent (%d) != completed_packets (%d)", __func__,
+            sco_packets_sent, completed_packets);
+    }
+  }
+}
+
+// Enter loopback mode and send a single ACL packet.
+TEST_P(BluetoothAidlTest, LoopbackModeSingleAcl) {
+  reset();
+  setBufferSizes();
+
+  enterLoopbackMode();
+
+  if (!acl_connection_handles.empty()) {
+    ASSERT_LT(0, max_acl_data_packet_length);
+    sendAndCheckAcl(1, max_acl_data_packet_length - 1,
+                    acl_connection_handles[0]);
+    int acl_packets_sent = 1;
+    int completed_packets =
+        wait_for_completed_packets_event(acl_connection_handles[0]);
+    if (acl_packets_sent != completed_packets) {
+      ALOGW("%s: packets_sent (%d) != completed_packets (%d)", __func__,
+            acl_packets_sent, completed_packets);
+    }
+  }
+  ASSERT_GE(acl_cb_count, 1);
+}
+
+// Enter loopback mode and send command packets for bandwidth measurements.
+TEST_P(BluetoothAidlTest, LoopbackModeCommandBandwidth) {
+  reset();
+  setBufferSizes();
+
+  enterLoopbackMode();
+
+  sendAndCheckHci(kNumHciCommandsBandwidth);
+}
+
+// Enter loopback mode and send SCO packets for bandwidth measurements.
+TEST_P(BluetoothAidlTest, LoopbackModeScoBandwidth) {
+  reset();
+  setBufferSizes();
+  setSynchronousFlowControlEnable();
+
+  enterLoopbackMode();
+
+  if (!sco_connection_handles.empty()) {
+    ASSERT_LT(0, max_sco_data_packet_length);
+    sendAndCheckSco(kNumScoPacketsBandwidth, max_sco_data_packet_length,
+                    sco_connection_handles[0]);
+    int sco_packets_sent = kNumScoPacketsBandwidth;
+    int completed_packets =
+        wait_for_completed_packets_event(sco_connection_handles[0]);
+    if (sco_packets_sent != completed_packets) {
+      ALOGW("%s: packets_sent (%d) != completed_packets (%d)", __func__,
+            sco_packets_sent, completed_packets);
+    }
+  }
+}
+
+// Enter loopback mode and send packets for ACL bandwidth measurements.
+TEST_P(BluetoothAidlTest, LoopbackModeAclBandwidth) {
+  reset();
+  setBufferSizes();
+
+  enterLoopbackMode();
+
+  if (!acl_connection_handles.empty()) {
+    ASSERT_LT(0, max_acl_data_packet_length);
+    sendAndCheckAcl(kNumAclPacketsBandwidth, max_acl_data_packet_length - 1,
+                    acl_connection_handles[0]);
+    int acl_packets_sent = kNumAclPacketsBandwidth;
+    int completed_packets =
+        wait_for_completed_packets_event(acl_connection_handles[0]);
+    if (acl_packets_sent != completed_packets) {
+      ALOGW("%s: packets_sent (%d) != completed_packets (%d)", __func__,
+            acl_packets_sent, completed_packets);
+    }
+  }
+}
+
+// Set all bits in the event mask
+TEST_P(BluetoothAidlTest, SetEventMask) {
+  reset();
+  std::vector<uint8_t> set_event_mask{
+      0x01, 0x0c, 0x08 /*parameter bytes*/, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+      0xff, 0xff};
+  hci->sendHciCommand({set_event_mask});
+  wait_for_command_complete_event(set_event_mask);
+}
+
+// Set all bits in the LE event mask
+TEST_P(BluetoothAidlTest, SetLeEventMask) {
+  reset();
+  std::vector<uint8_t> set_event_mask{
+      0x20, 0x0c, 0x08 /*parameter bytes*/, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+      0xff, 0xff};
+  hci->sendHciCommand({set_event_mask});
+  wait_for_command_complete_event(set_event_mask);
+}
+
+GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(BluetoothAidlTest);
+INSTANTIATE_TEST_SUITE_P(PerInstance, BluetoothAidlTest,
+                         testing::ValuesIn(android::getAidlHalInstanceNames(
+                             IBluetoothHci::descriptor)),
+                         android::PrintInstanceNameToString);
+
+int main(int argc, char** argv) {
+  ABinderProcess_startThreadPool();
+  ::testing::InitGoogleTest(&argc, argv);
+  int status = RUN_ALL_TESTS();
+  ALOGI("Test result = %d", status);
+  return status;
+}
diff --git a/bluetooth/aidl/vts/VtsHalBluetoothTargetTest.xml b/bluetooth/aidl/vts/VtsHalBluetoothTargetTest.xml
new file mode 100644
index 0000000..3a42ae6
--- /dev/null
+++ b/bluetooth/aidl/vts/VtsHalBluetoothTargetTest.xml
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2023 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+<configuration description="Runs VtsHalBluetoothTargetTest.">
+    <option name="test-suite-tag" value="apct" />
+    <option name="test-suite-tag" value="apct-native" />
+
+    <target_preparer class="com.android.tradefed.targetprep.RootTargetPreparer">
+    </target_preparer>
+
+    <target_preparer class="com.android.tradefed.targetprep.RunCommandTargetPreparer">
+        <option name="run-command" value="settings put global ble_scan_always_enabled 0" />
+        <option name="run-command" value="cmd bluetooth_manager disable" />
+        <option name="run-command" value="cmd bluetooth_manager wait-for-state:STATE_OFF" />
+        <option name="teardown-command" value="cmd bluetooth_manager enable" />
+        <option name="teardown-command" value="cmd bluetooth_manager wait-for-state:STATE_ON" />
+        <option name="teardown-command" value="settings put global ble_scan_always_enabled 1" />
+    </target_preparer>
+
+    <target_preparer class="com.android.tradefed.targetprep.PushFilePreparer">
+        <option name="cleanup" value="true" />
+        <option name="push" value="VtsHalBluetoothTargetTest->/data/local/tmp/VtsHalBluetoothTargetTest" />
+    </target_preparer>
+
+    <test class="com.android.tradefed.testtype.GTest" >
+        <option name="native-test-device-path" value="/data/local/tmp" />
+        <option name="module-name" value="VtsHalBluetoothTargetTest" />
+    </test>
+</configuration>
diff --git a/bluetooth/hci/h4_protocol.cc b/bluetooth/hci/h4_protocol.cc
index 97ba7aa..51a624f 100644
--- a/bluetooth/hci/h4_protocol.cc
+++ b/bluetooth/hci/h4_protocol.cc
@@ -58,10 +58,8 @@
   while (1) {
     ret = TEMP_FAILURE_RETRY(writev(uart_fd_, iov, 2));
     if (ret == -1) {
-      if (errno == EAGAIN) {
-        ALOGE("%s error writing to UART (%s)", __func__, strerror(errno));
-        continue;
-      }
+      LOG_ALWAYS_FATAL("%s error writing to UART (%s)", __func__,
+                       strerror(errno));
     } else if (ret == 0) {
       // Nothing written :(
       ALOGE("%s zero bytes written - something went wrong...", __func__);
diff --git a/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/AmFmRegionConfig.aidl b/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/AmFmRegionConfig.aidl
index f3aecdf..fe8489c 100644
--- a/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/AmFmRegionConfig.aidl
+++ b/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/AmFmRegionConfig.aidl
@@ -37,8 +37,8 @@
   android.hardware.broadcastradio.AmFmBandRange[] ranges;
   int fmDeemphasis;
   int fmRds;
-  const int DEEMPHASIS_D50 = 1;
-  const int DEEMPHASIS_D75 = 2;
-  const int RDS = 1;
-  const int RBDS = 2;
+  const int DEEMPHASIS_D50 = (1 << 0);
+  const int DEEMPHASIS_D75 = (1 << 1);
+  const int RDS = (1 << 0);
+  const int RBDS = (1 << 1);
 }
diff --git a/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/AnnouncementType.aidl b/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/AnnouncementType.aidl
index 237b868..1d187fe 100644
--- a/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/AnnouncementType.aidl
+++ b/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/AnnouncementType.aidl
@@ -36,11 +36,11 @@
 enum AnnouncementType {
   INVALID = 0,
   EMERGENCY = 1,
-  WARNING = 2,
-  TRAFFIC = 3,
-  WEATHER = 4,
-  NEWS = 5,
-  EVENT = 6,
-  SPORT = 7,
-  MISC = 8,
+  WARNING,
+  TRAFFIC,
+  WEATHER,
+  NEWS,
+  EVENT,
+  SPORT,
+  MISC,
 }
diff --git a/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/ConfigFlag.aidl b/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/ConfigFlag.aidl
index 6fb9a62..98af437 100644
--- a/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/ConfigFlag.aidl
+++ b/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/ConfigFlag.aidl
@@ -35,12 +35,12 @@
 @Backing(type="int") @JavaDerive(equals=true, toString=true) @VintfStability
 enum ConfigFlag {
   FORCE_MONO = 1,
-  FORCE_ANALOG = 2,
-  FORCE_DIGITAL = 3,
-  RDS_AF = 4,
-  RDS_REG = 5,
-  DAB_DAB_LINKING = 6,
-  DAB_FM_LINKING = 7,
-  DAB_DAB_SOFT_LINKING = 8,
-  DAB_FM_SOFT_LINKING = 9,
+  FORCE_ANALOG,
+  FORCE_DIGITAL,
+  RDS_AF,
+  RDS_REG,
+  DAB_DAB_LINKING,
+  DAB_FM_LINKING,
+  DAB_DAB_SOFT_LINKING,
+  DAB_FM_SOFT_LINKING,
 }
diff --git a/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/IdentifierType.aidl b/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/IdentifierType.aidl
index 4e8296a..4df272c 100644
--- a/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/IdentifierType.aidl
+++ b/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/IdentifierType.aidl
@@ -37,16 +37,16 @@
   VENDOR_START = 1000,
   VENDOR_END = 1999,
   INVALID = 0,
-  AMFM_FREQUENCY_KHZ = 1,
-  RDS_PI = 2,
-  HD_STATION_ID_EXT = 3,
-  HD_STATION_NAME = 4,
-  DAB_SID_EXT = 5,
-  DAB_ENSEMBLE = 6,
-  DAB_SCID = 7,
-  DAB_FREQUENCY_KHZ = 8,
-  DRMO_SERVICE_ID = 9,
-  DRMO_FREQUENCY_KHZ = 10,
-  SXM_SERVICE_ID = 12,
-  SXM_CHANNEL = 13,
+  AMFM_FREQUENCY_KHZ,
+  RDS_PI,
+  HD_STATION_ID_EXT,
+  HD_STATION_NAME,
+  DAB_SID_EXT,
+  DAB_ENSEMBLE,
+  DAB_SCID,
+  DAB_FREQUENCY_KHZ,
+  DRMO_SERVICE_ID,
+  DRMO_FREQUENCY_KHZ,
+  SXM_SERVICE_ID = (DRMO_FREQUENCY_KHZ + 2),
+  SXM_CHANNEL,
 }
diff --git a/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/ProgramInfo.aidl b/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/ProgramInfo.aidl
index 5e662d2..b14023a 100644
--- a/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/ProgramInfo.aidl
+++ b/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/ProgramInfo.aidl
@@ -42,10 +42,10 @@
   int signalQuality;
   android.hardware.broadcastradio.Metadata[] metadata;
   android.hardware.broadcastradio.VendorKeyValue[] vendorInfo;
-  const int FLAG_LIVE = 1;
-  const int FLAG_MUTED = 2;
-  const int FLAG_TRAFFIC_PROGRAM = 4;
-  const int FLAG_TRAFFIC_ANNOUNCEMENT = 8;
-  const int FLAG_TUNABLE = 16;
-  const int FLAG_STEREO = 32;
+  const int FLAG_LIVE = (1 << 0);
+  const int FLAG_MUTED = (1 << 1);
+  const int FLAG_TRAFFIC_PROGRAM = (1 << 2);
+  const int FLAG_TRAFFIC_ANNOUNCEMENT = (1 << 3);
+  const int FLAG_TUNABLE = (1 << 4);
+  const int FLAG_STEREO = (1 << 5);
 }
diff --git a/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/Result.aidl b/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/Result.aidl
index 3464412..8af74c7 100644
--- a/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/Result.aidl
+++ b/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/Result.aidl
@@ -32,14 +32,14 @@
 // later when a module using the interface is updated, e.g., Mainline modules.
 
 package android.hardware.broadcastradio;
-@Backing(type="int") @VintfStability
+@Backing(type="int") @JavaDerive(equals=true, toString=true) @VintfStability
 enum Result {
-  OK = 0,
-  INTERNAL_ERROR = 1,
-  INVALID_ARGUMENTS = 2,
-  INVALID_STATE = 3,
-  NOT_SUPPORTED = 4,
-  TIMEOUT = 5,
-  CANCELED = 6,
-  UNKNOWN_ERROR = 7,
+  OK,
+  INTERNAL_ERROR,
+  INVALID_ARGUMENTS,
+  INVALID_STATE,
+  NOT_SUPPORTED,
+  TIMEOUT,
+  CANCELED,
+  UNKNOWN_ERROR,
 }
diff --git a/broadcastradio/aidl/android/hardware/broadcastradio/Result.aidl b/broadcastradio/aidl/android/hardware/broadcastradio/Result.aidl
index 3f7ddac..9f7263a 100644
--- a/broadcastradio/aidl/android/hardware/broadcastradio/Result.aidl
+++ b/broadcastradio/aidl/android/hardware/broadcastradio/Result.aidl
@@ -21,11 +21,12 @@
  */
 @VintfStability
 @Backing(type="int")
+@JavaDerive(equals=true, toString=true)
 enum Result {
     /**
      * Methods run without error.
      */
-    OK,
+    OK = 0,
 
     /**
      * Internal error in HAL.
diff --git a/camera/common/default/OWNERS b/camera/OWNERS
similarity index 65%
rename from camera/common/default/OWNERS
rename to camera/OWNERS
index f48a95c..b946264 100644
--- a/camera/common/default/OWNERS
+++ b/camera/OWNERS
@@ -1 +1,3 @@
+# Bug component: 41727
+
 include platform/frameworks/av:/camera/OWNERS
diff --git a/camera/device/1.0/default/OWNERS b/camera/device/1.0/default/OWNERS
deleted file mode 100644
index f48a95c..0000000
--- a/camera/device/1.0/default/OWNERS
+++ /dev/null
@@ -1 +0,0 @@
-include platform/frameworks/av:/camera/OWNERS
diff --git a/camera/device/3.2/default/OWNERS b/camera/device/3.2/default/OWNERS
deleted file mode 100644
index f48a95c..0000000
--- a/camera/device/3.2/default/OWNERS
+++ /dev/null
@@ -1 +0,0 @@
-include platform/frameworks/av:/camera/OWNERS
diff --git a/camera/device/3.3/default/OWNERS b/camera/device/3.3/default/OWNERS
deleted file mode 100644
index f48a95c..0000000
--- a/camera/device/3.3/default/OWNERS
+++ /dev/null
@@ -1 +0,0 @@
-include platform/frameworks/av:/camera/OWNERS
diff --git a/camera/device/3.4/default/OWNERS b/camera/device/3.4/default/OWNERS
deleted file mode 100644
index f48a95c..0000000
--- a/camera/device/3.4/default/OWNERS
+++ /dev/null
@@ -1 +0,0 @@
-include platform/frameworks/av:/camera/OWNERS
diff --git a/camera/device/3.5/default/OWNERS b/camera/device/3.5/default/OWNERS
deleted file mode 100644
index f48a95c..0000000
--- a/camera/device/3.5/default/OWNERS
+++ /dev/null
@@ -1 +0,0 @@
-include platform/frameworks/av:/camera/OWNERS
diff --git a/camera/device/3.6/default/OWNERS b/camera/device/3.6/default/OWNERS
deleted file mode 100644
index f48a95c..0000000
--- a/camera/device/3.6/default/OWNERS
+++ /dev/null
@@ -1 +0,0 @@
-include platform/frameworks/av:/camera/OWNERS
diff --git a/camera/device/default/ExternalCameraDeviceSession.cpp b/camera/device/default/ExternalCameraDeviceSession.cpp
index 736bc3c..c962974 100644
--- a/camera/device/default/ExternalCameraDeviceSession.cpp
+++ b/camera/device/default/ExternalCameraDeviceSession.cpp
@@ -217,10 +217,8 @@
     // Grab a shared_ptr to 'this' from ndk::SharedRefBase::ref()
     std::shared_ptr<ExternalCameraDeviceSession> thiz = ref<ExternalCameraDeviceSession>();
 
-    if (mSupportBufMgr) {
-        mBufferRequestThread = std::make_shared<BufferRequestThread>(/*parent=*/thiz, mCallback);
-        mBufferRequestThread->run();
-    }
+    mBufferRequestThread = std::make_shared<BufferRequestThread>(/*parent=*/thiz, mCallback);
+    mBufferRequestThread->run();
     mOutputThread = std::make_shared<OutputThread>(/*parent=*/thiz, mCroppingType,
                                                    mCameraCharacteristics, mBufferRequestThread);
 }
diff --git a/camera/device/default/ExternalCameraDeviceSession.h b/camera/device/default/ExternalCameraDeviceSession.h
index 5d42092..e7eb799 100644
--- a/camera/device/default/ExternalCameraDeviceSession.h
+++ b/camera/device/default/ExternalCameraDeviceSession.h
@@ -365,7 +365,6 @@
 
     static HandleImporter sHandleImporter;
 
-    bool mSupportBufMgr;
     std::shared_ptr<BufferRequestThread> mBufferRequestThread;
 
     /* Beginning of members not changed after initialize() */
diff --git a/camera/device/default/ExternalCameraOfflineSession.h b/camera/device/default/ExternalCameraOfflineSession.h
index 5795c95..1d0c057 100644
--- a/camera/device/default/ExternalCameraOfflineSession.h
+++ b/camera/device/default/ExternalCameraOfflineSession.h
@@ -39,9 +39,9 @@
 using ::aidl::android::hardware::common::fmq::MQDescriptor;
 using ::aidl::android::hardware::common::fmq::SynchronizedReadWrite;
 
-class ExternalCameraOfflineSession : public BnCameraOfflineSession,
-                                     public virtual RefBase,
-                                     public virtual OutputThreadInterface {
+class ExternalCameraOfflineSession final : public BnCameraOfflineSession,
+                                           public virtual RefBase,
+                                           public virtual OutputThreadInterface {
   public:
     ExternalCameraOfflineSession(const CroppingType& croppingType,
                                  const common::V1_0::helper::CameraMetadata& chars,
diff --git a/camera/device/default/OWNERS b/camera/device/default/OWNERS
deleted file mode 100644
index f48a95c..0000000
--- a/camera/device/default/OWNERS
+++ /dev/null
@@ -1 +0,0 @@
-include platform/frameworks/av:/camera/OWNERS
diff --git a/camera/provider/2.4/default/OWNERS b/camera/provider/2.4/default/OWNERS
deleted file mode 100644
index f48a95c..0000000
--- a/camera/provider/2.4/default/OWNERS
+++ /dev/null
@@ -1 +0,0 @@
-include platform/frameworks/av:/camera/OWNERS
diff --git a/camera/provider/2.4/vts/OWNERS b/camera/provider/2.4/vts/OWNERS
deleted file mode 100644
index eb4f0e4..0000000
--- a/camera/provider/2.4/vts/OWNERS
+++ /dev/null
@@ -1,8 +0,0 @@
-# Bug component: 41727
-
-# Camera team
-include platform/frameworks/av:/camera/OWNERS
-
-# VTS team
-yim@google.com
-zhuoyao@google.com
diff --git a/camera/provider/2.4/vts/functional/OWNERS b/camera/provider/2.4/vts/functional/OWNERS
deleted file mode 100644
index 479f465..0000000
--- a/camera/provider/2.4/vts/functional/OWNERS
+++ /dev/null
@@ -1,2 +0,0 @@
-# Bug component: 41727
-epeev@google.com
diff --git a/camera/provider/2.5/default/OWNERS b/camera/provider/2.5/default/OWNERS
deleted file mode 100644
index f48a95c..0000000
--- a/camera/provider/2.5/default/OWNERS
+++ /dev/null
@@ -1 +0,0 @@
-include platform/frameworks/av:/camera/OWNERS
diff --git a/camera/provider/aidl/vts/OWNERS b/camera/provider/aidl/vts/OWNERS
deleted file mode 100644
index 27d370b..0000000
--- a/camera/provider/aidl/vts/OWNERS
+++ /dev/null
@@ -1,6 +0,0 @@
-# Camera team
-include platform/frameworks/av:/camera/OWNERS
-
-# VTS team
-yim@google.com
-zhuoyao@google.com
\ No newline at end of file
diff --git a/camera/provider/aidl/vts/VtsAidlHalCameraProvider_TargetTest.cpp b/camera/provider/aidl/vts/VtsAidlHalCameraProvider_TargetTest.cpp
index 4d4bb26..50fb052 100644
--- a/camera/provider/aidl/vts/VtsAidlHalCameraProvider_TargetTest.cpp
+++ b/camera/provider/aidl/vts/VtsAidlHalCameraProvider_TargetTest.cpp
@@ -1847,7 +1847,6 @@
 // Generate and verify 10-bit dynamic range request
 TEST_P(CameraAidlTest, process10BitDynamicRangeRequest) {
     std::vector<std::string> cameraDeviceNames = getCameraDeviceNames(mProvider);
-    int64_t bufferId = 1;
     CameraMetadata settings;
 
     for (const auto& name : cameraDeviceNames) {
@@ -1928,12 +1927,12 @@
             // Stream as long as needed to fill the Hal inflight queue
             std::vector<CaptureRequest> requests(halStreams[0].maxBuffers);
 
-            for (int32_t frameNumber = 0; frameNumber < requests.size(); frameNumber++) {
+            for (int32_t requestId = 0; requestId < requests.size(); requestId++) {
                 std::shared_ptr<InFlightRequest> inflightReq = std::make_shared<InFlightRequest>(
                         static_cast<ssize_t>(halStreams.size()), false, supportsPartialResults,
                         partialResultCount, std::unordered_set<std::string>(), resultQueue);
 
-                CaptureRequest& request = requests[frameNumber];
+                CaptureRequest& request = requests[requestId];
                 std::vector<StreamBuffer>& outputBuffers = request.outputBuffers;
                 outputBuffers.resize(halStreams.size());
 
@@ -1942,6 +1941,7 @@
                 std::vector<buffer_handle_t> graphicBuffers;
                 graphicBuffers.reserve(halStreams.size());
 
+                auto bufferId = requestId + 1; // Buffer id value 0 is not valid
                 for (const auto& halStream : halStreams) {
                     buffer_handle_t buffer_handle;
                     if (useHalBufManager) {
@@ -1960,14 +1960,13 @@
                         outputBuffers[k] = {halStream.id, bufferId,
                             android::makeToAidl(buffer_handle), BufferStatus::OK, NativeHandle(),
                             NativeHandle()};
-                        bufferId++;
                     }
                     k++;
                 }
 
                 request.inputBuffer = {
                         -1, 0, NativeHandle(), BufferStatus::ERROR, NativeHandle(), NativeHandle()};
-                request.frameNumber = frameNumber;
+                request.frameNumber = bufferId;
                 request.fmqSettingsSize = 0;
                 request.settings = settings;
                 request.inputWidth = 0;
@@ -1975,7 +1974,7 @@
 
                 {
                     std::unique_lock<std::mutex> l(mLock);
-                    mInflightMap[frameNumber] = inflightReq;
+                    mInflightMap[bufferId] = inflightReq;
                 }
 
             }
@@ -1991,7 +1990,10 @@
                     std::vector<int32_t> {halStreams[0].id});
             ASSERT_TRUE(returnStatus.isOk());
 
-            for (int32_t frameNumber = 0; frameNumber < requests.size(); frameNumber++) {
+            // We are keeping frame numbers and buffer ids consistent. Buffer id value of 0
+            // is used to indicate a buffer that is not present/available so buffer ids as well
+            // as frame numbers begin with 1.
+            for (int32_t frameNumber = 1; frameNumber <= requests.size(); frameNumber++) {
                 const auto& inflightReq = mInflightMap[frameNumber];
                 std::unique_lock<std::mutex> l(mLock);
                 while (!inflightReq->errorCodeValid &&
diff --git a/camera/provider/aidl/vts/camera_aidl_test.cpp b/camera/provider/aidl/vts/camera_aidl_test.cpp
index 974223d..6cad853 100644
--- a/camera/provider/aidl/vts/camera_aidl_test.cpp
+++ b/camera/provider/aidl/vts/camera_aidl_test.cpp
@@ -169,7 +169,7 @@
         ScopedAStatus physicalCameraDeviceStatusChange(
                 const std::string&, const std::string&,
                 ::aidl::android::hardware::camera::common::CameraDeviceStatus) override {
-            return ndk::ScopedAStatus();
+            return ScopedAStatus::ok();
         }
 
         std::vector<std::string> externalCameraDeviceNames;
diff --git a/camera/provider/aidl/vts/device_cb.cpp b/camera/provider/aidl/vts/device_cb.cpp
index 4698b4a..3ec96a1 100644
--- a/camera/provider/aidl/vts/device_cb.cpp
+++ b/camera/provider/aidl/vts/device_cb.cpp
@@ -429,10 +429,11 @@
         CameraAidlTest::InFlightRequest::StreamBufferAndTimestamp streamBufferAndTimestamp;
         auto outstandingBuffers = mUseHalBufManager ? mOutstandingBufferIds :
             request->mOutstandingBufferIds;
+        auto bufferId = mUseHalBufManager ? buffer.bufferId : results.frameNumber;
         auto outputBuffer = outstandingBuffers.empty() ? ::android::makeFromAidl(buffer.buffer) :
-            outstandingBuffers[buffer.streamId][buffer.bufferId];
+            outstandingBuffers[buffer.streamId][bufferId];
         streamBufferAndTimestamp.buffer = {buffer.streamId,
-                                           buffer.bufferId,
+                                           bufferId,
                                            outputBuffer,
                                            buffer.status,
                                            ::android::makeFromAidl(buffer.acquireFence),
diff --git a/camera/provider/default/ExternalCameraProvider.cpp b/camera/provider/default/ExternalCameraProvider.cpp
index d47ddbf..4d2c847 100644
--- a/camera/provider/default/ExternalCameraProvider.cpp
+++ b/camera/provider/default/ExternalCameraProvider.cpp
@@ -46,7 +46,7 @@
 constexpr char kDevicePath[] = "/dev/";
 constexpr char kPrefix[] = "video";
 constexpr int kPrefixLen = sizeof(kPrefix) - 1;
-constexpr int kDevicePrefixLen = sizeof(kDevicePath) + kPrefixLen + 1;
+constexpr int kDevicePrefixLen = sizeof(kDevicePath) + kPrefixLen - 1;
 
 bool matchDeviceName(int cameraIdOffset, const std::string& deviceName, std::string* deviceVersion,
                      std::string* cameraDevicePath) {
@@ -379,4 +379,4 @@
 }  // namespace provider
 }  // namespace camera
 }  // namespace hardware
-}  // namespace android
\ No newline at end of file
+}  // namespace android
diff --git a/camera/provider/default/OWNERS b/camera/provider/default/OWNERS
deleted file mode 100644
index f48a95c..0000000
--- a/camera/provider/default/OWNERS
+++ /dev/null
@@ -1 +0,0 @@
-include platform/frameworks/av:/camera/OWNERS
diff --git a/cas/OWNERS b/cas/OWNERS
new file mode 100644
index 0000000..473c8f26
--- /dev/null
+++ b/cas/OWNERS
@@ -0,0 +1 @@
+include /tv/input/OWNERS
diff --git a/cas/aidl/TEST_MAPPING b/cas/aidl/TEST_MAPPING
new file mode 100644
index 0000000..5bcd388
--- /dev/null
+++ b/cas/aidl/TEST_MAPPING
@@ -0,0 +1,7 @@
+{
+  "presubmit": [
+    {
+      "name": "VtsHalCasAidlTargetTest"
+    }
+  ]
+}
diff --git a/cas/aidl/default/FactoryLoader.h b/cas/aidl/default/FactoryLoader.h
index f90b109..6a562f6 100755
--- a/cas/aidl/default/FactoryLoader.h
+++ b/cas/aidl/default/FactoryLoader.h
@@ -139,6 +139,7 @@
             queryPluginsFromPath(pluginPath, results);
         }
     }
+    closedir(pDir);
     return true;
 }
 
diff --git a/tv/hdmi/aidl/vts/functional/AndroidTest.xml b/cas/aidl/vts/functional/AndroidTest.xml
similarity index 79%
copy from tv/hdmi/aidl/vts/functional/AndroidTest.xml
copy to cas/aidl/vts/functional/AndroidTest.xml
index 0640b2d..6e6af93 100644
--- a/tv/hdmi/aidl/vts/functional/AndroidTest.xml
+++ b/cas/aidl/vts/functional/AndroidTest.xml
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright 2021 The Android Open Source Project
+<!-- Copyright 2023 The Android Open Source Project
 
      Licensed under the Apache License, Version 2.0 (the "License");
      you may not use this file except in compliance with the License.
@@ -13,7 +13,7 @@
      See the License for the specific language governing permissions and
      limitations under the License.
 -->
-<configuration description="Runs VtsHalTvHdmiAidlTargetTest.">
+<configuration description="Runs VtsHalCasAidlTargetTest.">
     <option name="test-suite-tag" value="apct" />
     <option name="test-suite-tag" value="apct-native" />
 
@@ -22,12 +22,12 @@
 
     <target_preparer class="com.android.tradefed.targetprep.PushFilePreparer">
         <option name="cleanup" value="true" />
-        <option name="push" value="VtsHalTvHdmiAidlTargetTest->/data/local/tmp/VtsHalTvHdmiAidlTargetTest" />
+        <option name="push" value="VtsHalCasAidlTargetTest->/data/local/tmp/VtsHalCasAidlTargetTest" />
     </target_preparer>
 
     <test class="com.android.tradefed.testtype.GTest" >
         <option name="native-test-device-path" value="/data/local/tmp" />
-        <option name="module-name" value="VtsHalTvHdmiAidlTargetTest" />
+        <option name="module-name" value="VtsHalCasAidlTargetTest" />
         <option name="native-test-timeout" value="30m" />
     </test>
 </configuration>
diff --git a/compatibility_matrices/Android.bp b/compatibility_matrices/Android.bp
index 37c2820..7e2f788 100644
--- a/compatibility_matrices/Android.bp
+++ b/compatibility_matrices/Android.bp
@@ -83,10 +83,10 @@
 }
 
 vintf_compatibility_matrix {
-    name: "framework_compatibility_matrix.current.xml",
-    stem: "compatibility_matrix.current.xml",
+    name: "framework_compatibility_matrix.8.xml",
+    stem: "compatibility_matrix.8.xml",
     srcs: [
-        "compatibility_matrix.current.xml",
+        "compatibility_matrix.8.xml",
     ],
     kernel_configs: [
         "kernel_config_current_5.10",
diff --git a/compatibility_matrices/Android.mk b/compatibility_matrices/Android.mk
index d19f0da..a20f985 100644
--- a/compatibility_matrices/Android.mk
+++ b/compatibility_matrices/Android.mk
@@ -103,7 +103,7 @@
     framework_compatibility_matrix.5.xml \
     framework_compatibility_matrix.6.xml \
     framework_compatibility_matrix.7.xml \
-    framework_compatibility_matrix.current.xml \
+    framework_compatibility_matrix.8.xml \
     framework_compatibility_matrix.device.xml \
 
 my_framework_matrix_deps += \
diff --git a/compatibility_matrices/compatibility_matrix.7.xml b/compatibility_matrices/compatibility_matrix.7.xml
index 26b8d63..5694945 100644
--- a/compatibility_matrices/compatibility_matrix.7.xml
+++ b/compatibility_matrices/compatibility_matrix.7.xml
@@ -7,7 +7,7 @@
             <instance>default</instance>
         </interface>
     </hal>
-    <hal format="hidl" optional="false">
+    <hal format="hidl" optional="true">
         <name>android.hardware.audio</name>
         <version>6.0</version>
         <version>7.0-1</version>
@@ -16,7 +16,7 @@
             <instance>default</instance>
         </interface>
     </hal>
-    <hal format="hidl" optional="false">
+    <hal format="hidl" optional="true">
         <name>android.hardware.audio.effect</name>
         <version>6.0</version>
         <version>7.0</version>
@@ -238,7 +238,7 @@
             <instance>default</instance>
         </interface>
     </hal>
-    <hal format="hidl" optional="false">
+    <hal format="hidl" optional="true">
         <name>android.hardware.gatekeeper</name>
         <version>1.0</version>
         <interface>
@@ -316,7 +316,7 @@
             <instance>default</instance>
         </interface>
     </hal>
-    <hal format="hidl" optional="false">
+    <hal format="hidl" optional="true">
         <name>android.hardware.graphics.mapper</name>
         <!-- New, non-Go devices should use 4.0, tested in vts_treble_vintf_vendor_test -->
         <version>2.1</version>
@@ -682,7 +682,7 @@
             <instance>default</instance>
         </interface>
     </hal>
-    <hal format="hidl" optional="false">
+    <hal format="hidl" optional="true">
         <name>android.hardware.thermal</name>
         <version>2.0</version>
         <interface>
diff --git a/compatibility_matrices/compatibility_matrix.current.xml b/compatibility_matrices/compatibility_matrix.8.xml
similarity index 96%
rename from compatibility_matrices/compatibility_matrix.current.xml
rename to compatibility_matrices/compatibility_matrix.8.xml
index dd73060..13261c6 100644
--- a/compatibility_matrices/compatibility_matrix.current.xml
+++ b/compatibility_matrices/compatibility_matrix.8.xml
@@ -60,14 +60,6 @@
              <instance>default</instance>
          </interface>
     </hal>
-    <hal format="hidl" optional="true">
-        <name>android.hardware.authsecret</name>
-        <version>1.0</version>
-        <interface>
-            <name>IAuthSecret</name>
-            <instance>default</instance>
-        </interface>
-    </hal>
     <hal format="aidl" optional="true">
         <name>android.hardware.automotive.audiocontrol</name>
         <version>2</version>
@@ -197,14 +189,6 @@
             <regex-instance>[^/]+/[0-9]+</regex-instance>
         </interface>
     </hal>
-    <hal format="hidl" optional="true">
-        <name>android.hardware.cas</name>
-        <version>1.1-2</version>
-        <interface>
-            <name>IMediaCasService</name>
-            <instance>default</instance>
-        </interface>
-    </hal>
     <hal format="aidl" optional="true">
         <name>android.hardware.cas</name>
         <interface>
@@ -243,14 +227,6 @@
             <instance>default</instance>
         </interface>
     </hal>
-    <hal format="hidl" optional="true">
-        <name>android.hardware.gatekeeper</name>
-        <version>1.0</version>
-        <interface>
-            <name>IGatekeeper</name>
-            <instance>default</instance>
-        </interface>
-    </hal>
     <hal format="aidl" optional="true">
         <name>android.hardware.gatekeeper</name>
         <version>1</version>
@@ -313,7 +289,7 @@
     </hal>
     <hal format="aidl" optional="false">
         <name>android.hardware.health</name>
-        <version>1</version>
+        <version>1-2</version>
         <interface>
             <name>IHealth</name>
             <instance>default</instance>
@@ -545,6 +521,16 @@
         </interface>
     </hal>
     <hal format="aidl" optional="true">
+        <name>android.hardware.radio.satellite</name>
+        <version>1</version>
+        <interface>
+            <name>IRadioSatellite</name>
+            <instance>slot1</instance>
+            <instance>slot2</instance>
+            <instance>slot3</instance>
+        </interface>
+    </hal>
+    <hal format="aidl" optional="true">
         <name>android.hardware.radio.ims.media</name>
         <version>1</version>
         <interface>
@@ -634,7 +620,15 @@
             <instance>default</instance>
         </interface>
     </hal>
-    <hal format="aidl" optional="false">
+    <hal format="aidl" optional="true">
+        <name>android.hardware.tetheroffload</name>
+        <version>1</version>
+        <interface>
+            <name>IOffload</name>
+            <instance>default</instance>
+        </interface>
+    </hal>
+    <hal format="aidl" optional="true">
         <name>android.hardware.thermal</name>
         <version>1</version>
         <interface>
@@ -644,6 +638,7 @@
     </hal>
     <hal format="aidl" optional="true">
         <name>android.hardware.tv.hdmi.cec</name>
+        <version>1</version>
         <interface>
             <name>IHdmiCec</name>
             <instance>default</instance>
@@ -651,6 +646,7 @@
     </hal>
     <hal format="aidl" optional="true">
         <name>android.hardware.tv.hdmi.earc</name>
+        <version>1</version>
         <interface>
             <name>IEArc</name>
             <instance>default</instance>
@@ -658,6 +654,7 @@
     </hal>
     <hal format="aidl" optional="true">
         <name>android.hardware.tv.hdmi.connection</name>
+        <version>1</version>
         <interface>
             <name>IHdmiConnection</name>
             <instance>default</instance>
@@ -726,7 +723,7 @@
             <instance>default</instance>
         </interface>
     </hal>
-    <hal format="aidl" optional="true">
+    <hal format="aidl" optional="true" updatable-via-apex="true">
         <name>android.hardware.wifi</name>
         <version>1</version>
         <interface>
@@ -763,7 +760,6 @@
         <name>mapper</name>
         <version>5.0</version>
         <interface>
-            <name>I</name>
             <regex-instance>.*</regex-instance>
         </interface>
     </hal>
diff --git a/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/HostEndpointInfo.aidl b/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/HostEndpointInfo.aidl
index 84e8531..dabdbb6 100644
--- a/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/HostEndpointInfo.aidl
+++ b/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/HostEndpointInfo.aidl
@@ -42,5 +42,6 @@
   enum Type {
     FRAMEWORK = 1,
     APP = 2,
+    NATIVE = 3,
   }
 }
diff --git a/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/IContextHub.aidl b/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/IContextHub.aidl
index c1f4df8..d66e1ac 100644
--- a/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/IContextHub.aidl
+++ b/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/IContextHub.aidl
@@ -47,5 +47,6 @@
   void onHostEndpointDisconnected(char hostEndpointId);
   long[] getPreloadedNanoappIds();
   void onNanSessionStateChanged(in boolean state);
-  const int EX_CONTEXT_HUB_UNSPECIFIED = -1;
+  void setTestMode(in boolean enable);
+  const int EX_CONTEXT_HUB_UNSPECIFIED = (-1);
 }
diff --git a/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/NanoappBinary.aidl b/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/NanoappBinary.aidl
index d53b28f..741a9cf 100644
--- a/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/NanoappBinary.aidl
+++ b/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/NanoappBinary.aidl
@@ -40,7 +40,7 @@
   byte targetChreApiMajorVersion;
   byte targetChreApiMinorVersion;
   byte[] customBinary;
-  const int FLAG_SIGNED = 1;
-  const int FLAG_ENCRYPTED = 2;
-  const int FLAG_TCM_CAPABLE = 4;
+  const int FLAG_SIGNED = (1 << 0);
+  const int FLAG_ENCRYPTED = (1 << 1);
+  const int FLAG_TCM_CAPABLE = (1 << 2);
 }
diff --git a/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/Setting.aidl b/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/Setting.aidl
index d998478..aeb720b 100644
--- a/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/Setting.aidl
+++ b/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/Setting.aidl
@@ -35,10 +35,10 @@
 @Backing(type="byte") @VintfStability
 enum Setting {
   LOCATION = 1,
-  WIFI_MAIN = 2,
-  WIFI_SCANNING = 3,
-  AIRPLANE_MODE = 4,
-  MICROPHONE = 5,
-  BT_MAIN = 6,
-  BT_SCANNING = 7,
+  WIFI_MAIN,
+  WIFI_SCANNING,
+  AIRPLANE_MODE,
+  MICROPHONE,
+  BT_MAIN,
+  BT_SCANNING,
 }
diff --git a/contexthub/aidl/android/hardware/contexthub/HostEndpointInfo.aidl b/contexthub/aidl/android/hardware/contexthub/HostEndpointInfo.aidl
index a9d6657..c083bb9 100644
--- a/contexthub/aidl/android/hardware/contexthub/HostEndpointInfo.aidl
+++ b/contexthub/aidl/android/hardware/contexthub/HostEndpointInfo.aidl
@@ -44,5 +44,8 @@
 
         /** This endpoint is an Android app. */
         APP = 2,
+
+        /** This endpoint is from an Android native program. */
+        NATIVE = 3,
     }
 }
diff --git a/contexthub/aidl/android/hardware/contexthub/IContextHub.aidl b/contexthub/aidl/android/hardware/contexthub/IContextHub.aidl
index 7f50730..f9838bd 100644
--- a/contexthub/aidl/android/hardware/contexthub/IContextHub.aidl
+++ b/contexthub/aidl/android/hardware/contexthub/IContextHub.aidl
@@ -217,6 +217,22 @@
     void onNanSessionStateChanged(in boolean state);
 
     /**
+     * Puts the context hub in and out of test mode. Test mode is a clean state
+     * where tests can be executed in the same environment. If enable is true,
+     * this will enable test mode by unloading all nanoapps. If enable is false,
+     * this will disable test mode and reverse the actions of enabling test mode
+     * by loading all preloaded nanoapps. This puts CHRE in a normal state.
+     *
+     * This should only be used for a test environment, either through a
+     * @TestApi or development tools. This should not be used in a production
+     * environment.
+     *
+     * @param enable If true, put the context hub in test mode. If false, disable
+     *               test mode.
+     */
+    void setTestMode(in boolean enable);
+
+    /**
      * Error codes that are used as service specific errors with the AIDL return
      * value EX_SERVICE_SPECIFIC.
      */
diff --git a/contexthub/aidl/default/ContextHub.cpp b/contexthub/aidl/default/ContextHub.cpp
index 615ac5c..b98bfb2 100644
--- a/contexthub/aidl/default/ContextHub.cpp
+++ b/contexthub/aidl/default/ContextHub.cpp
@@ -113,6 +113,10 @@
     }
 }
 
+ScopedAStatus ContextHub::setTestMode(bool /* enable */) {
+    return ndk::ScopedAStatus::ok();
+}
+
 ScopedAStatus ContextHub::onHostEndpointConnected(const HostEndpointInfo& in_info) {
     mConnectedHostEndpoints.insert(in_info.hostEndpointId);
 
diff --git a/contexthub/aidl/default/include/contexthub-impl/ContextHub.h b/contexthub/aidl/default/include/contexthub-impl/ContextHub.h
index b3998b9..dc9aef0 100644
--- a/contexthub/aidl/default/include/contexthub-impl/ContextHub.h
+++ b/contexthub/aidl/default/include/contexthub-impl/ContextHub.h
@@ -44,6 +44,7 @@
             int32_t in_contextHubId, const std::shared_ptr<IContextHubCallback>& in_cb) override;
     ::ndk::ScopedAStatus sendMessageToHub(int32_t in_contextHubId,
                                           const ContextHubMessage& in_message) override;
+    ::ndk::ScopedAStatus setTestMode(bool enable) override;
     ::ndk::ScopedAStatus onHostEndpointConnected(const HostEndpointInfo& in_info) override;
 
     ::ndk::ScopedAStatus onHostEndpointDisconnected(char16_t in_hostEndpointId) override;
diff --git a/contexthub/aidl/vts/VtsAidlHalContextHubTargetTest.cpp b/contexthub/aidl/vts/VtsAidlHalContextHubTargetTest.cpp
index 4731648..228a569 100644
--- a/contexthub/aidl/vts/VtsAidlHalContextHubTargetTest.cpp
+++ b/contexthub/aidl/vts/VtsAidlHalContextHubTargetTest.cpp
@@ -84,6 +84,26 @@
     }
 }
 
+TEST_P(ContextHubAidl, TestEnableTestMode) {
+    Status status = contextHub->setTestMode(true);
+    if (status.exceptionCode() == Status::EX_UNSUPPORTED_OPERATION ||
+        status.transactionError() == android::UNKNOWN_TRANSACTION) {
+        GTEST_SKIP() << "Not supported -> old API; or not implemented";
+    } else {
+        ASSERT_TRUE(status.isOk());
+    }
+}
+
+TEST_P(ContextHubAidl, TestDisableTestMode) {
+    Status status = contextHub->setTestMode(false);
+    if (status.exceptionCode() == Status::EX_UNSUPPORTED_OPERATION ||
+        status.transactionError() == android::UNKNOWN_TRANSACTION) {
+        GTEST_SKIP() << "Not supported -> old API; or not implemented";
+    } else {
+        ASSERT_TRUE(status.isOk());
+    }
+}
+
 class EmptyContextHubCallback : public android::hardware::contexthub::BnContextHubCallback {
   public:
     Status handleNanoappInfo(const std::vector<NanoappInfo>& /* appInfo */) override {
@@ -166,11 +186,11 @@
     Status status = contextHub->getPreloadedNanoappIds(&preloadedNanoappIds);
     if (status.exceptionCode() == Status::EX_UNSUPPORTED_OPERATION ||
         status.transactionError() == android::UNKNOWN_TRANSACTION) {
-        return;  // not supported -> old API; or not implemented
+        GTEST_SKIP() << "Not supported -> old API; or not implemented";
+    } else {
+        ASSERT_TRUE(status.isOk());
+        ASSERT_FALSE(preloadedNanoappIds.empty());
     }
-
-    ASSERT_TRUE(status.isOk());
-    ASSERT_FALSE(preloadedNanoappIds.empty());
 }
 
 // Helper callback that puts the TransactionResult for the expectedTransactionId into a
diff --git a/drm/README.md b/drm/README.md
new file mode 100644
index 0000000..d56288e
--- /dev/null
+++ b/drm/README.md
@@ -0,0 +1,13 @@
+# DRM HAL
+
+This is the underlying HAL implementation for `MediaDrm`/`MediaCrypto` (and
+their NDK counterparts).
+
+## Plugin-vendor-specific VTS modules
+
+The interface `DrmHalVTSVendorModule_V1` is compatible with all versions of the
+DRM HAL (hidl 1.0-1.4, aidl).
+
+Please see `./1.0/vts/doc/Drm_Vendor_Modules_v1.pdf`.
+
+TODO(b/266091099): convert `Drm_Vendor_Modules_v1.pdf` to Markdown.
\ No newline at end of file
diff --git a/drm/aidl/vts/drm_hal_common.cpp b/drm/aidl/vts/drm_hal_common.cpp
index 7de8167..f5ef0e7 100644
--- a/drm/aidl/vts/drm_hal_common.cpp
+++ b/drm/aidl/vts/drm_hal_common.cpp
@@ -187,6 +187,12 @@
     auto svc = GetParamService();
     const string drmInstance = HalFullName(kDrmIface, svc);
 
+    if (!vendorModule) {
+        ASSERT_NE(drmInstance, HalFullName(kDrmIface, "widevine")) << "Widevine requires vendor module.";
+        ASSERT_NE(drmInstance, HalFullName(kDrmIface, "clearkey")) << "Clearkey requires vendor module.";
+        GTEST_SKIP() << "No vendor module installed";
+    }
+
     if (drmInstance.find("IDrmFactory") != std::string::npos) {
         drmFactory = IDrmFactory::fromBinder(
                 ::ndk::SpAIBinder(AServiceManager_waitForService(drmInstance.c_str())));
@@ -195,12 +201,6 @@
         cryptoPlugin = createCryptoPlugin();
     }
 
-    if (!vendorModule) {
-        ASSERT_NE(drmInstance, "widevine") << "Widevine requires vendor module.";
-        ASSERT_NE(drmInstance, "clearkey") << "Clearkey requires vendor module.";
-        GTEST_SKIP() << "No vendor module installed";
-    }
-
     ASSERT_EQ(HalBaseName(drmInstance), vendorModule->getServiceName());
     contentConfigurations = vendorModule->getContentConfigurations();
 
diff --git a/drm/aidl/vts/drm_hal_test.cpp b/drm/aidl/vts/drm_hal_test.cpp
index 14b3acf..847a4dc 100644
--- a/drm/aidl/vts/drm_hal_test.cpp
+++ b/drm/aidl/vts/drm_hal_test.cpp
@@ -198,6 +198,18 @@
         EXPECT_NE(keySetId, keySetId2.keySetId);
     }
 
+    for (auto level : {kHwSecureAll, kSwSecureCrypto}) {
+        Status err = Status::OK;
+        auto sid = openSession(level, &err);
+        if (err == Status::OK) {
+            closeSession(sid);
+        } else if (err == Status::ERROR_DRM_CANNOT_HANDLE) {
+            continue;
+        } else {
+            EXPECT_EQ(Status::ERROR_DRM_NOT_PROVISIONED, err);
+            provision();
+        }
+    }
     ret = drmPlugin->removeOfflineLicense({keySetId});
     EXPECT_TXN(ret);
     EXPECT_EQ(Status::BAD_VALUE, DrmErr(ret));
diff --git a/fastboot/aidl/default/Android.bp b/fastboot/aidl/default/Android.bp
index 0c96b33..cb38dcc 100644
--- a/fastboot/aidl/default/Android.bp
+++ b/fastboot/aidl/default/Android.bp
@@ -26,7 +26,7 @@
     name: "android.hardware.fastboot-service.example_recovery",
     init_rc: ["android.hardware.fastboot-service.example_recovery.rc"],
     vintf_fragments: ["android.hardware.fastboot-service.example.xml"],
-    recovery_available: true,
+    recovery: true,
     srcs: [
         "Fastboot.cpp",
         "main.cpp",
diff --git a/gatekeeper/aidl/android/hardware/gatekeeper/GatekeeperEnrollResponse.aidl b/gatekeeper/aidl/android/hardware/gatekeeper/GatekeeperEnrollResponse.aidl
index 04bacf0..227210b 100644
--- a/gatekeeper/aidl/android/hardware/gatekeeper/GatekeeperEnrollResponse.aidl
+++ b/gatekeeper/aidl/android/hardware/gatekeeper/GatekeeperEnrollResponse.aidl
@@ -22,11 +22,12 @@
 @VintfStability
 parcelable GatekeeperEnrollResponse {
     /**
-     * Request completion status
+     * Request completion status. The status code can be IGatekeeper::STATUS_OK
+     * or IGatekeeper::ERROR_RETRY_TIMEOUT.
      */
     int statusCode;
     /**
-     * Retry timeout in ms, if code == ERROR_RETRY_TIMEOUT
+     * Retry timeout in ms, if code == IGatekeeper::ERROR_RETRY_TIMEOUT
      * otherwise unused (0)
      */
     int timeoutMs;
diff --git a/gatekeeper/aidl/android/hardware/gatekeeper/GatekeeperVerifyResponse.aidl b/gatekeeper/aidl/android/hardware/gatekeeper/GatekeeperVerifyResponse.aidl
index bcf2d76..f8dbeeb 100644
--- a/gatekeeper/aidl/android/hardware/gatekeeper/GatekeeperVerifyResponse.aidl
+++ b/gatekeeper/aidl/android/hardware/gatekeeper/GatekeeperVerifyResponse.aidl
@@ -24,11 +24,12 @@
 @VintfStability
 parcelable GatekeeperVerifyResponse {
     /**
-     * Request completion status
+     * Request completion status. The status code can be IGatekeeper::STATUS_OK
+     * or IGatekeeper::ERROR_RETRY_TIMEOUT or IGatekeeper::STATUS_REENROLL.
      */
     int statusCode;
     /**
-     * Retry timeout in ms, if code == ERROR_RETRY_TIMEOUT
+     * Retry timeout in ms, if code == IGatekeeper::ERROR_RETRY_TIMEOUT
      * otherwise unused (0)
      */
     int timeoutMs;
diff --git a/gatekeeper/aidl/android/hardware/gatekeeper/IGatekeeper.aidl b/gatekeeper/aidl/android/hardware/gatekeeper/IGatekeeper.aidl
index 927293e..215c6e6 100644
--- a/gatekeeper/aidl/android/hardware/gatekeeper/IGatekeeper.aidl
+++ b/gatekeeper/aidl/android/hardware/gatekeeper/IGatekeeper.aidl
@@ -30,7 +30,7 @@
     const int STATUS_REENROLL = 1;
     /* operation is successful */
     const int STATUS_OK = 0;
-    /* operation is successful. */
+    /* operation failed. */
     const int ERROR_GENERAL_FAILURE = -1;
     /* operation should  be retried after timeout. */
     const int ERROR_RETRY_TIMEOUT = -2;
diff --git a/gnss/aidl/vts/gnss_hal_test_cases.cpp b/gnss/aidl/vts/gnss_hal_test_cases.cpp
index 48027b6..bed5a69 100644
--- a/gnss/aidl/vts/gnss_hal_test_cases.cpp
+++ b/gnss/aidl/vts/gnss_hal_test_cases.cpp
@@ -531,6 +531,11 @@
 
     EXPECT_EQ(gnssPowerIndicationCallback->capabilities_cbq_.calledCount(), 1);
 
+    if (gnssPowerIndicationCallback->last_capabilities_ == 0) {
+        // Skipping the test since GnssPowerIndication is not supported.
+        return;
+    }
+
     // Request and verify a GnssPowerStats is received
     gnssPowerIndicationCallback->gnss_power_stats_cbq_.reset();
     iGnssPowerIndication->requestGnssPowerStats();
diff --git a/graphics/allocator/aidl/aidl_api/android.hardware.graphics.allocator/current/android/hardware/graphics/allocator/AllocationError.aidl b/graphics/allocator/aidl/aidl_api/android.hardware.graphics.allocator/current/android/hardware/graphics/allocator/AllocationError.aidl
index 6e7b739..e50d170 100644
--- a/graphics/allocator/aidl/aidl_api/android.hardware.graphics.allocator/current/android/hardware/graphics/allocator/AllocationError.aidl
+++ b/graphics/allocator/aidl/aidl_api/android.hardware.graphics.allocator/current/android/hardware/graphics/allocator/AllocationError.aidl
@@ -34,7 +34,7 @@
 package android.hardware.graphics.allocator;
 @Backing(type="int") @VintfStability
 enum AllocationError {
-  BAD_DESCRIPTOR = 0,
-  NO_RESOURCES = 1,
-  UNSUPPORTED = 2,
+  BAD_DESCRIPTOR,
+  NO_RESOURCES,
+  UNSUPPORTED,
 }
diff --git a/graphics/allocator/aidl/aidl_api/android.hardware.graphics.allocator/current/android/hardware/graphics/allocator/IAllocator.aidl b/graphics/allocator/aidl/aidl_api/android.hardware.graphics.allocator/current/android/hardware/graphics/allocator/IAllocator.aidl
index 48bef16..66e49a7 100644
--- a/graphics/allocator/aidl/aidl_api/android.hardware.graphics.allocator/current/android/hardware/graphics/allocator/IAllocator.aidl
+++ b/graphics/allocator/aidl/aidl_api/android.hardware.graphics.allocator/current/android/hardware/graphics/allocator/IAllocator.aidl
@@ -35,7 +35,7 @@
 @VintfStability
 interface IAllocator {
   /**
-   * @deprecated As of android.hardware.graphics.allocator-V2, this is deprecated & replaced with allocate2
+   * @deprecated As of android.hardware.graphics.allocator-V2 in combination with AIMAPPER_VERSION_5 this is deprecated & replaced with allocate2. If android.hardware.graphics.mapper@4 is still in use, however, this is still required to be implemented.
    */
   android.hardware.graphics.allocator.AllocationResult allocate(in byte[] descriptor, in int count);
   android.hardware.graphics.allocator.AllocationResult allocate2(in android.hardware.graphics.allocator.BufferDescriptorInfo descriptor, in int count);
diff --git a/graphics/allocator/aidl/android/hardware/graphics/allocator/IAllocator.aidl b/graphics/allocator/aidl/android/hardware/graphics/allocator/IAllocator.aidl
index 71cebd6..2277bae 100644
--- a/graphics/allocator/aidl/android/hardware/graphics/allocator/IAllocator.aidl
+++ b/graphics/allocator/aidl/android/hardware/graphics/allocator/IAllocator.aidl
@@ -32,8 +32,10 @@
      * @param count The number of buffers to allocate.
      * @return An AllocationResult containing the result of the allocation
      * @throws AllocationError on failure
-     * @deprecated As of android.hardware.graphics.allocator-V2, this is deprecated & replaced with
-     *         allocate2
+     * @deprecated As of android.hardware.graphics.allocator-V2 in combination with
+     *             AIMAPPER_VERSION_5 this is deprecated & replaced with allocate2.
+     *             If android.hardware.graphics.mapper@4 is still in use, however, this is
+     *             still required to be implemented.
      */
     AllocationResult allocate(in byte[] descriptor, in int count);
 
diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/AnbrBitrate.aidl b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/HdrConversionCapability.aidl
similarity index 81%
copy from radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/AnbrBitrate.aidl
copy to graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/HdrConversionCapability.aidl
index 711ac19..66151ca 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/AnbrBitrate.aidl
+++ b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/HdrConversionCapability.aidl
@@ -1,11 +1,11 @@
-/*
- * Copyright (C) 2022 The Android Open Source Project
+/**
+ * Copyright (c) 2022, The Android Open Source Project
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- *      http://www.apache.org/licenses/LICENSE-2.0
+ *     http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
@@ -31,10 +31,10 @@
 // with such a backward incompatible change, it has a high risk of breaking
 // later when a module using the interface is updated, e.g., Mainline modules.
 
-package android.hardware.radio.ims.media;
+package android.hardware.graphics.common;
 @VintfStability
-parcelable AnbrBitrate {
-  int uplinkBps;
-  int downlinkBps;
-  const int INVALID_ANBR_BITRATE = -1;
+parcelable HdrConversionCapability {
+  android.hardware.graphics.common.ParcelableHdr sourceType;
+  @nullable android.hardware.graphics.common.ParcelableHdr outputType;
+  boolean addsLatency;
 }
diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/AnbrBitrate.aidl b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/HdrConversionStrategy.aidl
similarity index 82%
copy from radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/AnbrBitrate.aidl
copy to graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/HdrConversionStrategy.aidl
index 711ac19..db785cf 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/AnbrBitrate.aidl
+++ b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/HdrConversionStrategy.aidl
@@ -1,11 +1,11 @@
-/*
- * Copyright (C) 2022 The Android Open Source Project
+/**
+ * Copyright (c) 2022, The Android Open Source Project
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- *      http://www.apache.org/licenses/LICENSE-2.0
+ *     http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
@@ -31,10 +31,10 @@
 // with such a backward incompatible change, it has a high risk of breaking
 // later when a module using the interface is updated, e.g., Mainline modules.
 
-package android.hardware.radio.ims.media;
+package android.hardware.graphics.common;
 @VintfStability
-parcelable AnbrBitrate {
-  int uplinkBps;
-  int downlinkBps;
-  const int INVALID_ANBR_BITRATE = -1;
+union HdrConversionStrategy {
+  boolean passthrough = true;
+  android.hardware.graphics.common.Hdr[] autoAllowedHdrTypes;
+  android.hardware.graphics.common.Hdr forceHdrConversion;
 }
diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/MediaProtocolType.aidl b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/ParcelableHdr.aidl
similarity index 86%
copy from radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/MediaProtocolType.aidl
copy to graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/ParcelableHdr.aidl
index 1a290d4..788bd4e 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/MediaProtocolType.aidl
+++ b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/ParcelableHdr.aidl
@@ -1,11 +1,11 @@
-/*
- * Copyright (C) 2021 The Android Open Source Project
+/**
+ * Copyright (c) 2023, The Android Open Source Project
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- *      http://www.apache.org/licenses/LICENSE-2.0
+ *     http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
@@ -31,9 +31,8 @@
 // with such a backward incompatible change, it has a high risk of breaking
 // later when a module using the interface is updated, e.g., Mainline modules.
 
-package android.hardware.radio.ims.media;
-@Backing(type="int") @VintfStability
-enum MediaProtocolType {
-  RTP = 0,
-  RTCP = 1,
+package android.hardware.graphics.common;
+@VintfStability
+parcelable ParcelableHdr {
+  android.hardware.graphics.common.Hdr hdr;
 }
diff --git a/graphics/common/aidl/android/hardware/graphics/common/HdrConversionCapability.aidl b/graphics/common/aidl/android/hardware/graphics/common/HdrConversionCapability.aidl
new file mode 100644
index 0000000..53b3256
--- /dev/null
+++ b/graphics/common/aidl/android/hardware/graphics/common/HdrConversionCapability.aidl
@@ -0,0 +1,37 @@
+/**
+ * Copyright (c) 2022, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.graphics.common;
+
+import android.hardware.graphics.common.ParcelableHdr;
+
+/**
+ * Output parameter for IComposerClient.getHdrConversionCapabilities
+ *
+ * @param sourceType is the HDR type that can be converted to outputType.
+ *
+ * @param outputType is the HDR type/ SDR that the source type can be converted to. The value null
+ * is used to depict SDR outputType.
+ *
+ * @param addsLatency is false if no latency added due to HDR conversion from sourceType to
+ * outputType, otherwise true.
+ */
+@VintfStability
+parcelable HdrConversionCapability {
+    ParcelableHdr sourceType;
+    @nullable ParcelableHdr outputType;
+    boolean addsLatency;
+}
diff --git a/graphics/common/aidl/android/hardware/graphics/common/HdrConversionStrategy.aidl b/graphics/common/aidl/android/hardware/graphics/common/HdrConversionStrategy.aidl
new file mode 100644
index 0000000..f564e9f
--- /dev/null
+++ b/graphics/common/aidl/android/hardware/graphics/common/HdrConversionStrategy.aidl
@@ -0,0 +1,39 @@
+/**
+ * Copyright (c) 2022, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.graphics.common;
+/**
+ * Input parameter for IComposerClient.setHdrConversionStrategy
+ *
+ * @param passthrough - When this parameter is set to true, HDR conversion is disabled by the
+ * implementation. The output HDR type will change dynamically to match the content. This value is
+ * never set to false, as other union values will be present in the false case.
+ *
+ * @param autoAllowedHdrTypes - When this parameter is set, the output HDR type is selected by the
+ * implementation. The implementation is only allowed to set the output HDR type to the HDR types
+ * present in this list. If conversion to any of the autoHdrTypes types is not possible, the
+ * implementation should do no conversion.
+ *
+ * @param forceHdrConversion - When this parameter is set, the implementation should convert all
+ * content to this HDR type, when possible. If not possible, the functionality should be similar to
+ * passthrough=true.
+ */
+@VintfStability
+union HdrConversionStrategy {
+    boolean passthrough = true;
+    android.hardware.graphics.common.Hdr[] autoAllowedHdrTypes;
+    android.hardware.graphics.common.Hdr forceHdrConversion;
+}
diff --git a/radio/aidl/android/hardware/radio/ims/media/MediaProtocolType.aidl b/graphics/common/aidl/android/hardware/graphics/common/ParcelableHdr.aidl
similarity index 62%
copy from radio/aidl/android/hardware/radio/ims/media/MediaProtocolType.aidl
copy to graphics/common/aidl/android/hardware/graphics/common/ParcelableHdr.aidl
index 325c6fa..9aff277 100644
--- a/radio/aidl/android/hardware/radio/ims/media/MediaProtocolType.aidl
+++ b/graphics/common/aidl/android/hardware/graphics/common/ParcelableHdr.aidl
@@ -1,11 +1,11 @@
-/*
- * Copyright (C) 2021 The Android Open Source Project
+/**
+ * Copyright (c) 2023, The Android Open Source Project
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- *      http://www.apache.org/licenses/LICENSE-2.0
+ *     http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
@@ -14,13 +14,11 @@
  * limitations under the License.
  */
 
-package android.hardware.radio.ims.media;
+package android.hardware.graphics.common;
+
+import android.hardware.graphics.common.Hdr;
 
 @VintfStability
-@Backing(type="int")
-enum MediaProtocolType {
-   /** Real Time Protocol, see RFC 3550 */
-   RTP = 0,
-   /** Real Time Control Protocol, see RFC 3550 */
-   RTCP = 1,
+parcelable ParcelableHdr {
+    Hdr hdr;
 }
diff --git a/graphics/composer/2.1/vts/functional/VtsHalGraphicsComposerV2_1TargetTest.cpp b/graphics/composer/2.1/vts/functional/VtsHalGraphicsComposerV2_1TargetTest.cpp
index b66ee19..4822678 100644
--- a/graphics/composer/2.1/vts/functional/VtsHalGraphicsComposerV2_1TargetTest.cpp
+++ b/graphics/composer/2.1/vts/functional/VtsHalGraphicsComposerV2_1TargetTest.cpp
@@ -657,7 +657,6 @@
                                                              IComposerClient::Attribute::WIDTH);
         mDisplayHeight = mComposerClient->getDisplayAttribute(mPrimaryDisplay, activeConfig,
                                                               IComposerClient::Attribute::HEIGHT);
-
         mWriter = std::make_unique<CommandWriterBase>(1024);
         mReader = std::make_unique<TestCommandReader>();
     }
@@ -667,13 +666,11 @@
         ASSERT_NO_FATAL_FAILURE(GraphicsComposerHidlTest::TearDown());
     }
 
-    NativeHandleWrapper allocate() { return allocate(mDisplayWidth, mDisplayHeight); }
-
-    NativeHandleWrapper allocate(uint32_t width, uint32_t height) {
+    NativeHandleWrapper allocate() {
         uint64_t usage =
                 static_cast<uint64_t>(BufferUsage::CPU_WRITE_OFTEN | BufferUsage::CPU_READ_OFTEN |
                                       BufferUsage::COMPOSER_OVERLAY);
-        return mGralloc->allocate(width, height, 1, PixelFormat::RGBA_8888, usage);
+        return mGralloc->allocate(mDisplayWidth, mDisplayHeight, 1, PixelFormat::RGBA_8888, usage);
     }
 
     void execute() { mComposerClient->execute(mReader.get(), mWriter.get()); }
@@ -887,57 +884,6 @@
 }
 
 /**
- * Test IComposerClient::Command::SET_LAYER_BUFFER with the behavior used for clearing buffer slots.
- */
-TEST_P(GraphicsComposerHidlCommandTest, SET_LAYER_BUFFER_TO_CLEAR_BUFFER_SLOTS) {
-    // A buffer used to clear buffer slots
-    auto clearSlotBuffer = allocate(1u, 1u);
-
-    auto handle1 = allocate();
-    ASSERT_NE(nullptr, handle1.get());
-    IComposerClient::Rect displayFrame{0, 0, mDisplayWidth, mDisplayHeight};
-    Layer layer;
-    ASSERT_NO_FATAL_FAILURE(
-            layer = mComposerClient->createLayer(mPrimaryDisplay, kBufferSlotCount));
-    mWriter->selectDisplay(mPrimaryDisplay);
-    mWriter->selectLayer(layer);
-    mWriter->setLayerCompositionType(IComposerClient::Composition::DEVICE);
-    mWriter->setLayerDisplayFrame(displayFrame);
-    mWriter->setLayerBuffer(0, handle1.get(), -1);
-    mWriter->setLayerDataspace(Dataspace::UNKNOWN);
-    mWriter->validateDisplay();
-    execute();
-    if (mReader->mCompositionChanges.size() != 0) {
-        GTEST_SUCCEED() << "Composition change requested, skipping test";
-        return;
-    }
-    ASSERT_EQ(0, mReader->mErrors.size());
-
-    mWriter->selectDisplay(mPrimaryDisplay);
-    mWriter->presentDisplay();
-    execute();
-    ASSERT_EQ(0, mReader->mErrors.size());
-
-    // Ensure we can clear a buffer slot and then set that same slot with a new buffer
-    auto handle2 = allocate();
-    ASSERT_NE(nullptr, handle2.get());
-    mWriter->selectDisplay(mPrimaryDisplay);
-    mWriter->selectLayer(layer);
-    mWriter->setLayerBuffer(0, clearSlotBuffer.get(), -1);
-    mWriter->selectDisplay(mPrimaryDisplay);
-    mWriter->selectLayer(layer);
-    mWriter->setLayerBuffer(0, handle2.get(), -1);
-    mWriter->validateDisplay();
-    execute();
-    ASSERT_EQ(0, mReader->mErrors.size());
-
-    mWriter->selectDisplay(mPrimaryDisplay);
-    mWriter->presentDisplay();
-    execute();
-    ASSERT_EQ(0, mReader->mErrors.size());
-}
-
-/**
  * Test IComposerClient::Command::SET_LAYER_SURFACE_DAMAGE.
  */
 TEST_P(GraphicsComposerHidlCommandTest, SET_LAYER_SURFACE_DAMAGE) {
diff --git a/graphics/composer/2.2/utils/vts/ComposerVts.cpp b/graphics/composer/2.2/utils/vts/ComposerVts.cpp
index a6dfcaf..d4f0281 100644
--- a/graphics/composer/2.2/utils/vts/ComposerVts.cpp
+++ b/graphics/composer/2.2/utils/vts/ComposerVts.cpp
@@ -126,23 +126,15 @@
     ASSERT_EQ(Error::NONE, error) << "failed to setReadbackBuffer";
 }
 
-void ComposerClient::getRequiredReadbackBufferAttributes(Display display,
-                                                         PixelFormat* outPixelFormat,
-                                                         Dataspace* outDataspace) {
-    ASSERT_EQ(Error::NONE, getReadbackBufferAttributes(display, outPixelFormat, outDataspace));
-}
-
-Error ComposerClient::getReadbackBufferAttributes(Display display, PixelFormat* outPixelFormat,
-                                                  Dataspace* outDataspace) {
-    Error error;
+void ComposerClient::getReadbackBufferAttributes(Display display, PixelFormat* outPixelFormat,
+                                                 Dataspace* outDataspace) {
     mClient->getReadbackBufferAttributes(
-            display, [&](const Error& tmpError, const PixelFormat& tmpPixelFormat,
-                         const Dataspace& tmpDataspace) {
-                error = tmpError;
-                *outPixelFormat = tmpPixelFormat;
-                *outDataspace = tmpDataspace;
+            display,
+            [&](const auto& tmpError, const auto& tmpOutPixelFormat, const auto& tmpOutDataspace) {
+                ASSERT_EQ(Error::NONE, tmpError) << "failed to get readback buffer attributes";
+                *outPixelFormat = tmpOutPixelFormat;
+                *outDataspace = tmpOutDataspace;
             });
-    return error;
 }
 
 void ComposerClient::getReadbackBufferFence(Display display, int32_t* outFence) {
diff --git a/graphics/composer/2.2/utils/vts/ReadbackVts.cpp b/graphics/composer/2.2/utils/vts/ReadbackVts.cpp
index 5dd68df..a1794af 100644
--- a/graphics/composer/2.2/utils/vts/ReadbackVts.cpp
+++ b/graphics/composer/2.2/utils/vts/ReadbackVts.cpp
@@ -19,8 +19,6 @@
 #include "renderengine/ExternalTexture.h"
 #include "renderengine/impl/ExternalTexture.h"
 
-using ::android::status_t;
-
 namespace android {
 namespace hardware {
 namespace graphics {
@@ -109,40 +107,6 @@
     }
 }
 
-void ReadbackHelper::fillBufferAndGetFence(const sp<GraphicBuffer>& graphicBuffer,
-                                           IComposerClient::Color desiredColor, int* fillFence) {
-    ASSERT_NE(nullptr, fillFence);
-    std::vector<IComposerClient::Color> desiredColors(
-            static_cast<size_t>(graphicBuffer->getWidth() * graphicBuffer->getHeight()));
-    ::android::Rect bounds = graphicBuffer->getBounds();
-    fillColorsArea(desiredColors, static_cast<int32_t>(graphicBuffer->getWidth()),
-                   {bounds.left, bounds.top, bounds.right, bounds.bottom}, desiredColor);
-    ASSERT_NO_FATAL_FAILURE(fillBufferAndGetFence(graphicBuffer, desiredColors, fillFence));
-}
-
-void ReadbackHelper::fillBufferAndGetFence(const sp<GraphicBuffer>& graphicBuffer,
-                                           const std::vector<IComposerClient::Color>& desiredColors,
-                                           int* fillFence) {
-    ASSERT_TRUE(graphicBuffer->getPixelFormat() == ::android::PIXEL_FORMAT_RGB_888 ||
-                graphicBuffer->getPixelFormat() == ::android::PIXEL_FORMAT_RGBA_8888);
-    void* bufData;
-    int32_t bytesPerPixel = -1;
-    int32_t bytesPerStride = -1;
-    status_t status =
-            graphicBuffer->lock(GRALLOC_USAGE_SW_READ_OFTEN | GRALLOC_USAGE_SW_WRITE_OFTEN,
-                                &bufData, &bytesPerPixel, &bytesPerStride);
-    ASSERT_EQ(::android::OK, status);
-
-    const uint32_t stride = (bytesPerPixel > 0 && bytesPerStride > 0)
-                                    ? static_cast<uint32_t>(bytesPerStride / bytesPerPixel)
-                                    : graphicBuffer->getStride();
-    ReadbackHelper::fillBuffer(graphicBuffer->getWidth(), graphicBuffer->getHeight(), stride,
-                               bufData, static_cast<PixelFormat>(graphicBuffer->getPixelFormat()),
-                               desiredColors);
-    status = graphicBuffer->unlockAsync(fillFence);
-    ASSERT_EQ(::android::OK, status);
-}
-
 void ReadbackHelper::fillBuffer(int32_t width, int32_t height, uint32_t stride, void* bufferData,
                                 PixelFormat pixelFormat,
                                 std::vector<IComposerClient::Color> desiredPixelColors) {
@@ -152,16 +116,16 @@
     for (int row = 0; row < height; row++) {
         for (int col = 0; col < width; col++) {
             int pixel = row * width + col;
-            IComposerClient::Color desiredColor = desiredPixelColors[pixel];
+            IComposerClient::Color srcColor = desiredPixelColors[pixel];
 
             int offset = (row * stride + col) * bytesPerPixel;
             uint8_t* pixelColor = (uint8_t*)bufferData + offset;
-            pixelColor[0] = desiredColor.r;
-            pixelColor[1] = desiredColor.g;
-            pixelColor[2] = desiredColor.b;
+            pixelColor[0] = srcColor.r;
+            pixelColor[1] = srcColor.g;
+            pixelColor[2] = srcColor.b;
 
             if (bytesPerPixel == 4) {
-                pixelColor[3] = desiredColor.a;
+                pixelColor[3] = srcColor.a;
             }
         }
     }
@@ -188,14 +152,12 @@
     }
 }
 
-bool ReadbackHelper::readbackSupported(PixelFormat pixelFormat, Dataspace dataspace, Error error) {
+bool ReadbackHelper::readbackSupported(const PixelFormat& pixelFormat, const Dataspace& dataspace,
+                                       const Error error) {
     if (error != Error::NONE) {
         return false;
     }
-    return readbackSupported(pixelFormat, dataspace);
-}
-
-bool ReadbackHelper::readbackSupported(PixelFormat pixelFormat, Dataspace dataspace) {
+    // TODO: add support for RGBA_1010102
     if (pixelFormat != PixelFormat::RGB_888 && pixelFormat != PixelFormat::RGBA_8888) {
         return false;
     }
@@ -205,94 +167,71 @@
     return true;
 }
 
-void ReadbackHelper::createReadbackBuffer(uint32_t width, uint32_t height, PixelFormat pixelFormat,
-                                          Dataspace dataspace, sp<GraphicBuffer>* graphicBuffer) {
-    ASSERT_NE(nullptr, graphicBuffer);
-    if (!readbackSupported(pixelFormat, dataspace)) {
-        *graphicBuffer = nullptr;
-    }
-    android::PixelFormat bufferFormat = static_cast<android::PixelFormat>(pixelFormat);
-    uint32_t layerCount = 1;
-    uint64_t usage = static_cast<uint64_t>(static_cast<uint64_t>(BufferUsage::CPU_READ_OFTEN) |
-                                           static_cast<uint64_t>(BufferUsage::GPU_TEXTURE));
-    *graphicBuffer = sp<GraphicBuffer>::make(width, height, bufferFormat, layerCount, usage,
-                                             "ReadbackBuffer");
-    ASSERT_NE(nullptr, *graphicBuffer);
-    ASSERT_EQ(::android::OK, (*graphicBuffer)->initCheck());
-}
-
-void ReadbackHelper::compareColorToBuffer(IComposerClient::Color expectedColor,
-                                          const sp<GraphicBuffer>& graphicBuffer, int32_t fence) {
-    std::vector<IComposerClient::Color> expectedColors(
-            static_cast<size_t>(graphicBuffer->getWidth() * graphicBuffer->getHeight()));
-    ::android::Rect bounds = graphicBuffer->getBounds();
-    fillColorsArea(expectedColors, static_cast<int32_t>(graphicBuffer->getWidth()),
-                   {bounds.left, bounds.top, bounds.right, bounds.bottom}, expectedColor);
-    compareColorsToBuffer(expectedColors, graphicBuffer, fence);
-}
-
-void ReadbackHelper::compareColorsToBuffer(std::vector<IComposerClient::Color>& expectedColors,
-                                           const sp<GraphicBuffer>& graphicBuffer, int32_t fence) {
-    ASSERT_TRUE(graphicBuffer->getPixelFormat() == ::android::PIXEL_FORMAT_RGB_888 ||
-                graphicBuffer->getPixelFormat() == ::android::PIXEL_FORMAT_RGBA_8888);
-
-    int bytesPerPixel = -1;
-    int bytesPerStride = -1;
-    void* bufData = nullptr;
-    status_t status = graphicBuffer->lockAsync(GRALLOC_USAGE_SW_READ_OFTEN, &bufData, fence,
-                                               &bytesPerPixel, &bytesPerStride);
-    ASSERT_EQ(::android::OK, status);
-
-    const uint32_t stride = (bytesPerPixel > 0 && bytesPerStride > 0)
-                                    ? static_cast<uint32_t>(bytesPerStride / bytesPerPixel)
-                                    : graphicBuffer->getStride();
-
-    if (bytesPerPixel == -1) {
-        PixelFormat pixelFormat = static_cast<PixelFormat>(graphicBuffer->getPixelFormat());
-        bytesPerPixel = ReadbackHelper::GetBytesPerPixel(pixelFormat);
-    }
+void ReadbackHelper::compareColorBuffers(std::vector<IComposerClient::Color>& expectedColors,
+                                         void* bufferData, const uint32_t stride,
+                                         const uint32_t width, const uint32_t height,
+                                         const PixelFormat pixelFormat) {
+    const int32_t bytesPerPixel = ReadbackHelper::GetBytesPerPixel(pixelFormat);
     ASSERT_NE(-1, bytesPerPixel);
-    for (int row = 0; row < graphicBuffer->getHeight(); row++) {
-        for (int col = 0; col < graphicBuffer->getWidth(); col++) {
-            int pixel = row * static_cast<int32_t>(graphicBuffer->getWidth()) + col;
-            int offset = (row * static_cast<int32_t>(stride) + col) * bytesPerPixel;
-            uint8_t* pixelColor = (uint8_t*)bufData + offset;
-            const IComposerClient::Color expectedColor = expectedColors[static_cast<size_t>(pixel)];
-            ASSERT_EQ(std::round(255.0f * expectedColor.r), pixelColor[0]);
-            ASSERT_EQ(std::round(255.0f * expectedColor.g), pixelColor[1]);
-            ASSERT_EQ(std::round(255.0f * expectedColor.b), pixelColor[2]);
+    for (int row = 0; row < height; row++) {
+        for (int col = 0; col < width; col++) {
+            int pixel = row * width + col;
+            int offset = (row * stride + col) * bytesPerPixel;
+            uint8_t* pixelColor = (uint8_t*)bufferData + offset;
+
+            ASSERT_EQ(expectedColors[pixel].r, pixelColor[0]);
+            ASSERT_EQ(expectedColors[pixel].g, pixelColor[1]);
+            ASSERT_EQ(expectedColors[pixel].b, pixelColor[2]);
         }
     }
-
-    status = graphicBuffer->unlock();
-    ASSERT_EQ(::android::OK, status);
 }
 
 ReadbackBuffer::ReadbackBuffer(Display display, const std::shared_ptr<ComposerClient>& client,
-                               uint32_t width, uint32_t height, PixelFormat pixelFormat) {
+                               const std::shared_ptr<Gralloc>& gralloc, uint32_t width,
+                               uint32_t height, PixelFormat pixelFormat, Dataspace dataspace) {
     mDisplay = display;
+
     mComposerClient = client;
+    mGralloc = gralloc;
+
+    mPixelFormat = pixelFormat;
+    mDataspace = dataspace;
+
     mWidth = width;
     mHeight = height;
-    mPixelFormat = pixelFormat;
     mLayerCount = 1;
+    mFormat = mPixelFormat;
     mUsage = static_cast<uint64_t>(BufferUsage::CPU_READ_OFTEN | BufferUsage::GPU_TEXTURE);
+
+    mAccessRegion.top = 0;
+    mAccessRegion.left = 0;
+    mAccessRegion.width = width;
+    mAccessRegion.height = height;
 }
 
 void ReadbackBuffer::setReadbackBuffer() {
-    mGraphicBuffer = sp<GraphicBuffer>::make(mWidth, mHeight,
-                                             static_cast<::android::PixelFormat>(mPixelFormat),
-                                             mLayerCount, mUsage, "ReadbackBuffer");
-    ASSERT_NE(nullptr, mGraphicBuffer);
-    ASSERT_EQ(::android::OK, mGraphicBuffer->initCheck());
-    mComposerClient->setReadbackBuffer(mDisplay, mGraphicBuffer->handle, -1 /* fence */);
+    mBufferHandle.reset(new Gralloc::NativeHandleWrapper(
+            mGralloc->allocate(mWidth, mHeight, mLayerCount, mFormat, mUsage,
+                               /*import*/ true, &mStride)));
+    ASSERT_NE(false, mGralloc->validateBufferSize(mBufferHandle->get(), mWidth, mHeight,
+                                                  mLayerCount, mFormat, mUsage, mStride));
+    ASSERT_NO_FATAL_FAILURE(mComposerClient->setReadbackBuffer(mDisplay, mBufferHandle->get(), -1));
 }
 
 void ReadbackBuffer::checkReadbackBuffer(std::vector<IComposerClient::Color> expectedColors) {
     // lock buffer for reading
     int32_t fenceHandle;
     ASSERT_NO_FATAL_FAILURE(mComposerClient->getReadbackBufferFence(mDisplay, &fenceHandle));
-    ReadbackHelper::compareColorsToBuffer(expectedColors, mGraphicBuffer, fenceHandle);
+
+    void* bufData = mGralloc->lock(mBufferHandle->get(), mUsage, mAccessRegion, fenceHandle);
+    ASSERT_TRUE(mPixelFormat == PixelFormat::RGB_888 || mPixelFormat == PixelFormat::RGBA_8888);
+    ReadbackHelper::compareColorBuffers(expectedColors, bufData, mStride, mWidth, mHeight,
+                                        mPixelFormat);
+    int32_t unlockFence = mGralloc->unlock(mBufferHandle->get());
+    if (unlockFence != -1) {
+        sync_wait(unlockFence, -1);
+        close(unlockFence);
+    }
 }
 
 void TestColorLayer::write(const std::shared_ptr<CommandWriterBase>& writer) {
diff --git a/graphics/composer/2.2/utils/vts/RenderEngineVts.cpp b/graphics/composer/2.2/utils/vts/RenderEngineVts.cpp
index 254ff3b..1700b2a 100644
--- a/graphics/composer/2.2/utils/vts/RenderEngineVts.cpp
+++ b/graphics/composer/2.2/utils/vts/RenderEngineVts.cpp
@@ -83,7 +83,9 @@
 void TestRenderEngine::checkColorBuffer(std::vector<V2_2::IComposerClient::Color>& expectedColors) {
     void* bufferData;
     ASSERT_EQ(0, mGraphicBuffer->lock(mGraphicBuffer->getUsage(), &bufferData));
-    ReadbackHelper::compareColorsToBuffer(expectedColors, mGraphicBuffer, -1 /* fence */);
+    ReadbackHelper::compareColorBuffers(expectedColors, bufferData, mGraphicBuffer->getStride(),
+                                        mGraphicBuffer->getWidth(), mGraphicBuffer->getHeight(),
+                                        mFormat);
     ASSERT_EQ(0, mGraphicBuffer->unlock());
 }
 
diff --git a/graphics/composer/2.2/utils/vts/include/composer-vts/2.2/ComposerVts.h b/graphics/composer/2.2/utils/vts/include/composer-vts/2.2/ComposerVts.h
index bbf8ef3..02d7bdb 100644
--- a/graphics/composer/2.2/utils/vts/include/composer-vts/2.2/ComposerVts.h
+++ b/graphics/composer/2.2/utils/vts/include/composer-vts/2.2/ComposerVts.h
@@ -78,10 +78,8 @@
                                     PixelFormat format, Dataspace dataspace);
     void setPowerMode_2_2(Display display, IComposerClient::PowerMode mode);
     void setReadbackBuffer(Display display, const native_handle_t* buffer, int32_t releaseFence);
-    void getRequiredReadbackBufferAttributes(Display display, PixelFormat* outPixelFormat,
-                                             Dataspace* outDataspace);
-    Error getReadbackBufferAttributes(Display display, PixelFormat* outPixelFormat,
-                                      Dataspace* outDataspace);
+    void getReadbackBufferAttributes(Display display, PixelFormat* outPixelFormat,
+                                     Dataspace* outDataspace);
     void getReadbackBufferFence(Display display, int32_t* outFence);
 
     std::vector<ColorMode> getColorModes(Display display);
diff --git a/graphics/composer/2.2/utils/vts/include/composer-vts/2.2/ReadbackVts.h b/graphics/composer/2.2/utils/vts/include/composer-vts/2.2/ReadbackVts.h
index 7100297..58efde9 100644
--- a/graphics/composer/2.2/utils/vts/include/composer-vts/2.2/ReadbackVts.h
+++ b/graphics/composer/2.2/utils/vts/include/composer-vts/2.2/ReadbackVts.h
@@ -34,8 +34,6 @@
 namespace V2_2 {
 namespace vts {
 
-using android::GraphicBuffer;
-using android::sp;
 using android::hardware::hidl_handle;
 using common::V1_1::BufferUsage;
 using common::V1_1::Dataspace;
@@ -158,13 +156,6 @@
 
     static int32_t GetBytesPerPixel(PixelFormat pixelFormat);
 
-    static void fillBufferAndGetFence(const sp<GraphicBuffer>& graphicBuffer,
-                                      IComposerClient::Color desiredColor, int* fillFence);
-
-    static void fillBufferAndGetFence(const sp<GraphicBuffer>& graphicBuffer,
-                                      const std::vector<IComposerClient::Color>& desiredColors,
-                                      int* fillFence);
-
     static void fillBuffer(int32_t width, int32_t height, uint32_t stride, void* bufferData,
                            PixelFormat pixelFormat,
                            std::vector<IComposerClient::Color> desiredPixelColors);
@@ -175,39 +166,40 @@
     static void fillColorsArea(std::vector<IComposerClient::Color>& expectedColors, int32_t stride,
                                IComposerClient::Rect area, IComposerClient::Color color);
 
+    static bool readbackSupported(const PixelFormat& pixelFormat, const Dataspace& dataspace,
+                                  const Error error);
+
     static const std::vector<ColorMode> colorModes;
     static const std::vector<Dataspace> dataspaces;
 
-    static bool readbackSupported(PixelFormat pixelFormat, Dataspace dataspace, Error error);
-    static bool readbackSupported(PixelFormat pixelFormat, Dataspace dataspace);
-
-    static void createReadbackBuffer(uint32_t width, uint32_t height, PixelFormat pixelFormat,
-                                     Dataspace dataspace, sp<GraphicBuffer>* graphicBuffer);
-
-    static void compareColorToBuffer(IComposerClient::Color expectedColors,
-                                     const sp<GraphicBuffer>& graphicBuffer, int32_t fence);
-
-    static void compareColorsToBuffer(std::vector<IComposerClient::Color>& expectedColors,
-                                      const sp<GraphicBuffer>& graphicBuffer, int32_t fence);
+    static void compareColorBuffers(std::vector<IComposerClient::Color>& expectedColors,
+                                    void* bufferData, const uint32_t stride, const uint32_t width,
+                                    const uint32_t height, const PixelFormat pixelFormat);
 };
 
 class ReadbackBuffer {
   public:
-    ReadbackBuffer(Display display, const std::shared_ptr<ComposerClient>& client, uint32_t width,
-                   uint32_t height, PixelFormat pixelFormat);
+    ReadbackBuffer(Display display, const std::shared_ptr<ComposerClient>& client,
+                   const std::shared_ptr<Gralloc>& gralloc, uint32_t width, uint32_t height,
+                   PixelFormat pixelFormat, Dataspace dataspace);
 
     void setReadbackBuffer();
 
     void checkReadbackBuffer(std::vector<IComposerClient::Color> expectedColors);
 
   protected:
-    sp<GraphicBuffer> mGraphicBuffer;
     uint32_t mWidth;
     uint32_t mHeight;
-    PixelFormat mPixelFormat;
     uint32_t mLayerCount;
+    PixelFormat mFormat;
     uint64_t mUsage;
+    AccessRegion mAccessRegion;
+    uint32_t mStride;
+    std::unique_ptr<Gralloc::NativeHandleWrapper> mBufferHandle = nullptr;
+    PixelFormat mPixelFormat;
+    Dataspace mDataspace;
     Display mDisplay;
+    std::shared_ptr<Gralloc> mGralloc;
     std::shared_ptr<ComposerClient> mComposerClient;
 };
 
diff --git a/graphics/composer/2.2/vts/functional/VtsHalGraphicsComposerV2_2ReadbackTest.cpp b/graphics/composer/2.2/vts/functional/VtsHalGraphicsComposerV2_2ReadbackTest.cpp
index 5b8ce3f..e2a0f4d 100644
--- a/graphics/composer/2.2/vts/functional/VtsHalGraphicsComposerV2_2ReadbackTest.cpp
+++ b/graphics/composer/2.2/vts/functional/VtsHalGraphicsComposerV2_2ReadbackTest.cpp
@@ -40,6 +40,7 @@
 namespace {
 
 using android::Rect;
+using common::V1_1::BufferUsage;
 using common::V1_1::Dataspace;
 using common::V1_1::PixelFormat;
 using V2_1::Config;
@@ -99,8 +100,8 @@
 
         mTestRenderEngine->initGraphicBuffer(
                 static_cast<uint32_t>(mDisplayWidth), static_cast<uint32_t>(mDisplayHeight), 1,
-                GRALLOC_USAGE_SW_WRITE_OFTEN | GRALLOC_USAGE_SW_READ_OFTEN |
-                        GRALLOC_USAGE_HW_RENDER);
+                static_cast<uint64_t>(BufferUsage::CPU_READ_OFTEN | BufferUsage::CPU_WRITE_OFTEN |
+                                      BufferUsage::GPU_RENDER_TARGET));
         mTestRenderEngine->setDisplaySettings(clientCompositionDisplay);
     }
 
@@ -115,22 +116,6 @@
         }
     }
 
-    sp<GraphicBuffer> allocateBuffer(uint32_t width, uint32_t height, uint32_t usage) {
-        const auto& graphicBuffer = sp<GraphicBuffer>::make(
-                width, height, android::PIXEL_FORMAT_RGBA_8888,
-                /*layerCount*/ 1u, usage, "VtsHalGraphicsComposer2_2_ReadbackTest");
-
-        if (graphicBuffer && android::OK == graphicBuffer->initCheck()) {
-            return nullptr;
-        }
-        return graphicBuffer;
-    }
-
-    sp<GraphicBuffer> allocateBuffer(uint32_t usage) {
-        return allocateBuffer(static_cast<uint32_t>(mDisplayWidth),
-                              static_cast<uint32_t>(mDisplayHeight), usage);
-    }
-
     void clearCommandReaderState() {
         mReader->mCompositionChanges.clear();
         mReader->mErrors.clear();
@@ -208,9 +193,15 @@
         ASSERT_NO_FATAL_FAILURE(
                 mComposerClient->setColorMode(mPrimaryDisplay, mode, RenderIntent::COLORIMETRIC));
 
-        Error error = mComposerClient->getReadbackBufferAttributes(mPrimaryDisplay, &mPixelFormat,
-                                                                   &mDataspace);
-        mHasReadbackBuffer = ReadbackHelper::readbackSupported(mPixelFormat, mDataspace, error);
+        mComposerClient->getRaw()->getReadbackBufferAttributes(
+                mPrimaryDisplay,
+                [&](const auto& tmpError, const auto& tmpPixelFormat, const auto& tmpDataspace) {
+                    mHasReadbackBuffer = ReadbackHelper::readbackSupported(tmpPixelFormat,
+                                                                           tmpDataspace, tmpError);
+                    mPixelFormat = tmpPixelFormat;
+                    mDataspace = tmpDataspace;
+                });
+
         if (!mHasReadbackBuffer) {
             std::cout << "Readback not supported or unsupported pixelFormat/dataspace" << std::endl;
             GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace";
@@ -229,8 +220,8 @@
         std::vector<IComposerClient::Color> expectedColors(mDisplayWidth * mDisplayHeight);
         ReadbackHelper::fillColorsArea(expectedColors, mDisplayWidth, coloredSquare, BLUE);
 
-        ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mDisplayWidth,
-                                      mDisplayHeight, mPixelFormat);
+        ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mGralloc, mDisplayWidth,
+                                      mDisplayHeight, mPixelFormat, mDataspace);
         ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
 
         writeLayers(layers);
@@ -264,9 +255,15 @@
         ASSERT_NO_FATAL_FAILURE(
                 mComposerClient->setColorMode(mPrimaryDisplay, mode, RenderIntent::COLORIMETRIC));
 
-        Error error = mComposerClient->getReadbackBufferAttributes(mPrimaryDisplay, &mPixelFormat,
-                                                                   &mDataspace);
-        mHasReadbackBuffer = ReadbackHelper::readbackSupported(mPixelFormat, mDataspace, error);
+        mComposerClient->getRaw()->getReadbackBufferAttributes(
+                mPrimaryDisplay,
+                [&](const auto& tmpError, const auto& tmpPixelFormat, const auto& tmpDataspace) {
+                    mHasReadbackBuffer = ReadbackHelper::readbackSupported(tmpPixelFormat,
+                                                                           tmpDataspace, tmpError);
+                    mPixelFormat = tmpPixelFormat;
+                    mDataspace = tmpDataspace;
+                });
+
         if (!mHasReadbackBuffer) {
             std::cout << "Readback not supported or unsupported pixelFormat/dataspace" << std::endl;
             GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace";
@@ -275,8 +272,8 @@
 
         mWriter->selectDisplay(mPrimaryDisplay);
 
-        ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mDisplayWidth,
-                                      mDisplayHeight, mPixelFormat);
+        ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mGralloc, mDisplayWidth,
+                                      mDisplayHeight, mPixelFormat, mDataspace);
         ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
         std::vector<IComposerClient::Color> expectedColors(mDisplayWidth * mDisplayHeight);
         ReadbackHelper::fillColorsArea(expectedColors, mDisplayWidth,
@@ -322,155 +319,6 @@
     }
 }
 
-TEST_P(GraphicsCompositionTest, SetLayerBufferWithSlotsToClear) {
-    Error error = mComposerClient->getReadbackBufferAttributes(mPrimaryDisplay, &mPixelFormat,
-                                                               &mDataspace);
-    if (error == Error::UNSUPPORTED) {
-        GTEST_SUCCEED() << "Readback is unsupported";
-        return;
-    }
-    ASSERT_EQ(Error::NONE, error);
-
-    sp<GraphicBuffer> readbackBuffer;
-    ASSERT_NO_FATAL_FAILURE(ReadbackHelper::createReadbackBuffer(
-            mDisplayWidth, mDisplayHeight, mPixelFormat, mDataspace, &readbackBuffer));
-    if (readbackBuffer == nullptr) {
-        GTEST_SUCCEED() << "Unsupported readback buffer attributes";
-        return;
-    }
-    // no fence needed for the readback buffer
-    int noFence = -1;
-
-    sp<GraphicBuffer> clearSlotBuffer = allocateBuffer(1u, 1u, GRALLOC_USAGE_HW_COMPOSER);
-    ASSERT_NE(nullptr, clearSlotBuffer);
-
-    // red buffer
-    uint32_t usage = GRALLOC_USAGE_SW_WRITE_OFTEN | GRALLOC_USAGE_SW_READ_OFTEN;
-    sp<GraphicBuffer> redBuffer = allocateBuffer(usage);
-    ASSERT_NE(nullptr, redBuffer);
-    int redFence;
-    ASSERT_NO_FATAL_FAILURE(ReadbackHelper::fillBufferAndGetFence(redBuffer, RED, &redFence));
-
-    // blue buffer
-    sp<GraphicBuffer> blueBuffer = allocateBuffer(usage);
-    ASSERT_NE(nullptr, blueBuffer);
-    int blueFence;
-    ASSERT_NO_FATAL_FAILURE(ReadbackHelper::fillBufferAndGetFence(blueBuffer, BLUE, &blueFence));
-
-    // layer defaults
-    IComposerClient::Rect rectFullDisplay = {0, 0, mDisplayWidth, mDisplayHeight};
-    Layer layer = mComposerClient->createLayer(mPrimaryDisplay, 3);
-    mWriter->selectDisplay(mPrimaryDisplay);
-    mWriter->selectLayer(layer);
-    mWriter->setLayerDisplayFrame(rectFullDisplay);
-    mWriter->setLayerCompositionType(IComposerClient::Composition::DEVICE);
-
-    // set the layer to the blue buffer
-    // should be blue
-    {
-        ASSERT_NO_FATAL_FAILURE(mComposerClient->setReadbackBuffer(
-                mPrimaryDisplay, readbackBuffer->handle, noFence));
-        mWriter->selectDisplay(mPrimaryDisplay);
-        mWriter->selectLayer(layer);
-        mWriter->setLayerBuffer(/*slot*/ 0, blueBuffer->handle, blueFence);
-        mWriter->validateDisplay();
-        execute();
-        ASSERT_TRUE(mReader->mCompositionChanges.empty());
-        ASSERT_TRUE(mReader->mErrors.size());
-        mWriter->selectDisplay(mPrimaryDisplay);
-        mWriter->presentDisplay();
-        execute();
-        int32_t fence;
-        ASSERT_NO_FATAL_FAILURE(mComposerClient->getReadbackBufferFence(mPrimaryDisplay, &fence));
-        ASSERT_NO_FATAL_FAILURE(ReadbackHelper::compareColorToBuffer(BLUE, readbackBuffer, fence));
-    }
-
-    // change the layer to the red buffer
-    // should be red
-    {
-        ASSERT_NO_FATAL_FAILURE(mComposerClient->setReadbackBuffer(
-                mPrimaryDisplay, readbackBuffer->handle, noFence));
-        mWriter->selectDisplay(mPrimaryDisplay);
-        mWriter->selectLayer(layer);
-        mWriter->setLayerBuffer(/*slot*/ 1, redBuffer->handle, redFence);
-        mWriter->validateDisplay();
-        execute();
-        ASSERT_TRUE(mReader->mCompositionChanges.empty());
-        ASSERT_TRUE(mReader->mErrors.size());
-        mWriter->selectDisplay(mPrimaryDisplay);
-        mWriter->presentDisplay();
-        execute();
-        int32_t fence;
-        ASSERT_NO_FATAL_FAILURE(mComposerClient->getReadbackBufferFence(mPrimaryDisplay, &fence));
-        ReadbackHelper::compareColorToBuffer(RED, readbackBuffer, fence);
-    }
-
-    // clear the slot for the blue buffer
-    // should still be red
-    {
-        ASSERT_NO_FATAL_FAILURE(mComposerClient->setReadbackBuffer(
-                mPrimaryDisplay, readbackBuffer->handle, noFence));
-        mWriter->selectDisplay(mPrimaryDisplay);
-        mWriter->selectLayer(layer);
-        mWriter->setLayerBuffer(/*slot*/ 0, clearSlotBuffer->handle, /*fence*/ -1);
-        mWriter->validateDisplay();
-        execute();
-        ASSERT_TRUE(mReader->mCompositionChanges.empty());
-        ASSERT_TRUE(mReader->mErrors.size());
-        mWriter->selectDisplay(mPrimaryDisplay);
-        mWriter->presentDisplay();
-        execute();
-        int32_t fence;
-        ASSERT_NO_FATAL_FAILURE(mComposerClient->getReadbackBufferFence(mPrimaryDisplay, &fence));
-        ReadbackHelper::compareColorToBuffer(RED, readbackBuffer, fence);
-    }
-
-    // clear the slot for the red buffer, and set the buffer with the same slot to the blue buffer
-    // should be blue
-    {
-        ASSERT_NO_FATAL_FAILURE(mComposerClient->setReadbackBuffer(
-                mPrimaryDisplay, readbackBuffer->handle, noFence));
-        mWriter->selectDisplay(mPrimaryDisplay);
-        mWriter->selectLayer(layer);
-        mWriter->setLayerBuffer(/*slot*/ 1, clearSlotBuffer->handle, /*fence*/ -1);
-        mWriter->selectDisplay(mPrimaryDisplay);
-        mWriter->selectLayer(layer);
-        mWriter->setLayerBuffer(/*slot*/ 1, blueBuffer->handle, blueFence);
-        mWriter->validateDisplay();
-        execute();
-        ASSERT_TRUE(mReader->mCompositionChanges.empty());
-        ASSERT_TRUE(mReader->mErrors.size());
-        mWriter->selectDisplay(mPrimaryDisplay);
-        mWriter->presentDisplay();
-        execute();
-        int32_t fence;
-        ASSERT_NO_FATAL_FAILURE(mComposerClient->getReadbackBufferFence(mPrimaryDisplay, &fence));
-        ReadbackHelper::compareColorToBuffer(BLUE, readbackBuffer, fence);
-    }
-
-    // clear the slot for the now-blue buffer
-    // should be black (no buffer)
-    // TODO(b/262037933) Ensure we never clear the active buffer's slot with the placeholder buffer
-    // by setting the layer to the color black
-    {
-        ASSERT_NO_FATAL_FAILURE(mComposerClient->setReadbackBuffer(
-                mPrimaryDisplay, readbackBuffer->handle, noFence));
-        mWriter->selectDisplay(mPrimaryDisplay);
-        mWriter->selectLayer(layer);
-        mWriter->setLayerBuffer(/*slot*/ 1, clearSlotBuffer->handle, /*fence*/ -1);
-        mWriter->validateDisplay();
-        execute();
-        ASSERT_TRUE(mReader->mCompositionChanges.empty());
-        ASSERT_TRUE(mReader->mErrors.size());
-        mWriter->selectDisplay(mPrimaryDisplay);
-        mWriter->presentDisplay();
-        execute();
-        int32_t fence;
-        ASSERT_NO_FATAL_FAILURE(mComposerClient->getReadbackBufferFence(mPrimaryDisplay, &fence));
-        ReadbackHelper::compareColorToBuffer(BLACK, readbackBuffer, fence);
-    }
-}
-
 TEST_P(GraphicsCompositionTest, SetLayerBufferNoEffect) {
     for (ColorMode mode : mTestColorModes) {
         std::cout << "---Testing Color Mode " << ReadbackHelper::getColorModeString(mode) << "---"
@@ -479,9 +327,15 @@
         ASSERT_NO_FATAL_FAILURE(
                 mComposerClient->setColorMode(mPrimaryDisplay, mode, RenderIntent::COLORIMETRIC));
 
-        Error error = mComposerClient->getReadbackBufferAttributes(mPrimaryDisplay, &mPixelFormat,
-                                                                   &mDataspace);
-        mHasReadbackBuffer = ReadbackHelper::readbackSupported(mPixelFormat, mDataspace, error);
+        mComposerClient->getRaw()->getReadbackBufferAttributes(
+                mPrimaryDisplay,
+                [&](const auto& tmpError, const auto& tmpPixelFormat, const auto& tmpDataspace) {
+                    mHasReadbackBuffer = ReadbackHelper::readbackSupported(tmpPixelFormat,
+                                                                           tmpDataspace, tmpError);
+                    mPixelFormat = tmpPixelFormat;
+                    mDataspace = tmpDataspace;
+                });
+
         if (!mHasReadbackBuffer) {
             std::cout << "Readback not supported or unsupported pixelFormat/dataspace" << std::endl;
             GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace";
@@ -496,7 +350,8 @@
         layer->write(mWriter);
 
         // This following buffer call should have no effect
-        uint32_t usage = GRALLOC_USAGE_SW_WRITE_OFTEN | GRALLOC_USAGE_SW_READ_OFTEN;
+        uint64_t usage =
+                static_cast<uint64_t>(BufferUsage::CPU_READ_OFTEN | BufferUsage::CPU_WRITE_OFTEN);
         NativeHandleWrapper bufferHandle =
                 mGralloc->allocate(mDisplayWidth, mDisplayHeight, 1, PixelFormat::RGBA_8888, usage);
         mWriter->setLayerBuffer(0, bufferHandle.get(), -1);
@@ -505,8 +360,8 @@
         std::vector<IComposerClient::Color> expectedColors(mDisplayWidth * mDisplayHeight);
         ReadbackHelper::fillColorsArea(expectedColors, mDisplayWidth, coloredSquare, BLUE);
 
-        ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mDisplayWidth,
-                                      mDisplayHeight, mPixelFormat);
+        ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mGralloc, mDisplayWidth,
+                                      mDisplayHeight, mPixelFormat, mDataspace);
         ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
 
         mWriter->validateDisplay();
@@ -537,11 +392,15 @@
         ASSERT_NO_FATAL_FAILURE(
                 mComposerClient->setColorMode(mPrimaryDisplay, mode, RenderIntent::COLORIMETRIC));
 
-        PixelFormat pixelFormat;
-        Dataspace dataspace;
-        Error error = mComposerClient->getReadbackBufferAttributes(mPrimaryDisplay, &pixelFormat,
-                                                                   &dataspace);
-        mHasReadbackBuffer = ReadbackHelper::readbackSupported(pixelFormat, dataspace, error);
+        mComposerClient->getRaw()->getReadbackBufferAttributes(
+                mPrimaryDisplay,
+                [&](const auto& tmpError, const auto& tmpPixelFormat, const auto& tmpDataspace) {
+                    mHasReadbackBuffer = ReadbackHelper::readbackSupported(tmpPixelFormat,
+                                                                           tmpDataspace, tmpError);
+                    mPixelFormat = tmpPixelFormat;
+                    mDataspace = tmpDataspace;
+                });
+
         if (!mHasReadbackBuffer) {
             std::cout << "Readback not supported or unsupported pixelFormat/dataspace" << std::endl;
             GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace";
@@ -569,8 +428,8 @@
 
         std::vector<std::shared_ptr<TestLayer>> layers = {layer};
 
-        ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mDisplayWidth,
-                                      mDisplayHeight, mPixelFormat);
+        ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mGralloc, mDisplayWidth,
+                                      mDisplayHeight, mPixelFormat, mDataspace);
         ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
         writeLayers(layers);
         ASSERT_EQ(0, mReader->mErrors.size());
@@ -582,8 +441,9 @@
             ASSERT_EQ(1, mReader->mCompositionChanges[0].second);
 
             PixelFormat clientFormat = PixelFormat::RGBA_8888;
-            uint32_t clientUsage = GRALLOC_USAGE_SW_WRITE_OFTEN | GRALLOC_USAGE_SW_READ_OFTEN |
-                                   GRALLOC_USAGE_HW_FB;
+            uint64_t clientUsage = static_cast<uint64_t>(BufferUsage::CPU_READ_OFTEN |
+                                                         BufferUsage::CPU_WRITE_OFTEN |
+                                                         BufferUsage::COMPOSER_CLIENT_TARGET);
             Dataspace clientDataspace = ReadbackHelper::getDataspaceForColorMode(mode);
             IComposerClient::Rect damage{0, 0, mDisplayWidth, mDisplayHeight};
 
@@ -650,9 +510,15 @@
         ASSERT_NO_FATAL_FAILURE(
                 mComposerClient->setColorMode(mPrimaryDisplay, mode, RenderIntent::COLORIMETRIC));
 
-        Error error = mComposerClient->getReadbackBufferAttributes(mPrimaryDisplay, &mPixelFormat,
-                                                                   &mDataspace);
-        mHasReadbackBuffer = ReadbackHelper::readbackSupported(mPixelFormat, mDataspace, error);
+        mComposerClient->getRaw()->getReadbackBufferAttributes(
+                mPrimaryDisplay,
+                [&](const auto& tmpError, const auto& tmpPixelFormat, const auto& tmpDataspace) {
+                    mHasReadbackBuffer = ReadbackHelper::readbackSupported(tmpPixelFormat,
+                                                                           tmpDataspace, tmpError);
+                    mPixelFormat = tmpPixelFormat;
+                    mDataspace = tmpDataspace;
+                });
+
         if (!mHasReadbackBuffer) {
             std::cout << "Readback not supported or unsupported pixelFormat/dataspace" << std::endl;
             GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace";
@@ -665,8 +531,8 @@
         ReadbackHelper::fillColorsArea(expectedColors, mDisplayWidth,
                                        {0, mDisplayHeight / 2, mDisplayWidth, mDisplayHeight}, RED);
 
-        ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mDisplayWidth,
-                                      mDisplayHeight, mPixelFormat);
+        ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mGralloc, mDisplayWidth,
+                                      mDisplayHeight, mPixelFormat, mDataspace);
         ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
 
         auto deviceLayer = std::make_shared<TestBufferLayer>(
@@ -686,8 +552,9 @@
         deviceLayer->write(mWriter);
 
         PixelFormat clientFormat = PixelFormat::RGBA_8888;
-        uint32_t clientUsage =
-                GRALLOC_USAGE_SW_WRITE_OFTEN | GRALLOC_USAGE_SW_READ_OFTEN | GRALLOC_USAGE_HW_FB;
+        uint64_t clientUsage =
+                static_cast<uint64_t>(BufferUsage::CPU_READ_OFTEN | BufferUsage::CPU_WRITE_OFTEN |
+                                      BufferUsage::COMPOSER_CLIENT_TARGET);
         Dataspace clientDataspace = ReadbackHelper::getDataspaceForColorMode(mode);
         int32_t clientWidth = mDisplayWidth;
         int32_t clientHeight = mDisplayHeight / 2;
@@ -766,9 +633,15 @@
         ASSERT_NO_FATAL_FAILURE(
                 mComposerClient->setColorMode(mPrimaryDisplay, mode, RenderIntent::COLORIMETRIC));
 
-        Error error = mComposerClient->getReadbackBufferAttributes(mPrimaryDisplay, &mPixelFormat,
-                                                                   &mDataspace);
-        mHasReadbackBuffer = ReadbackHelper::readbackSupported(mPixelFormat, mDataspace, error);
+        mComposerClient->getRaw()->getReadbackBufferAttributes(
+                mPrimaryDisplay,
+                [&](const auto& tmpError, const auto& tmpPixelFormat, const auto& tmpDataspace) {
+                    mHasReadbackBuffer = ReadbackHelper::readbackSupported(tmpPixelFormat,
+                                                                           tmpDataspace, tmpError);
+                    mPixelFormat = tmpPixelFormat;
+                    mDataspace = tmpDataspace;
+                });
+
         if (!mHasReadbackBuffer) {
             std::cout << "Readback not supported or unsupported pixelFormat/dataspace" << std::endl;
             GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace";
@@ -792,8 +665,8 @@
 
         std::vector<std::shared_ptr<TestLayer>> layers = {layer};
 
-        ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mDisplayWidth,
-                                      mDisplayHeight, mPixelFormat);
+        ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mGralloc, mDisplayWidth,
+                                      mDisplayHeight, mPixelFormat, mDataspace);
         ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
 
         writeLayers(layers);
@@ -845,9 +718,15 @@
         ASSERT_NO_FATAL_FAILURE(
                 mComposerClient->setColorMode(mPrimaryDisplay, mode, RenderIntent::COLORIMETRIC));
 
-        Error error = mComposerClient->getReadbackBufferAttributes(mPrimaryDisplay, &mPixelFormat,
-                                                                   &mDataspace);
-        mHasReadbackBuffer = ReadbackHelper::readbackSupported(mPixelFormat, mDataspace, error);
+        mComposerClient->getRaw()->getReadbackBufferAttributes(
+                mPrimaryDisplay,
+                [&](const auto& tmpError, const auto& tmpPixelFormat, const auto& tmpDataspace) {
+                    mHasReadbackBuffer = ReadbackHelper::readbackSupported(tmpPixelFormat,
+                                                                           tmpDataspace, tmpError);
+                    mPixelFormat = tmpPixelFormat;
+                    mDataspace = tmpDataspace;
+                });
+
         if (!mHasReadbackBuffer) {
             std::cout << "Readback not supported or unsupported pixelFormat/dataspace" << std::endl;
             GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace";
@@ -863,8 +742,8 @@
 
         std::vector<std::shared_ptr<TestLayer>> layers = {layer};
 
-        ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mDisplayWidth,
-                                      mDisplayHeight, mPixelFormat);
+        ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mGralloc, mDisplayWidth,
+                                      mDisplayHeight, mPixelFormat, mDataspace);
 
         ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
 
@@ -900,9 +779,15 @@
         ASSERT_NO_FATAL_FAILURE(
                 mComposerClient->setColorMode(mPrimaryDisplay, mode, RenderIntent::COLORIMETRIC));
 
-        Error error = mComposerClient->getReadbackBufferAttributes(mPrimaryDisplay, &mPixelFormat,
-                                                                   &mDataspace);
-        mHasReadbackBuffer = ReadbackHelper::readbackSupported(mPixelFormat, mDataspace, error);
+        mComposerClient->getRaw()->getReadbackBufferAttributes(
+                mPrimaryDisplay,
+                [&](const auto& tmpError, const auto& tmpPixelFormat, const auto& tmpDataspace) {
+                    mHasReadbackBuffer = ReadbackHelper::readbackSupported(tmpPixelFormat,
+                                                                           tmpDataspace, tmpError);
+                    mPixelFormat = tmpPixelFormat;
+                    mDataspace = tmpDataspace;
+                });
+
         if (!mHasReadbackBuffer) {
             std::cout << "Readback not supported or unsupported pixelFormat/dataspace" << std::endl;
             GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace";
@@ -934,8 +819,8 @@
         // update expected colors to match crop
         ReadbackHelper::fillColorsArea(expectedColors, mDisplayWidth,
                                        {0, 0, mDisplayWidth, mDisplayHeight}, BLUE);
-        ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mDisplayWidth,
-                                      mDisplayHeight, mPixelFormat);
+        ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mGralloc, mDisplayWidth,
+                                      mDisplayHeight, mPixelFormat, mDataspace);
         ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
         writeLayers(layers);
         ASSERT_EQ(0, mReader->mErrors.size());
@@ -965,9 +850,15 @@
         ASSERT_NO_FATAL_FAILURE(
                 mComposerClient->setColorMode(mPrimaryDisplay, mode, RenderIntent::COLORIMETRIC));
 
-        Error error = mComposerClient->getReadbackBufferAttributes(mPrimaryDisplay, &mPixelFormat,
-                                                                   &mDataspace);
-        mHasReadbackBuffer = ReadbackHelper::readbackSupported(mPixelFormat, mDataspace, error);
+        mComposerClient->getRaw()->getReadbackBufferAttributes(
+                mPrimaryDisplay,
+                [&](const auto& tmpError, const auto& tmpPixelFormat, const auto& tmpDataspace) {
+                    mHasReadbackBuffer = ReadbackHelper::readbackSupported(tmpPixelFormat,
+                                                                           tmpDataspace, tmpError);
+                    mPixelFormat = tmpPixelFormat;
+                    mDataspace = tmpDataspace;
+                });
+
         if (!mHasReadbackBuffer) {
             std::cout << "Readback not supported or unsupported pixelFormat/dataspace" << std::endl;
             GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace";
@@ -995,8 +886,8 @@
         ReadbackHelper::fillColorsArea(expectedColors, mDisplayWidth, blueRect, BLUE);
         ReadbackHelper::fillColorsArea(expectedColors, mDisplayWidth, redRect, RED);
 
-        ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mDisplayWidth,
-                                      mDisplayHeight, mPixelFormat);
+        ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mGralloc, mDisplayWidth,
+                                      mDisplayHeight, mPixelFormat, mDataspace);
         ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
 
         writeLayers(layers);
@@ -1128,9 +1019,15 @@
         ASSERT_NO_FATAL_FAILURE(
                 mComposerClient->setColorMode(mPrimaryDisplay, mode, RenderIntent::COLORIMETRIC));
 
-        Error error = mComposerClient->getReadbackBufferAttributes(mPrimaryDisplay, &mPixelFormat,
-                                                                   &mDataspace);
-        mHasReadbackBuffer = ReadbackHelper::readbackSupported(mPixelFormat, mDataspace, error);
+        mComposerClient->getRaw()->getReadbackBufferAttributes(
+                mPrimaryDisplay,
+                [&](const auto& tmpError, const auto& tmpPixelFormat, const auto& tmpDataspace) {
+                    mHasReadbackBuffer = ReadbackHelper::readbackSupported(tmpPixelFormat,
+                                                                           tmpDataspace, tmpError);
+                    mPixelFormat = tmpPixelFormat;
+                    mDataspace = tmpDataspace;
+                });
+
         if (!mHasReadbackBuffer) {
             std::cout << "Readback not supported or unsupported pixelFormat/dataspace" << std::endl;
             GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace";
@@ -1146,8 +1043,8 @@
         setUpLayers(IComposerClient::BlendMode::NONE);
         setExpectedColors(expectedColors);
 
-        ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mDisplayWidth,
-                                      mDisplayHeight, mPixelFormat);
+        ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mGralloc, mDisplayWidth,
+                                      mDisplayHeight, mPixelFormat, mDataspace);
         ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
         writeLayers(mLayers);
         ASSERT_EQ(0, mReader->mErrors.size());
@@ -1180,9 +1077,15 @@
         ASSERT_NO_FATAL_FAILURE(
                 mComposerClient->setColorMode(mPrimaryDisplay, mode, RenderIntent::COLORIMETRIC));
 
-        Error error = mComposerClient->getReadbackBufferAttributes(mPrimaryDisplay, &mPixelFormat,
-                                                                   &mDataspace);
-        mHasReadbackBuffer = ReadbackHelper::readbackSupported(mPixelFormat, mDataspace, error);
+        mComposerClient->getRaw()->getReadbackBufferAttributes(
+                mPrimaryDisplay,
+                [&](const auto& tmpError, const auto& tmpPixelFormat, const auto& tmpDataspace) {
+                    mHasReadbackBuffer = ReadbackHelper::readbackSupported(tmpPixelFormat,
+                                                                           tmpDataspace, tmpError);
+                    mPixelFormat = tmpPixelFormat;
+                    mDataspace = tmpDataspace;
+                });
+
         if (!mHasReadbackBuffer) {
             std::cout << "Readback not supported or unsupported pixelFormat/dataspace" << std::endl;
             GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace";
@@ -1199,8 +1102,8 @@
         setUpLayers(IComposerClient::BlendMode::COVERAGE);
         setExpectedColors(expectedColors);
 
-        ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mDisplayWidth,
-                                      mDisplayHeight, mPixelFormat);
+        ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mGralloc, mDisplayWidth,
+                                      mDisplayHeight, mPixelFormat, mDataspace);
         ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
         writeLayers(mLayers);
         ASSERT_EQ(0, mReader->mErrors.size());
@@ -1227,9 +1130,15 @@
         ASSERT_NO_FATAL_FAILURE(
                 mComposerClient->setColorMode(mPrimaryDisplay, mode, RenderIntent::COLORIMETRIC));
 
-        Error error = mComposerClient->getReadbackBufferAttributes(mPrimaryDisplay, &mPixelFormat,
-                                                                   &mDataspace);
-        mHasReadbackBuffer = ReadbackHelper::readbackSupported(mPixelFormat, mDataspace, error);
+        mComposerClient->getRaw()->getReadbackBufferAttributes(
+                mPrimaryDisplay,
+                [&](const auto& tmpError, const auto& tmpPixelFormat, const auto& tmpDataspace) {
+                    mHasReadbackBuffer = ReadbackHelper::readbackSupported(tmpPixelFormat,
+                                                                           tmpDataspace, tmpError);
+                    mPixelFormat = tmpPixelFormat;
+                    mDataspace = tmpDataspace;
+                });
+
         if (!mHasReadbackBuffer) {
             std::cout << "Readback not supported or unsupported pixelFormat/dataspace" << std::endl;
             GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace";
@@ -1244,8 +1153,8 @@
         setUpLayers(IComposerClient::BlendMode::PREMULTIPLIED);
         setExpectedColors(expectedColors);
 
-        ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mDisplayWidth,
-                                      mDisplayHeight, mPixelFormat);
+        ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mGralloc, mDisplayWidth,
+                                      mDisplayHeight, mPixelFormat, mDataspace);
         ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
         writeLayers(mLayers);
         ASSERT_EQ(0, mReader->mErrors.size());
@@ -1313,16 +1222,22 @@
         ASSERT_NO_FATAL_FAILURE(
                 mComposerClient->setColorMode(mPrimaryDisplay, mode, RenderIntent::COLORIMETRIC));
 
-        Error error = mComposerClient->getReadbackBufferAttributes(mPrimaryDisplay, &mPixelFormat,
-                                                                   &mDataspace);
-        mHasReadbackBuffer = ReadbackHelper::readbackSupported(mPixelFormat, mDataspace, error);
+        mComposerClient->getRaw()->getReadbackBufferAttributes(
+                mPrimaryDisplay,
+                [&](const auto& tmpError, const auto& tmpPixelFormat, const auto& tmpDataspace) {
+                    mHasReadbackBuffer = ReadbackHelper::readbackSupported(tmpPixelFormat,
+                                                                           tmpDataspace, tmpError);
+                    mPixelFormat = tmpPixelFormat;
+                    mDataspace = tmpDataspace;
+                });
+
         if (!mHasReadbackBuffer) {
             std::cout << "Readback not supported or unsupported pixelFormat/dataspace" << std::endl;
             GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace";
             return;
         }
-        ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mDisplayWidth,
-                                      mDisplayHeight, mPixelFormat);
+        ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mGralloc, mDisplayWidth,
+                                      mDisplayHeight, mPixelFormat, mDataspace);
         ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
         mLayer->setTransform(Transform::FLIP_H);
         mLayer->setDataspace(ReadbackHelper::getDataspaceForColorMode(mode), mWriter);
@@ -1362,16 +1277,22 @@
         ASSERT_NO_FATAL_FAILURE(
                 mComposerClient->setColorMode(mPrimaryDisplay, mode, RenderIntent::COLORIMETRIC));
 
-        Error error = mComposerClient->getReadbackBufferAttributes(mPrimaryDisplay, &mPixelFormat,
-                                                                   &mDataspace);
-        mHasReadbackBuffer = ReadbackHelper::readbackSupported(mPixelFormat, mDataspace, error);
+        mComposerClient->getRaw()->getReadbackBufferAttributes(
+                mPrimaryDisplay,
+                [&](const auto& tmpError, const auto& tmpPixelFormat, const auto& tmpDataspace) {
+                    mHasReadbackBuffer = ReadbackHelper::readbackSupported(tmpPixelFormat,
+                                                                           tmpDataspace, tmpError);
+                    mPixelFormat = tmpPixelFormat;
+                    mDataspace = tmpDataspace;
+                });
+
         if (!mHasReadbackBuffer) {
             std::cout << "Readback not supported or unsupported pixelFormat/dataspace" << std::endl;
             GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace";
             return;
         }
-        ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mDisplayWidth,
-                                      mDisplayHeight, mPixelFormat);
+        ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mGralloc, mDisplayWidth,
+                                      mDisplayHeight, mPixelFormat, mDataspace);
         ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
 
         mLayer->setTransform(Transform::FLIP_V);
@@ -1411,16 +1332,22 @@
         ASSERT_NO_FATAL_FAILURE(
                 mComposerClient->setColorMode(mPrimaryDisplay, mode, RenderIntent::COLORIMETRIC));
 
-        Error error = mComposerClient->getReadbackBufferAttributes(mPrimaryDisplay, &mPixelFormat,
-                                                                   &mDataspace);
-        mHasReadbackBuffer = ReadbackHelper::readbackSupported(mPixelFormat, mDataspace, error);
+        mComposerClient->getRaw()->getReadbackBufferAttributes(
+                mPrimaryDisplay,
+                [&](const auto& tmpError, const auto& tmpPixelFormat, const auto& tmpDataspace) {
+                    mHasReadbackBuffer = ReadbackHelper::readbackSupported(tmpPixelFormat,
+                                                                           tmpDataspace, tmpError);
+                    mPixelFormat = tmpPixelFormat;
+                    mDataspace = tmpDataspace;
+                });
+
         if (!mHasReadbackBuffer) {
             std::cout << "Readback not supported or unsupported pixelFormat/dataspace" << std::endl;
             GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace";
             return;
         }
-        ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mDisplayWidth,
-                                      mDisplayHeight, mPixelFormat);
+        ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mGralloc, mDisplayWidth,
+                                      mDisplayHeight, mPixelFormat, mDataspace);
         ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
 
         mLayer->setTransform(Transform::ROT_180);
diff --git a/graphics/composer/2.2/vts/functional/VtsHalGraphicsComposerV2_2TargetTest.cpp b/graphics/composer/2.2/vts/functional/VtsHalGraphicsComposerV2_2TargetTest.cpp
index f8fbb04..13ae089 100644
--- a/graphics/composer/2.2/vts/functional/VtsHalGraphicsComposerV2_2TargetTest.cpp
+++ b/graphics/composer/2.2/vts/functional/VtsHalGraphicsComposerV2_2TargetTest.cpp
@@ -23,7 +23,6 @@
 #include <composer-vts/2.1/TestCommandReader.h>
 #include <composer-vts/2.2/ComposerVts.h>
 #include <gtest/gtest.h>
-#include <hardware/gralloc.h>
 #include <hidl/GtestPrinter.h>
 #include <hidl/ServiceManagement.h>
 #include <mapper-vts/2.0/MapperVts.h>
@@ -36,6 +35,7 @@
 namespace vts {
 namespace {
 
+using common::V1_0::BufferUsage;
 using common::V1_1::ColorMode;
 using common::V1_1::Dataspace;
 using common::V1_1::PixelFormat;
@@ -65,13 +65,17 @@
         mComposerClient->setVsyncEnabled(mPrimaryDisplay, false);
         mComposerCallback->setVsyncAllowed(false);
 
-        Error error = mComposerClient->getReadbackBufferAttributes(
-                mPrimaryDisplay, &mReadbackPixelFormat, &mReadbackDataspace);
-        mHasReadbackBuffer = error == Error::NONE;
-        if (mHasReadbackBuffer) {
-            ASSERT_LT(static_cast<PixelFormat>(0), mReadbackPixelFormat);
-            ASSERT_NE(Dataspace::UNKNOWN, mReadbackDataspace);
-        }
+        mComposerClient->getRaw()->getReadbackBufferAttributes(
+                mPrimaryDisplay,
+                [&](const auto& tmpError, const auto& tmpPixelFormat, const auto& tmpDataspace) {
+                    mHasReadbackBuffer = tmpError == Error::NONE;
+                    if (mHasReadbackBuffer) {
+                        mReadbackPixelFormat = tmpPixelFormat;
+                        mReadbackDataspace = tmpDataspace;
+                        ASSERT_LT(static_cast<PixelFormat>(0), mReadbackPixelFormat);
+                        ASSERT_NE(Dataspace::UNKNOWN, mReadbackDataspace);
+                    }
+                });
 
         mInvalidDisplayId = GetInvalidDisplayId();
     }
@@ -149,9 +153,10 @@
     }
 
     NativeHandleWrapper allocate() {
+        uint64_t usage =
+                static_cast<uint64_t>(BufferUsage::CPU_WRITE_OFTEN | BufferUsage::CPU_READ_OFTEN);
         return mGralloc->allocate(/*width*/ 64, /*height*/ 64, /*layerCount*/ 1,
-                                  PixelFormat::RGBA_8888,
-                                  GRALLOC_USAGE_SW_WRITE_OFTEN | GRALLOC_USAGE_SW_READ_OFTEN);
+                                  PixelFormat::RGBA_8888, usage);
     }
 
     void execute() { mComposerClient->execute(mReader.get(), mWriter.get()); }
@@ -429,7 +434,9 @@
     }
 
     // BufferUsage::COMPOSER_OUTPUT is missing
-    uint64_t usage = GRALLOC_USAGE_HW_COMPOSER | GRALLOC_USAGE_SW_READ_OFTEN;
+    uint64_t usage =
+            static_cast<uint64_t>(BufferUsage::COMPOSER_OVERLAY | BufferUsage::CPU_READ_OFTEN);
+
     std::unique_ptr<Gralloc> gralloc;
     std::unique_ptr<NativeHandleWrapper> buffer;
     ASSERT_NO_FATAL_FAILURE(gralloc = std::make_unique<Gralloc>());
@@ -450,7 +457,9 @@
         return;
     }
 
-    uint64_t usage = GRALLOC_USAGE_HW_COMPOSER | GRALLOC_USAGE_SW_READ_OFTEN;
+    uint64_t usage =
+            static_cast<uint64_t>(BufferUsage::COMPOSER_OVERLAY | BufferUsage::CPU_READ_OFTEN);
+
     std::unique_ptr<Gralloc> gralloc;
     std::unique_ptr<NativeHandleWrapper> buffer;
     ASSERT_NO_FATAL_FAILURE(gralloc = std::make_unique<Gralloc>());
@@ -702,4 +711,4 @@
     }
 
     return RUN_ALL_TESTS();
-}
\ No newline at end of file
+}
diff --git a/graphics/composer/2.3/utils/hal/include/composer-hal/2.3/ComposerCommandEngine.h b/graphics/composer/2.3/utils/hal/include/composer-hal/2.3/ComposerCommandEngine.h
index 02f6212..f1d61f8 100644
--- a/graphics/composer/2.3/utils/hal/include/composer-hal/2.3/ComposerCommandEngine.h
+++ b/graphics/composer/2.3/utils/hal/include/composer-hal/2.3/ComposerCommandEngine.h
@@ -73,9 +73,7 @@
     }
 
     bool executeSetLayerPerFrameMetadataBlobs(uint16_t length) {
-        // must have at least one metadata blob
-        // of at least size 1 in queue (i.e {/*numBlobs=*/1, key, size, blob})
-        if (length < 4) {
+        if (length == 0) {
             return false;
         }
 
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/Capability.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/Capability.aidl
index b89f7d5..6e844ef 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/Capability.aidl
+++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/Capability.aidl
@@ -38,6 +38,10 @@
   SIDEBAND_STREAM = 1,
   SKIP_CLIENT_COLOR_TRANSFORM = 2,
   PRESENT_FENCE_IS_NOT_RELIABLE = 3,
+  /**
+   * @deprecated - enabled by default.
+   */
   SKIP_VALIDATE = 4,
   BOOT_DISPLAY_CONFIG = 5,
+  HDR_OUTPUT_CONVERSION_CONFIG = 6,
 }
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/DisplayRequest.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/DisplayRequest.aidl
index 13462ce..00598eb 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/DisplayRequest.aidl
+++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/DisplayRequest.aidl
@@ -37,12 +37,12 @@
   long display;
   int mask;
   android.hardware.graphics.composer3.DisplayRequest.LayerRequest[] layerRequests;
-  const int FLIP_CLIENT_TARGET = 1;
-  const int WRITE_CLIENT_TARGET_TO_OUTPUT = 2;
+  const int FLIP_CLIENT_TARGET = (1 << 0);
+  const int WRITE_CLIENT_TARGET_TO_OUTPUT = (1 << 1);
   @VintfStability
   parcelable LayerRequest {
     long layer;
     int mask;
-    const int CLEAR_CLIENT_TARGET = 1;
+    const int CLEAR_CLIENT_TARGET = (1 << 0);
   }
 }
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/FormatColorComponent.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/FormatColorComponent.aidl
index 4b737de..1990350 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/FormatColorComponent.aidl
+++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/FormatColorComponent.aidl
@@ -34,8 +34,8 @@
 package android.hardware.graphics.composer3;
 @Backing(type="byte") @VintfStability
 enum FormatColorComponent {
-  FORMAT_COMPONENT_0 = 1,
-  FORMAT_COMPONENT_1 = 2,
-  FORMAT_COMPONENT_2 = 4,
-  FORMAT_COMPONENT_3 = 8,
+  FORMAT_COMPONENT_0 = (1 << 0),
+  FORMAT_COMPONENT_1 = (1 << 1),
+  FORMAT_COMPONENT_2 = (1 << 2),
+  FORMAT_COMPONENT_3 = (1 << 3),
 }
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/IComposerClient.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/IComposerClient.aidl
index a7e6535..10ce067 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/IComposerClient.aidl
+++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/IComposerClient.aidl
@@ -76,6 +76,8 @@
   void setVsyncEnabled(long display, boolean enabled);
   void setIdleTimerEnabled(long display, int timeoutMs);
   android.hardware.graphics.composer3.OverlayProperties getOverlaySupport();
+  android.hardware.graphics.common.HdrConversionCapability[] getHdrConversionCapabilities();
+  void setHdrConversionStrategy(in android.hardware.graphics.common.HdrConversionStrategy conversionStrategy);
   const int EX_BAD_CONFIG = 1;
   const int EX_BAD_DISPLAY = 2;
   const int EX_BAD_LAYER = 3;
@@ -86,5 +88,5 @@
   const int EX_UNSUPPORTED = 8;
   const int EX_SEAMLESS_NOT_ALLOWED = 9;
   const int EX_SEAMLESS_NOT_POSSIBLE = 10;
-  const int INVALID_CONFIGURATION = 2147483647;
+  const int INVALID_CONFIGURATION = 0x7fffffff;
 }
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/OverlayProperties.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/OverlayProperties.aidl
index 3db134e..7d31ea3 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/OverlayProperties.aidl
+++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/OverlayProperties.aidl
@@ -38,6 +38,8 @@
   boolean supportMixedColorSpaces;
   parcelable SupportedBufferCombinations {
     android.hardware.graphics.common.PixelFormat[] pixelFormats;
-    android.hardware.graphics.common.Dataspace[] dataspaces;
+    android.hardware.graphics.common.Dataspace[] standards;
+    android.hardware.graphics.common.Dataspace[] transfers;
+    android.hardware.graphics.common.Dataspace[] ranges;
   }
 }
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/PerFrameMetadataKey.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/PerFrameMetadataKey.aidl
index 8722f87..10a7dee 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/PerFrameMetadataKey.aidl
+++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/PerFrameMetadataKey.aidl
@@ -34,17 +34,17 @@
 package android.hardware.graphics.composer3;
 @Backing(type="int") @VintfStability
 enum PerFrameMetadataKey {
-  DISPLAY_RED_PRIMARY_X = 0,
-  DISPLAY_RED_PRIMARY_Y = 1,
-  DISPLAY_GREEN_PRIMARY_X = 2,
-  DISPLAY_GREEN_PRIMARY_Y = 3,
-  DISPLAY_BLUE_PRIMARY_X = 4,
-  DISPLAY_BLUE_PRIMARY_Y = 5,
-  WHITE_POINT_X = 6,
-  WHITE_POINT_Y = 7,
-  MAX_LUMINANCE = 8,
-  MIN_LUMINANCE = 9,
-  MAX_CONTENT_LIGHT_LEVEL = 10,
-  MAX_FRAME_AVERAGE_LIGHT_LEVEL = 11,
-  HDR10_PLUS_SEI = 12,
+  DISPLAY_RED_PRIMARY_X,
+  DISPLAY_RED_PRIMARY_Y,
+  DISPLAY_GREEN_PRIMARY_X,
+  DISPLAY_GREEN_PRIMARY_Y,
+  DISPLAY_BLUE_PRIMARY_X,
+  DISPLAY_BLUE_PRIMARY_Y,
+  WHITE_POINT_X,
+  WHITE_POINT_Y,
+  MAX_LUMINANCE,
+  MIN_LUMINANCE,
+  MAX_CONTENT_LIGHT_LEVEL,
+  MAX_FRAME_AVERAGE_LIGHT_LEVEL,
+  HDR10_PLUS_SEI,
 }
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/PresentOrValidate.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/PresentOrValidate.aidl
index e6ddeba..dbfac22 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/PresentOrValidate.aidl
+++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/PresentOrValidate.aidl
@@ -38,7 +38,7 @@
   android.hardware.graphics.composer3.PresentOrValidate.Result result;
   @VintfStability
   enum Result {
-    Validated = 0,
-    Presented = 1,
+    Validated,
+    Presented,
   }
 }
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/Capability.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/Capability.aidl
index 2f9eab9..509a8f4 100644
--- a/graphics/composer/aidl/android/hardware/graphics/composer3/Capability.aidl
+++ b/graphics/composer/aidl/android/hardware/graphics/composer3/Capability.aidl
@@ -55,6 +55,7 @@
      * For this capability to be worthwhile the device implementation of
      * presentDisplay should fail as fast as possible in the case a
      * validateDisplay step is needed.
+     * @deprecated - enabled by default.
      */
     SKIP_VALIDATE = 4,
 
@@ -66,4 +67,12 @@
      * @see IComposerClient.getPreferredBootDisplayConfig
      */
     BOOT_DISPLAY_CONFIG = 5,
+
+    /**
+     * Specifies that the device supports HDR output conversion.
+     *
+     * @see IComposerClient.getHdrConversionCapabilities
+     * @see IComposerClient.setHdrConversionStrategy
+     */
+    HDR_OUTPUT_CONVERSION_CONFIG = 6,
 }
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl
index 88bb3a4..8091491 100644
--- a/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl
+++ b/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl
@@ -17,6 +17,8 @@
 package android.hardware.graphics.composer3;
 
 import android.hardware.graphics.common.DisplayDecorationSupport;
+import android.hardware.graphics.common.HdrConversionCapability;
+import android.hardware.graphics.common.HdrConversionStrategy;
 import android.hardware.graphics.common.Transform;
 import android.hardware.graphics.composer3.ClientTargetProperty;
 import android.hardware.graphics.composer3.ColorMode;
@@ -825,4 +827,25 @@
      * @return the overlay properties of the device.
      */
     OverlayProperties getOverlaySupport();
+
+    /**
+     * Returns the array of HDR conversion capability. Each HdrConversionCapability depicts that
+     * HDR conversion is possible from sourceType to outputType. This doesn't change after
+     * initialization.
+     *
+     * @exception EX_UNSUPPORTED when not supported by the underlying HAL
+     *
+     * @see setHdrConversionStrategy
+     */
+    HdrConversionCapability[] getHdrConversionCapabilities();
+
+    /**
+     * Sets the of HDR conversion strategy.
+     *
+     *
+     * @exception EX_UNSUPPORTED when not supported by the underlying HAL
+     *
+     * @see getHdrConversionCapabilities
+     */
+    void setHdrConversionStrategy(in HdrConversionStrategy conversionStrategy);
 }
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/OverlayProperties.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/OverlayProperties.aidl
index 32688e2..c25eea4 100644
--- a/graphics/composer/aidl/android/hardware/graphics/composer3/OverlayProperties.aidl
+++ b/graphics/composer/aidl/android/hardware/graphics/composer3/OverlayProperties.aidl
@@ -19,16 +19,24 @@
 @VintfStability
 parcelable OverlayProperties {
     parcelable SupportedBufferCombinations {
-        // List of pixelformats and dataspaces that can be used together.
-        // All pixelformats and dataspaces stored inside are valid combinations.
+        // List of pixelformats, standards, transfers and ranges dataspaces that can be used
+        // together.
+        // The pixelformats, standards, transfers and ranges stored inside are valid
+        // combinations.
+        // Dataspace identifies three components of colors - standard, transfer and
+        // range.
         android.hardware.graphics.common.PixelFormat[] pixelFormats;
-        android.hardware.graphics.common.Dataspace[] dataspaces;
+        android.hardware.graphics.common.Dataspace[] standards;
+        android.hardware.graphics.common.Dataspace[] transfers;
+        android.hardware.graphics.common.Dataspace[] ranges;
     }
-    // Array of all valid pixelformat and dataspace combinations.
-    // If all supported formats work with all supported dataspaces,
+    // Array of all valid pixelformat, standard, transfer and range combinations.
+    // If all supported formats work with all standards, transfers and ranges,
     // then this list may only have 1 entry.
-    // If some dataspaces, e.g. scRGB, only work with specific formats,
-    // then this list may contain more than 1 entry.
+    // If some dataspaces, e.g. scRGB (STANDARD_BT709 | TRANSFER_SRGB | RANGE_EXTENDED),
+    // only work with specific formats, then this list may contain more than 1 entry.
+    // If some ranges, e.g. RANGE_LIMITED, only work with specific
+    // formats/standards/transfers, then this list may contain more than 1 entry.
     SupportedBufferCombinations[] combinations;
 
     // True if the DPU is able to color manage at least two overlays
diff --git a/graphics/composer/aidl/vts/ReadbackVts.cpp b/graphics/composer/aidl/vts/ReadbackVts.cpp
index b59793f..abb58e2 100644
--- a/graphics/composer/aidl/vts/ReadbackVts.cpp
+++ b/graphics/composer/aidl/vts/ReadbackVts.cpp
@@ -20,8 +20,6 @@
 #include "renderengine/ExternalTexture.h"
 #include "renderengine/impl/ExternalTexture.h"
 
-using ::android::status_t;
-
 namespace aidl::android::hardware::graphics::composer3::vts {
 
 const std::vector<ColorMode> ReadbackHelper::colorModes = {ColorMode::SRGB, ColorMode::DISPLAY_P3};
@@ -29,9 +27,6 @@
                                                            common::Dataspace::DISPLAY_P3};
 
 void TestLayer::write(ComposerClientWriter& writer) {
-    ::android::status_t status = ::android::OK;
-    ASSERT_EQ(::android::OK, status);
-
     writer.setLayerDisplayFrame(mDisplay, mLayer, mDisplayFrame);
     writer.setLayerSourceCrop(mDisplay, mLayer, mSourceCrop);
     writer.setLayerZOrder(mDisplay, mLayer, mZOrder);
@@ -42,40 +37,6 @@
     writer.setLayerBrightness(mDisplay, mLayer, mBrightness);
 }
 
-bool ReadbackHelper::readbackSupported(const common::PixelFormat& pixelFormat,
-                                       const common::Dataspace& dataspace) {
-    // TODO: add support for RGBA_1010102
-    if (pixelFormat != common::PixelFormat::RGB_888 &&
-        pixelFormat != common::PixelFormat::RGBA_8888) {
-        return false;
-    }
-    if (std::find(dataspaces.begin(), dataspaces.end(), dataspace) == dataspaces.end()) {
-        return false;
-    }
-    return true;
-}
-
-void ReadbackHelper::createReadbackBuffer(ReadbackBufferAttributes readbackBufferAttributes,
-                                          const VtsDisplay& display,
-                                          sp<GraphicBuffer>* graphicBuffer) {
-    ASSERT_NE(nullptr, graphicBuffer);
-    if (!readbackSupported(readbackBufferAttributes.format, readbackBufferAttributes.dataspace)) {
-        *graphicBuffer = nullptr;
-    }
-    uint64_t usage =
-            static_cast<uint64_t>(static_cast<uint64_t>(common::BufferUsage::CPU_READ_OFTEN) |
-                                  static_cast<uint64_t>(common::BufferUsage::GPU_TEXTURE));
-
-    uint32_t layerCount = 1;
-    *graphicBuffer = sp<GraphicBuffer>::make(
-            static_cast<uint32_t>(display.getDisplayWidth()),
-            static_cast<uint32_t>(display.getDisplayHeight()),
-            static_cast<::android::PixelFormat>(readbackBufferAttributes.format), layerCount, usage,
-            "ReadbackBuffer");
-    ASSERT_NE(nullptr, *graphicBuffer);
-    ASSERT_EQ(::android::OK, (*graphicBuffer)->initCheck());
-}
-
 std::string ReadbackHelper::getColorModeString(ColorMode mode) {
     switch (mode) {
         case ColorMode::SRGB:
@@ -142,11 +103,11 @@
     return layerSettings;
 }
 
-int32_t ReadbackHelper::GetBytesPerPixel(PixelFormat pixelFormat) {
+int32_t ReadbackHelper::GetBytesPerPixel(common::PixelFormat pixelFormat) {
     switch (pixelFormat) {
-        case PixelFormat::RGBA_8888:
+        case common::PixelFormat::RGBA_8888:
             return 4;
-        case PixelFormat::RGB_888:
+        case common::PixelFormat::RGB_888:
             return 3;
         default:
             return -1;
@@ -155,161 +116,136 @@
 
 void ReadbackHelper::fillBuffer(uint32_t width, uint32_t height, uint32_t stride, void* bufferData,
                                 common::PixelFormat pixelFormat,
-                                const std::vector<Color>& desiredColors) {
+                                std::vector<Color> desiredPixelColors) {
     ASSERT_TRUE(pixelFormat == common::PixelFormat::RGB_888 ||
                 pixelFormat == common::PixelFormat::RGBA_8888);
     int32_t bytesPerPixel = GetBytesPerPixel(pixelFormat);
     ASSERT_NE(-1, bytesPerPixel);
     for (int row = 0; row < height; row++) {
         for (int col = 0; col < width; col++) {
-            int pixel = row * static_cast<int32_t>(width) + col;
-            Color desiredColor = desiredColors[static_cast<size_t>(pixel)];
+            auto pixel = row * static_cast<int32_t>(width) + col;
+            Color srcColor = desiredPixelColors[static_cast<size_t>(pixel)];
 
             int offset = (row * static_cast<int32_t>(stride) + col) * bytesPerPixel;
             uint8_t* pixelColor = (uint8_t*)bufferData + offset;
-            pixelColor[0] = static_cast<uint8_t>(std::round(255.0f * desiredColor.r));
-            pixelColor[1] = static_cast<uint8_t>(std::round(255.0f * desiredColor.g));
-            pixelColor[2] = static_cast<uint8_t>(std::round(255.0f * desiredColor.b));
+            pixelColor[0] = static_cast<uint8_t>(std::round(255.0f * srcColor.r));
+            pixelColor[1] = static_cast<uint8_t>(std::round(255.0f * srcColor.g));
+            pixelColor[2] = static_cast<uint8_t>(std::round(255.0f * srcColor.b));
 
             if (bytesPerPixel == 4) {
-                pixelColor[3] = static_cast<uint8_t>(std::round(255.0f * desiredColor.a));
+                pixelColor[3] = static_cast<uint8_t>(std::round(255.0f * srcColor.a));
             }
         }
     }
 }
 
-void ReadbackHelper::clearColors(std::vector<Color>& colors, int32_t width, int32_t height,
+void ReadbackHelper::clearColors(std::vector<Color>& expectedColors, int32_t width, int32_t height,
                                  int32_t displayWidth) {
     for (int row = 0; row < height; row++) {
         for (int col = 0; col < width; col++) {
             int pixel = row * displayWidth + col;
-            colors[static_cast<size_t>(pixel)] = BLACK;
+            expectedColors[static_cast<size_t>(pixel)] = BLACK;
         }
     }
 }
 
-void ReadbackHelper::fillColorsArea(std::vector<Color>& colors, int32_t stride, Rect area,
-                                    Color desiredColor) {
+void ReadbackHelper::fillColorsArea(std::vector<Color>& expectedColors, int32_t stride, Rect area,
+                                    Color color) {
     for (int row = area.top; row < area.bottom; row++) {
         for (int col = area.left; col < area.right; col++) {
             int pixel = row * stride + col;
-            colors[static_cast<size_t>(pixel)] = desiredColor;
+            expectedColors[static_cast<size_t>(pixel)] = color;
         }
     }
 }
 
-void ReadbackHelper::fillBufferAndGetFence(const sp<GraphicBuffer>& graphicBuffer,
-                                           Color desiredColor, int* fillFence) {
-    ASSERT_NE(nullptr, fillFence);
-    std::vector<Color> desiredColors(
-            static_cast<size_t>(graphicBuffer->getWidth() * graphicBuffer->getHeight()));
-    ::android::Rect bounds = graphicBuffer->getBounds();
-    fillColorsArea(desiredColors, static_cast<int32_t>(graphicBuffer->getWidth()),
-                   {bounds.left, bounds.top, bounds.right, bounds.bottom}, desiredColor);
-    ASSERT_NO_FATAL_FAILURE(fillBufferAndGetFence(graphicBuffer, desiredColors, fillFence));
-}
-
-void ReadbackHelper::fillBufferAndGetFence(const sp<GraphicBuffer>& graphicBuffer,
-                                           const std::vector<Color>& desiredColors,
-                                           int* fillFence) {
-    ASSERT_TRUE(graphicBuffer->getPixelFormat() == ::android::PIXEL_FORMAT_RGB_888 ||
-                graphicBuffer->getPixelFormat() == ::android::PIXEL_FORMAT_RGBA_8888);
-    void* bufData;
-    int32_t bytesPerPixel = -1;
-    int32_t bytesPerStride = -1;
-    status_t status =
-            graphicBuffer->lock(GRALLOC_USAGE_SW_READ_OFTEN | GRALLOC_USAGE_SW_WRITE_OFTEN,
-                                &bufData, &bytesPerPixel, &bytesPerStride);
-    ASSERT_EQ(::android::OK, status);
-
-    const uint32_t stride = (bytesPerPixel > 0 && bytesPerStride > 0)
-                                    ? static_cast<uint32_t>(bytesPerStride / bytesPerPixel)
-                                    : graphicBuffer->getStride();
-    ReadbackHelper::fillBuffer(
-            graphicBuffer->getWidth(), graphicBuffer->getHeight(), stride, bufData,
-            static_cast<common::PixelFormat>(graphicBuffer->getPixelFormat()), desiredColors);
-    status = graphicBuffer->unlockAsync(fillFence);
-    ASSERT_EQ(::android::OK, status);
-}
-
-void ReadbackHelper::compareColorToBuffer(Color expectedColor,
-                                          const sp<GraphicBuffer>& graphicBuffer,
-                                          const ndk::ScopedFileDescriptor& fence) {
-    std::vector<Color> expectedColors(
-            static_cast<size_t>(graphicBuffer->getWidth() * graphicBuffer->getHeight()));
-    ::android::Rect bounds = graphicBuffer->getBounds();
-    fillColorsArea(expectedColors, static_cast<int32_t>(graphicBuffer->getWidth()),
-                   {bounds.left, bounds.top, bounds.right, bounds.bottom}, expectedColor);
-    compareColorsToBuffer(expectedColors, graphicBuffer, fence);
-}
-
-void ReadbackHelper::compareColorsToBuffer(const std::vector<Color>& expectedColors,
-                                           const sp<GraphicBuffer>& graphicBuffer,
-                                           const ndk::ScopedFileDescriptor& fence) {
-    ASSERT_TRUE(graphicBuffer->getPixelFormat() == ::android::PIXEL_FORMAT_RGB_888 ||
-                graphicBuffer->getPixelFormat() == ::android::PIXEL_FORMAT_RGBA_8888);
-
-    int bytesPerPixel = -1;
-    int bytesPerStride = -1;
-    void* bufData = nullptr;
-    status_t status = graphicBuffer->lockAsync(GRALLOC_USAGE_SW_READ_OFTEN, &bufData,
-                                               dup(fence.get()), &bytesPerPixel, &bytesPerStride);
-    ASSERT_EQ(::android::OK, status);
-
-    const uint32_t stride = (bytesPerPixel > 0 && bytesPerStride > 0)
-                                    ? static_cast<uint32_t>(bytesPerStride / bytesPerPixel)
-                                    : graphicBuffer->getStride();
-
-    if (bytesPerPixel == -1) {
-        bytesPerPixel = ReadbackHelper::GetBytesPerPixel(
-                static_cast<PixelFormat>(graphicBuffer->getPixelFormat()));
+bool ReadbackHelper::readbackSupported(const common::PixelFormat& pixelFormat,
+                                       const common::Dataspace& dataspace) {
+    if (pixelFormat != common::PixelFormat::RGB_888 &&
+        pixelFormat != common::PixelFormat::RGBA_8888) {
+        return false;
     }
+    if (std::find(dataspaces.begin(), dataspaces.end(), dataspace) == dataspaces.end()) {
+        return false;
+    }
+    return true;
+}
+
+void ReadbackHelper::compareColorBuffers(const std::vector<Color>& expectedColors, void* bufferData,
+                                         const uint32_t stride, const uint32_t width,
+                                         const uint32_t height, common::PixelFormat pixelFormat) {
+    const int32_t bytesPerPixel = ReadbackHelper::GetBytesPerPixel(pixelFormat);
     ASSERT_NE(-1, bytesPerPixel);
-    for (int row = 0; row < graphicBuffer->getHeight(); row++) {
-        for (int col = 0; col < graphicBuffer->getWidth(); col++) {
-            int pixel = row * static_cast<int32_t>(graphicBuffer->getWidth()) + col;
+    for (int row = 0; row < height; row++) {
+        for (int col = 0; col < width; col++) {
+            auto pixel = row * static_cast<int32_t>(width) + col;
             int offset = (row * static_cast<int32_t>(stride) + col) * bytesPerPixel;
-            uint8_t* pixelColor = (uint8_t*)bufData + offset;
+            uint8_t* pixelColor = (uint8_t*)bufferData + offset;
             const Color expectedColor = expectedColors[static_cast<size_t>(pixel)];
             ASSERT_EQ(std::round(255.0f * expectedColor.r), pixelColor[0]);
             ASSERT_EQ(std::round(255.0f * expectedColor.g), pixelColor[1]);
             ASSERT_EQ(std::round(255.0f * expectedColor.b), pixelColor[2]);
         }
     }
-
-    status = graphicBuffer->unlock();
-    ASSERT_EQ(::android::OK, status);
 }
 
 ReadbackBuffer::ReadbackBuffer(int64_t display, const std::shared_ptr<VtsComposerClient>& client,
-                               int32_t width, int32_t height, common::PixelFormat pixelFormat)
+                               int32_t width, int32_t height, common::PixelFormat pixelFormat,
+                               common::Dataspace dataspace)
     : mComposerClient(client) {
     mDisplay = display;
+
+    mPixelFormat = pixelFormat;
+    mDataspace = dataspace;
+
     mWidth = static_cast<uint32_t>(width);
     mHeight = static_cast<uint32_t>(height);
-    mPixelFormat = pixelFormat;
     mLayerCount = 1;
     mUsage = static_cast<uint64_t>(static_cast<uint64_t>(common::BufferUsage::CPU_READ_OFTEN) |
                                    static_cast<uint64_t>(common::BufferUsage::GPU_TEXTURE));
+
+    mAccessRegion.top = 0;
+    mAccessRegion.left = 0;
+    mAccessRegion.right = static_cast<int32_t>(width);
+    mAccessRegion.bottom = static_cast<int32_t>(height);
+}
+
+::android::sp<::android::GraphicBuffer> ReadbackBuffer::allocateBuffer() {
+    return ::android::sp<::android::GraphicBuffer>::make(
+            mWidth, mHeight, static_cast<::android::PixelFormat>(mPixelFormat), mLayerCount, mUsage,
+            "ReadbackBuffer");
 }
 
 void ReadbackBuffer::setReadbackBuffer() {
-    mGraphicBuffer = sp<GraphicBuffer>::make(mWidth, mHeight,
-                                             static_cast<::android::PixelFormat>(mPixelFormat),
-                                             mLayerCount, mUsage, "ReadbackBuffer");
+    mGraphicBuffer = allocateBuffer();
     ASSERT_NE(nullptr, mGraphicBuffer);
     ASSERT_EQ(::android::OK, mGraphicBuffer->initCheck());
-    ::ndk::ScopedFileDescriptor noFence = ::ndk::ScopedFileDescriptor(-1);
-    const auto& status =
-            mComposerClient->setReadbackBuffer(mDisplay, mGraphicBuffer->handle, noFence);
-    ASSERT_TRUE(status.isOk());
+    const auto& bufferHandle = mGraphicBuffer->handle;
+    ::ndk::ScopedFileDescriptor fence = ::ndk::ScopedFileDescriptor(-1);
+    EXPECT_TRUE(mComposerClient->setReadbackBuffer(mDisplay, bufferHandle, fence).isOk());
 }
 
 void ReadbackBuffer::checkReadbackBuffer(const std::vector<Color>& expectedColors) {
+    ASSERT_NE(nullptr, mGraphicBuffer);
     // lock buffer for reading
     const auto& [fenceStatus, bufferFence] = mComposerClient->getReadbackBufferFence(mDisplay);
-    ASSERT_TRUE(fenceStatus.isOk());
-    ReadbackHelper::compareColorsToBuffer(expectedColors, mGraphicBuffer, bufferFence);
+    EXPECT_TRUE(fenceStatus.isOk());
+
+    int bytesPerPixel = -1;
+    int bytesPerStride = -1;
+    void* bufData = nullptr;
+
+    auto status = mGraphicBuffer->lockAsync(mUsage, mAccessRegion, &bufData, dup(bufferFence.get()),
+                                            &bytesPerPixel, &bytesPerStride);
+    EXPECT_EQ(::android::OK, status);
+    ASSERT_TRUE(mPixelFormat == PixelFormat::RGB_888 || mPixelFormat == PixelFormat::RGBA_8888);
+    const uint32_t stride = (bytesPerPixel > 0 && bytesPerStride > 0)
+                                    ? static_cast<uint32_t>(bytesPerStride / bytesPerPixel)
+                                    : mGraphicBuffer->getStride();
+    ReadbackHelper::compareColorBuffers(expectedColors, bufData, stride, mWidth, mHeight,
+                                        mPixelFormat);
+    status = mGraphicBuffer->unlock();
+    EXPECT_EQ(::android::OK, status);
 }
 
 void TestColorLayer::write(ComposerClientWriter& writer) {
@@ -387,8 +323,9 @@
     const uint32_t stride = (bytesPerPixel > 0 && bytesPerStride > 0)
                                     ? static_cast<uint32_t>(bytesPerStride / bytesPerPixel)
                                     : mGraphicBuffer->getStride();
-    ASSERT_EQ(::android::OK, status);
-    ReadbackHelper::fillBuffer(mWidth, mHeight, stride, bufData, mPixelFormat, expectedColors);
+    EXPECT_EQ(::android::OK, status);
+    ASSERT_NO_FATAL_FAILURE(ReadbackHelper::fillBuffer(mWidth, mHeight, stride, bufData,
+                                                       mPixelFormat, expectedColors));
 
     const auto unlockStatus = mGraphicBuffer->unlockAsync(&mFillFence);
     ASSERT_EQ(::android::OK, unlockStatus);
@@ -398,13 +335,13 @@
     mGraphicBuffer = allocateBuffer();
     ASSERT_NE(nullptr, mGraphicBuffer);
     ASSERT_EQ(::android::OK, mGraphicBuffer->initCheck());
-    fillBuffer(colors);
+    ASSERT_NO_FATAL_FAILURE(fillBuffer(colors));
 }
 
-sp<GraphicBuffer> TestBufferLayer::allocateBuffer() {
-    return sp<GraphicBuffer>::make(mWidth, mHeight,
-                                   static_cast<::android::PixelFormat>(mPixelFormat), mLayerCount,
-                                   mUsage, "TestBufferLayer");
+::android::sp<::android::GraphicBuffer> TestBufferLayer::allocateBuffer() {
+    return ::android::sp<::android::GraphicBuffer>::make(
+            mWidth, mHeight, static_cast<::android::PixelFormat>(mPixelFormat), mLayerCount, mUsage,
+            "TestBufferLayer");
 }
 
 void TestBufferLayer::setDataspace(common::Dataspace dataspace, ComposerClientWriter& writer) {
diff --git a/graphics/composer/aidl/vts/ReadbackVts.h b/graphics/composer/aidl/vts/ReadbackVts.h
index ecf0d52..ee9f0d5 100644
--- a/graphics/composer/aidl/vts/ReadbackVts.h
+++ b/graphics/composer/aidl/vts/ReadbackVts.h
@@ -33,8 +33,6 @@
 using common::Dataspace;
 using common::PixelFormat;
 using IMapper2_1 = ::android::hardware::graphics::mapper::V2_1::IMapper;
-using ::android::GraphicBuffer;
-using ::android::sp;
 
 static const Color BLACK = {0.0f, 0.0f, 0.0f, 1.0f};
 static const Color RED = {1.0f, 0.0f, 0.0f, 1.0f};
@@ -148,7 +146,7 @@
 
   protected:
     Composition mComposition;
-    sp<GraphicBuffer> mGraphicBuffer;
+    ::android::sp<::android::GraphicBuffer> mGraphicBuffer;
     TestRenderEngine& mRenderEngine;
     int32_t mFillFence;
     uint32_t mWidth;
@@ -164,11 +162,6 @@
 
 class ReadbackHelper {
   public:
-    static bool readbackSupported(const PixelFormat& pixelFormat, const Dataspace& dataspace);
-
-    static void createReadbackBuffer(ReadbackBufferAttributes readbackBufferAttributes,
-                                     const VtsDisplay& display, sp<GraphicBuffer>* graphicBuffer);
-
     static std::string getColorModeString(ColorMode mode);
 
     static std::string getDataspaceString(Dataspace dataspace);
@@ -178,36 +171,28 @@
     static int32_t GetBytesPerPixel(PixelFormat pixelFormat);
 
     static void fillBuffer(uint32_t width, uint32_t height, uint32_t stride, void* bufferData,
-                           PixelFormat pixelFormat, const std::vector<Color>& desriedColors);
+                           PixelFormat pixelFormat, std::vector<Color> desiredPixelColors);
 
-    static void clearColors(std::vector<Color>& colors, int32_t width, int32_t height,
+    static void clearColors(std::vector<Color>& expectedColors, int32_t width, int32_t height,
                             int32_t displayWidth);
 
-    static void fillColorsArea(std::vector<Color>& colors, int32_t stride, Rect area,
-                               Color desiredColor);
+    static void fillColorsArea(std::vector<Color>& expectedColors, int32_t stride, Rect area,
+                               Color color);
 
-    static void fillBufferAndGetFence(const sp<GraphicBuffer>& buffer, Color desiredColor,
-                                      int* fillFence);
-
-    static void fillBufferAndGetFence(const sp<GraphicBuffer>& buffer,
-                                      const std::vector<Color>& desiredColors, int* fillFence);
-
-    static void compareColorToBuffer(
-            Color expectedColor, const sp<GraphicBuffer>& graphicBuffer,
-            const ndk::ScopedFileDescriptor& fence = ::ndk::ScopedFileDescriptor(-1));
-
-    static void compareColorsToBuffer(
-            const std::vector<Color>& expectedColors, const sp<GraphicBuffer>& graphicBuffer,
-            const ndk::ScopedFileDescriptor& fence = ::ndk::ScopedFileDescriptor(-1));
+    static bool readbackSupported(const PixelFormat& pixelFormat, const Dataspace& dataspace);
 
     static const std::vector<ColorMode> colorModes;
     static const std::vector<Dataspace> dataspaces;
+
+    static void compareColorBuffers(const std::vector<Color>& expectedColors, void* bufferData,
+                                    const uint32_t stride, const uint32_t width,
+                                    const uint32_t height, PixelFormat pixelFormat);
 };
 
 class ReadbackBuffer {
   public:
     ReadbackBuffer(int64_t display, const std::shared_ptr<VtsComposerClient>& client, int32_t width,
-                   int32_t height, common::PixelFormat pixelFormat);
+                   int32_t height, common::PixelFormat pixelFormat, common::Dataspace dataspace);
 
     void setReadbackBuffer();
 
@@ -216,12 +201,18 @@
   protected:
     uint32_t mWidth;
     uint32_t mHeight;
-    PixelFormat mPixelFormat;
     uint32_t mLayerCount;
     uint32_t mUsage;
+    PixelFormat mPixelFormat;
+    Dataspace mDataspace;
     int64_t mDisplay;
-    sp<GraphicBuffer> mGraphicBuffer;
+    ::android::sp<::android::GraphicBuffer> mGraphicBuffer;
     std::shared_ptr<VtsComposerClient> mComposerClient;
+    ::android::Rect mAccessRegion;
+    native_handle_t mBufferHandle;
+
+  private:
+    ::android::sp<::android::GraphicBuffer> allocateBuffer();
 };
 
 }  // namespace aidl::android::hardware::graphics::composer3::vts
diff --git a/graphics/composer/aidl/vts/RenderEngineVts.cpp b/graphics/composer/aidl/vts/RenderEngineVts.cpp
index b84d0d0..66779c8 100644
--- a/graphics/composer/aidl/vts/RenderEngineVts.cpp
+++ b/graphics/composer/aidl/vts/RenderEngineVts.cpp
@@ -76,7 +76,18 @@
 }
 
 void TestRenderEngine::checkColorBuffer(const std::vector<Color>& expectedColors) {
-    ReadbackHelper::compareColorsToBuffer(expectedColors, mGraphicBuffer);
+    void* bufferData;
+    int32_t bytesPerPixel = -1;
+    int32_t bytesPerStride = -1;
+    ASSERT_EQ(0, mGraphicBuffer->lock(static_cast<uint32_t>(mGraphicBuffer->getUsage()),
+                                      &bufferData, &bytesPerPixel, &bytesPerStride));
+    const uint32_t stride = (bytesPerPixel > 0 && bytesPerStride > 0)
+                                    ? static_cast<uint32_t>(bytesPerStride / bytesPerPixel)
+                                    : mGraphicBuffer->getStride();
+    ReadbackHelper::compareColorBuffers(expectedColors, bufferData, stride,
+                                        mGraphicBuffer->getWidth(), mGraphicBuffer->getHeight(),
+                                        mFormat);
+    ASSERT_EQ(::android::OK, mGraphicBuffer->unlock());
 }
 
 }  // namespace aidl::android::hardware::graphics::composer3::vts
diff --git a/graphics/composer/aidl/vts/VtsComposerClient.cpp b/graphics/composer/aidl/vts/VtsComposerClient.cpp
index 43f4b84..f95e747 100644
--- a/graphics/composer/aidl/vts/VtsComposerClient.cpp
+++ b/graphics/composer/aidl/vts/VtsComposerClient.cpp
@@ -337,6 +337,18 @@
     return {mComposerClient->getPreferredBootDisplayConfig(display, &outConfig), outConfig};
 }
 
+std::pair<ScopedAStatus, std::vector<common::HdrConversionCapability>>
+VtsComposerClient::getHdrConversionCapabilities() {
+    std::vector<common::HdrConversionCapability> hdrConversionCapability;
+    return {mComposerClient->getHdrConversionCapabilities(&hdrConversionCapability),
+            hdrConversionCapability};
+}
+
+ScopedAStatus VtsComposerClient::setHdrConversionStrategy(
+        const common::HdrConversionStrategy& conversionStrategy) {
+    return mComposerClient->setHdrConversionStrategy(conversionStrategy);
+}
+
 std::pair<ScopedAStatus, common::Transform> VtsComposerClient::getDisplayPhysicalOrientation(
         int64_t display) {
     common::Transform outDisplayOrientation;
diff --git a/graphics/composer/aidl/vts/VtsComposerClient.h b/graphics/composer/aidl/vts/VtsComposerClient.h
index c4bc464..27788e7 100644
--- a/graphics/composer/aidl/vts/VtsComposerClient.h
+++ b/graphics/composer/aidl/vts/VtsComposerClient.h
@@ -163,6 +163,11 @@
 
     std::pair<ScopedAStatus, int32_t> getPreferredBootDisplayConfig(int64_t display);
 
+    std::pair<ScopedAStatus, std::vector<common::HdrConversionCapability>>
+    getHdrConversionCapabilities();
+
+    ScopedAStatus setHdrConversionStrategy(const common::HdrConversionStrategy& conversionStrategy);
+
     std::pair<ScopedAStatus, common::Transform> getDisplayPhysicalOrientation(int64_t display);
 
     ScopedAStatus setIdleTimerEnabled(int64_t display, int32_t timeoutMs);
diff --git a/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_ReadbackTest.cpp b/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_ReadbackTest.cpp
index 166127d..6fa3392 100644
--- a/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_ReadbackTest.cpp
+++ b/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_ReadbackTest.cpp
@@ -18,6 +18,7 @@
 
 #include <aidl/Gtest.h>
 #include <aidl/Vintf.h>
+#include <aidl/android/hardware/graphics/common/BufferUsage.h>
 #include <aidl/android/hardware/graphics/composer3/IComposer.h>
 #include <gtest/gtest.h>
 #include <ui/DisplayId.h>
@@ -80,11 +81,13 @@
         clientCompositionDisplay.physicalDisplay = Rect(getDisplayWidth(), getDisplayHeight());
         clientCompositionDisplay.clip = clientCompositionDisplay.physicalDisplay;
 
-        mTestRenderEngine->initGraphicBuffer(static_cast<uint32_t>(getDisplayWidth()),
-                                             static_cast<uint32_t>(getDisplayHeight()),
-                                             /*layerCount*/ 1U,
-                                             GRALLOC_USAGE_HW_RENDER | GRALLOC_USAGE_SW_READ_OFTEN |
-                                                     GRALLOC_USAGE_SW_WRITE_OFTEN);
+        mTestRenderEngine->initGraphicBuffer(
+                static_cast<uint32_t>(getDisplayWidth()), static_cast<uint32_t>(getDisplayHeight()),
+                /*layerCount*/ 1U,
+                static_cast<uint64_t>(
+                        static_cast<uint64_t>(common::BufferUsage::CPU_READ_OFTEN) |
+                        static_cast<uint64_t>(common::BufferUsage::CPU_WRITE_OFTEN) |
+                        static_cast<uint64_t>(common::BufferUsage::GPU_RENDER_TARGET)));
         mTestRenderEngine->setDisplaySettings(clientCompositionDisplay);
     }
 
@@ -112,21 +115,18 @@
         ASSERT_EQ(status.getServiceSpecificError(), serviceSpecificError);
     }
 
-    sp<GraphicBuffer> allocateBuffer(uint32_t width, uint32_t height, uint64_t usage) {
-        sp<GraphicBuffer> graphicBuffer =
-                sp<GraphicBuffer>::make(width, height, ::android::PIXEL_FORMAT_RGBA_8888,
-                                        /*layerCount*/ 1u, static_cast<uint32_t>(usage),
-                                        "VtsHalGraphicsComposer3_ReadbackTest");
+    std::pair<bool, ::android::sp<::android::GraphicBuffer>> allocateBuffer(uint32_t usage) {
+        const auto width = static_cast<uint32_t>(getDisplayWidth());
+        const auto height = static_cast<uint32_t>(getDisplayHeight());
+
+        const auto& graphicBuffer = ::android::sp<::android::GraphicBuffer>::make(
+                width, height, ::android::PIXEL_FORMAT_RGBA_8888,
+                /*layerCount*/ 1u, usage, "VtsHalGraphicsComposer3_ReadbackTest");
 
         if (graphicBuffer && ::android::OK == graphicBuffer->initCheck()) {
-            return graphicBuffer;
+            return {true, graphicBuffer};
         }
-        return nullptr;
-    }
-
-    sp<GraphicBuffer> allocateBuffer(uint64_t usage) {
-        return allocateBuffer(static_cast<uint32_t>(getDisplayWidth()),
-                              static_cast<uint32_t>(getDisplayHeight()), usage);
+        return {false, graphicBuffer};
     }
 
     uint64_t getStableDisplayId(int64_t display) {
@@ -293,7 +293,7 @@
         ReadbackHelper::fillColorsArea(expectedColors, getDisplayWidth(), coloredSquare, BLUE);
 
         ReadbackBuffer readbackBuffer(getPrimaryDisplayId(), mComposerClient, getDisplayWidth(),
-                                      getDisplayHeight(), mPixelFormat);
+                                      getDisplayHeight(), mPixelFormat, mDataspace);
         ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
 
         writeLayers(layers);
@@ -332,7 +332,7 @@
         }
 
         ReadbackBuffer readbackBuffer(getPrimaryDisplayId(), mComposerClient, getDisplayWidth(),
-                                      getDisplayHeight(), mPixelFormat);
+                                      getDisplayHeight(), mPixelFormat, mDataspace);
         ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
         std::vector<Color> expectedColors(
                 static_cast<size_t>(getDisplayWidth() * getDisplayHeight()));
@@ -378,296 +378,6 @@
     }
 }
 
-TEST_P(GraphicsCompositionTest, SetLayerBufferWithSlotsToClear) {
-    const auto& [versionStatus, version] = mComposerClient->getInterfaceVersion();
-    ASSERT_TRUE(versionStatus.isOk());
-    if (version == 1) {
-        GTEST_SUCCEED() << "Device does not support the new API for clearing buffer slots";
-        return;
-    }
-
-    const auto& [readbackStatus, readbackBufferAttributes] =
-            mComposerClient->getReadbackBufferAttributes(getPrimaryDisplayId());
-    if (!readbackStatus.isOk()) {
-        GTEST_SUCCEED() << "Readback not supported";
-        return;
-    }
-
-    sp<GraphicBuffer> readbackBuffer;
-    ASSERT_NO_FATAL_FAILURE(ReadbackHelper::createReadbackBuffer(
-            readbackBufferAttributes, getPrimaryDisplay(), &readbackBuffer));
-    if (readbackBuffer == nullptr) {
-        GTEST_SUCCEED() << "Unsupported readback buffer attributes";
-        return;
-    }
-    // no fence needed for the readback buffer
-    ScopedFileDescriptor noFence(-1);
-
-    // red buffer
-    uint64_t usage = GRALLOC_USAGE_SW_WRITE_OFTEN | GRALLOC_USAGE_SW_READ_OFTEN;
-    sp<GraphicBuffer> redBuffer = allocateBuffer(usage);
-    ASSERT_NE(nullptr, redBuffer);
-    int redFence;
-    ASSERT_NO_FATAL_FAILURE(ReadbackHelper::fillBufferAndGetFence(redBuffer, RED, &redFence));
-
-    // blue buffer
-    sp<GraphicBuffer> blueBuffer = allocateBuffer(usage);
-    ASSERT_NE(nullptr, blueBuffer);
-    int blueFence;
-    ASSERT_NO_FATAL_FAILURE(ReadbackHelper::fillBufferAndGetFence(blueBuffer, BLUE, &blueFence));
-
-    // green buffer
-    sp<GraphicBuffer> greenBuffer = allocateBuffer(usage);
-    ASSERT_NE(nullptr, greenBuffer);
-    int greenFence;
-    ASSERT_NO_FATAL_FAILURE(ReadbackHelper::fillBufferAndGetFence(greenBuffer, GREEN, &greenFence));
-
-    // layer defaults
-    common::Rect rectFullDisplay = {0, 0, getDisplayWidth(), getDisplayHeight()};
-    int64_t display = getPrimaryDisplayId();
-    const auto& [layerStatus, layer] = mComposerClient->createLayer(getPrimaryDisplayId(), 3);
-    ASSERT_TRUE(layerStatus.isOk());
-    mWriter->setLayerDisplayFrame(display, layer, rectFullDisplay);
-    mWriter->setLayerCompositionType(display, layer, Composition::DEVICE);
-
-    // set the layer to the blue buffer
-    // should be blue
-    {
-        auto status = mComposerClient->setReadbackBuffer(display, readbackBuffer->handle, noFence);
-        ASSERT_TRUE(status.isOk());
-        mWriter->setLayerBuffer(display, layer, /*slot*/ 0, blueBuffer->handle, blueFence);
-        mWriter->validateDisplay(display, ComposerClientWriter::kNoTimestamp);
-        execute();
-        ASSERT_TRUE(mReader.takeChangedCompositionTypes(display).empty());
-        ASSERT_TRUE(mReader.takeErrors().empty());
-        mWriter->presentDisplay(display);
-        execute();
-        auto [fenceStatus, fence] = mComposerClient->getReadbackBufferFence(display);
-        ASSERT_TRUE(fenceStatus.isOk());
-        ReadbackHelper::compareColorToBuffer(BLUE, readbackBuffer, fence);
-    }
-
-    // change the layer to the red buffer
-    // should be red
-    {
-        auto status = mComposerClient->setReadbackBuffer(display, readbackBuffer->handle, noFence);
-        ASSERT_TRUE(status.isOk());
-        mWriter->setLayerBuffer(display, layer, /*slot*/ 1, redBuffer->handle, redFence);
-        mWriter->validateDisplay(display, ComposerClientWriter::kNoTimestamp);
-        execute();
-        ASSERT_TRUE(mReader.takeChangedCompositionTypes(display).empty());
-        ASSERT_TRUE(mReader.takeErrors().empty());
-        mWriter->presentDisplay(display);
-        execute();
-        auto [fenceStatus, fence] = mComposerClient->getReadbackBufferFence(display);
-        ASSERT_TRUE(fenceStatus.isOk());
-        ReadbackHelper::compareColorToBuffer(RED, readbackBuffer, fence);
-    }
-
-    // change the layer to the green buffer
-    // should be green
-    {
-        auto status = mComposerClient->setReadbackBuffer(display, readbackBuffer->handle, noFence);
-        ASSERT_TRUE(status.isOk());
-        mWriter->setLayerBuffer(display, layer, /*slot*/ 2, greenBuffer->handle, greenFence);
-        mWriter->validateDisplay(display, ComposerClientWriter::kNoTimestamp);
-        execute();
-        ASSERT_TRUE(mReader.takeChangedCompositionTypes(display).empty());
-        ASSERT_TRUE(mReader.takeErrors().empty());
-        mWriter->presentDisplay(display);
-        execute();
-        auto [fenceStatus, fence] = mComposerClient->getReadbackBufferFence(display);
-        ASSERT_TRUE(fenceStatus.isOk());
-        ReadbackHelper::compareColorToBuffer(GREEN, readbackBuffer, fence);
-    }
-
-    // clear the slots for all buffers
-    // should still be green since the active buffer should not be cleared by the HAL implementation
-    {
-        auto status = mComposerClient->setReadbackBuffer(display, readbackBuffer->handle, noFence);
-        ASSERT_TRUE(status.isOk());
-        mWriter->setLayerBufferSlotsToClear(display, layer, /*slotsToClear*/ {0, 1, 2});
-        mWriter->validateDisplay(display, ComposerClientWriter::kNoTimestamp);
-        execute();
-        ASSERT_TRUE(mReader.takeChangedCompositionTypes(display).empty());
-        ASSERT_TRUE(mReader.takeErrors().empty());
-        mWriter->presentDisplay(display);
-        execute();
-        auto [fenceStatus, fence] = mComposerClient->getReadbackBufferFence(display);
-        ASSERT_TRUE(fenceStatus.isOk());
-        ReadbackHelper::compareColorToBuffer(GREEN, readbackBuffer, fence);
-    }
-
-    // clear the slot for the green buffer, and set the buffer with the same slot to the blue buffer
-    // should be blue
-    {
-        auto status = mComposerClient->setReadbackBuffer(display, readbackBuffer->handle, noFence);
-        ASSERT_TRUE(status.isOk());
-        mWriter->setLayerBufferSlotsToClear(display, layer, /*slotsToClear*/ {2});
-        mWriter->setLayerBuffer(display, layer, /*slot*/ 2, blueBuffer->handle, blueFence);
-        mWriter->validateDisplay(display, ComposerClientWriter::kNoTimestamp);
-        execute();
-        ASSERT_TRUE(mReader.takeChangedCompositionTypes(display).empty());
-        ASSERT_TRUE(mReader.takeErrors().empty());
-        mWriter->presentDisplay(display);
-        execute();
-        auto [fenceStatus, fence] = mComposerClient->getReadbackBufferFence(display);
-        ASSERT_TRUE(fenceStatus.isOk());
-        ReadbackHelper::compareColorToBuffer(BLUE, readbackBuffer, fence);
-    }
-}
-
-TEST_P(GraphicsCompositionTest, SetLayerBufferWithSlotsToClear_backwardsCompatible) {
-    const auto& [versionStatus, version] = mComposerClient->getInterfaceVersion();
-    ASSERT_TRUE(versionStatus.isOk());
-    if (version > 1) {
-        GTEST_SUCCEED() << "Device does not need a backwards compatible way to clear buffer slots";
-        return;
-    }
-
-    const auto& [readbackStatus, readbackBufferAttributes] =
-            mComposerClient->getReadbackBufferAttributes(getPrimaryDisplayId());
-    if (!readbackStatus.isOk()) {
-        GTEST_SUCCEED() << "Readback not supported";
-        return;
-    }
-
-    sp<GraphicBuffer> readbackBuffer;
-    ASSERT_NO_FATAL_FAILURE(ReadbackHelper::createReadbackBuffer(
-            readbackBufferAttributes, getPrimaryDisplay(), &readbackBuffer));
-    if (readbackBuffer == nullptr) {
-        GTEST_SUCCEED() << "Unsupported readback buffer attributes";
-        return;
-    }
-    // no fence needed for the readback buffer
-    ScopedFileDescriptor noFence(-1);
-
-    sp<GraphicBuffer> clearSlotBuffer = allocateBuffer(1u, 1u, GRALLOC_USAGE_HW_COMPOSER);
-    ASSERT_NE(nullptr, clearSlotBuffer);
-
-    // red buffer
-    uint64_t usage = GRALLOC_USAGE_SW_WRITE_OFTEN | GRALLOC_USAGE_SW_READ_OFTEN;
-    sp<GraphicBuffer> redBuffer = allocateBuffer(usage);
-    ASSERT_NE(nullptr, redBuffer);
-    int redFence;
-    ASSERT_NO_FATAL_FAILURE(ReadbackHelper::fillBufferAndGetFence(redBuffer, RED, &redFence));
-
-    // blue buffer
-    sp<GraphicBuffer> blueBuffer = allocateBuffer(usage);
-    ASSERT_NE(nullptr, blueBuffer);
-    int blueFence;
-    ASSERT_NO_FATAL_FAILURE(ReadbackHelper::fillBufferAndGetFence(blueBuffer, BLUE, &blueFence));
-
-    // green buffer
-    sp<GraphicBuffer> greenBuffer = allocateBuffer(usage);
-    ASSERT_NE(nullptr, greenBuffer);
-    int greenFence;
-    ASSERT_NO_FATAL_FAILURE(ReadbackHelper::fillBufferAndGetFence(greenBuffer, GREEN, &greenFence));
-
-    // layer defaults
-    common::Rect rectFullDisplay = {0, 0, getDisplayWidth(), getDisplayHeight()};
-    int64_t display = getPrimaryDisplayId();
-    const auto& [layerStatus, layer] = mComposerClient->createLayer(getPrimaryDisplayId(), 3);
-    ASSERT_TRUE(layerStatus.isOk());
-    mWriter->setLayerDisplayFrame(display, layer, rectFullDisplay);
-    mWriter->setLayerCompositionType(display, layer, Composition::DEVICE);
-
-    // set the layer to the blue buffer
-    // should be blue
-    {
-        auto status = mComposerClient->setReadbackBuffer(display, readbackBuffer->handle, noFence);
-        ASSERT_TRUE(status.isOk());
-        mWriter->setLayerBuffer(display, layer, /*slot*/ 0, blueBuffer->handle, blueFence);
-        mWriter->validateDisplay(display, ComposerClientWriter::kNoTimestamp);
-        execute();
-        ASSERT_TRUE(mReader.takeChangedCompositionTypes(display).empty());
-        ASSERT_TRUE(mReader.takeErrors().empty());
-        mWriter->presentDisplay(display);
-        execute();
-        auto [fenceStatus, fence] = mComposerClient->getReadbackBufferFence(display);
-        ASSERT_TRUE(fenceStatus.isOk());
-        ReadbackHelper::compareColorToBuffer(BLUE, readbackBuffer, fence);
-    }
-
-    // change the layer to the red buffer
-    // should be red
-    {
-        auto status = mComposerClient->setReadbackBuffer(display, readbackBuffer->handle, noFence);
-        ASSERT_TRUE(status.isOk());
-        mWriter->setLayerBuffer(display, layer, /*slot*/ 1, redBuffer->handle, redFence);
-        mWriter->validateDisplay(display, ComposerClientWriter::kNoTimestamp);
-        execute();
-        ASSERT_TRUE(mReader.takeChangedCompositionTypes(display).empty());
-        ASSERT_TRUE(mReader.takeErrors().empty());
-        mWriter->presentDisplay(display);
-        execute();
-        auto [fenceStatus, fence] = mComposerClient->getReadbackBufferFence(display);
-        ASSERT_TRUE(fenceStatus.isOk());
-        ReadbackHelper::compareColorToBuffer(RED, readbackBuffer, fence);
-    }
-
-    // change the layer to the green buffer
-    // should be green
-    {
-        auto status = mComposerClient->setReadbackBuffer(display, readbackBuffer->handle, noFence);
-        ASSERT_TRUE(status.isOk());
-        mWriter->setLayerBuffer(display, layer, /*slot*/ 2, greenBuffer->handle, greenFence);
-        mWriter->validateDisplay(display, ComposerClientWriter::kNoTimestamp);
-        execute();
-        ASSERT_TRUE(mReader.takeChangedCompositionTypes(display).empty());
-        ASSERT_TRUE(mReader.takeErrors().empty());
-        mWriter->presentDisplay(display);
-        execute();
-        auto [fenceStatus, fence] = mComposerClient->getReadbackBufferFence(display);
-        ASSERT_TRUE(fenceStatus.isOk());
-        ReadbackHelper::compareColorToBuffer(GREEN, readbackBuffer, fence);
-    }
-
-    // clear the slot for the blue buffer
-    // should still be green
-    {
-        auto status = mComposerClient->setReadbackBuffer(display, readbackBuffer->handle, noFence);
-        ASSERT_TRUE(status.isOk());
-        mWriter->setLayerBufferWithNewCommand(display, layer, /*slot*/ 0, clearSlotBuffer->handle,
-                                              /*fence*/ -1);
-        // SurfaceFlinger will re-set the active buffer slot after other buffer slots are cleared
-        mWriter->setLayerBufferWithNewCommand(display, layer, /*slot*/ 2, /*handle*/ nullptr,
-                                              /*fence*/ -1);
-        mWriter->validateDisplay(display, ComposerClientWriter::kNoTimestamp);
-        execute();
-        ASSERT_TRUE(mReader.takeChangedCompositionTypes(display).empty());
-        ASSERT_TRUE(mReader.takeErrors().empty());
-        mWriter->presentDisplay(display);
-        execute();
-        auto [fenceStatus, fence] = mComposerClient->getReadbackBufferFence(display);
-        ASSERT_TRUE(fenceStatus.isOk());
-        ReadbackHelper::compareColorToBuffer(GREEN, readbackBuffer, fence);
-    }
-
-    // clear the slot for all buffers, and set the buffer with the same slot as the green buffer
-    // should be blue now
-    {
-        auto status = mComposerClient->setReadbackBuffer(display, readbackBuffer->handle, noFence);
-        ASSERT_TRUE(status.isOk());
-        mWriter->setLayerBufferWithNewCommand(display, layer, /*slot*/ 0, clearSlotBuffer->handle,
-                                              /*fence*/ -1);
-        mWriter->setLayerBufferWithNewCommand(display, layer, /*slot*/ 1, clearSlotBuffer->handle,
-                                              /*fence*/ -1);
-        // SurfaceFlinger will never clear the active buffer (slot 2), but will free up the
-        // buffer slot so it will be re-used for the next setLayerBuffer command
-        mWriter->setLayerBuffer(display, layer, /*slot*/ 2, blueBuffer->handle, blueFence);
-        mWriter->validateDisplay(display, ComposerClientWriter::kNoTimestamp);
-        execute();
-        ASSERT_TRUE(mReader.takeChangedCompositionTypes(display).empty());
-        ASSERT_TRUE(mReader.takeErrors().empty());
-        mWriter->presentDisplay(display);
-        execute();
-        auto [fenceStatus, fence] = mComposerClient->getReadbackBufferFence(display);
-        ASSERT_TRUE(fenceStatus.isOk());
-        ReadbackHelper::compareColorToBuffer(BLUE, readbackBuffer, fence);
-    }
-}
-
 TEST_P(GraphicsCompositionTest, SetLayerBufferNoEffect) {
     for (ColorMode mode : mTestColorModes) {
         EXPECT_TRUE(mComposerClient
@@ -689,9 +399,10 @@
         layer->write(*mWriter);
 
         // This following buffer call should have no effect
-        uint64_t usage = GRALLOC_USAGE_SW_WRITE_OFTEN | GRALLOC_USAGE_SW_READ_OFTEN;
-        sp<GraphicBuffer> graphicBuffer = allocateBuffer(usage);
-        ASSERT_NE(nullptr, graphicBuffer);
+        const auto usage = static_cast<uint32_t>(common::BufferUsage::CPU_WRITE_OFTEN) |
+                           static_cast<uint32_t>(common::BufferUsage::CPU_READ_OFTEN);
+        const auto& [graphicBufferStatus, graphicBuffer] = allocateBuffer(usage);
+        ASSERT_TRUE(graphicBufferStatus);
         const auto& buffer = graphicBuffer->handle;
         mWriter->setLayerBuffer(getPrimaryDisplayId(), layer->getLayer(), /*slot*/ 0, buffer,
                                 /*acquireFence*/ -1);
@@ -702,7 +413,7 @@
         ReadbackHelper::fillColorsArea(expectedColors, getDisplayWidth(), coloredSquare, BLUE);
 
         ReadbackBuffer readbackBuffer(getPrimaryDisplayId(), mComposerClient, getDisplayWidth(),
-                                      getDisplayHeight(), mPixelFormat);
+                                      getDisplayHeight(), mPixelFormat, mDataspace);
         ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
 
         mWriter->validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp);
@@ -730,7 +441,7 @@
     }
 
     ReadbackBuffer readbackBuffer(getPrimaryDisplayId(), mComposerClient, getDisplayWidth(),
-                                  getDisplayHeight(), mPixelFormat);
+                                  getDisplayHeight(), mPixelFormat, mDataspace);
 
     ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
 }
@@ -743,9 +454,10 @@
         return;
     }
 
-    uint64_t usage = GRALLOC_USAGE_SW_WRITE_OFTEN | GRALLOC_USAGE_SW_READ_OFTEN;
-    sp<GraphicBuffer> graphicBuffer = allocateBuffer(usage);
-    ASSERT_NE(nullptr, graphicBuffer);
+    const auto usage = static_cast<uint32_t>(common::BufferUsage::CPU_WRITE_OFTEN) |
+                       static_cast<uint32_t>(common::BufferUsage::CPU_READ_OFTEN);
+    const auto& [graphicBufferStatus, graphicBuffer] = allocateBuffer(usage);
+    ASSERT_TRUE(graphicBufferStatus);
     const auto& bufferHandle = graphicBuffer->handle;
     ::ndk::ScopedFileDescriptor fence = ::ndk::ScopedFileDescriptor(-1);
 
@@ -827,7 +539,7 @@
         std::vector<std::shared_ptr<TestLayer>> layers = {layer};
 
         ReadbackBuffer readbackBuffer(getPrimaryDisplayId(), mComposerClient, getDisplayWidth(),
-                                      getDisplayHeight(), mPixelFormat);
+                                      getDisplayHeight(), mPixelFormat, mDataspace);
         ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
         writeLayers(layers);
         ASSERT_TRUE(mReader.takeErrors().empty());
@@ -840,14 +552,16 @@
             ASSERT_EQ(Composition::CLIENT, changedCompositionTypes[0].composition);
 
             PixelFormat clientFormat = PixelFormat::RGBA_8888;
-            auto clientUsage = GRALLOC_USAGE_HW_FB | GRALLOC_USAGE_SW_READ_OFTEN |
-                               GRALLOC_USAGE_SW_WRITE_OFTEN;
+            auto clientUsage = static_cast<uint32_t>(
+                    static_cast<uint32_t>(common::BufferUsage::CPU_READ_OFTEN) |
+                    static_cast<uint32_t>(common::BufferUsage::CPU_WRITE_OFTEN) |
+                    static_cast<uint32_t>(common::BufferUsage::COMPOSER_CLIENT_TARGET));
             Dataspace clientDataspace = ReadbackHelper::getDataspaceForColorMode(mode);
             common::Rect damage{0, 0, getDisplayWidth(), getDisplayHeight()};
 
             // create client target buffer
-            sp<GraphicBuffer> graphicBuffer = allocateBuffer(clientUsage);
-            ASSERT_NE(nullptr, graphicBuffer);
+            const auto& [graphicBufferStatus, graphicBuffer] = allocateBuffer(clientUsage);
+            ASSERT_TRUE(graphicBufferStatus);
             const auto& buffer = graphicBuffer->handle;
             void* clientBufData;
             const auto stride = static_cast<uint32_t>(graphicBuffer->stride);
@@ -904,7 +618,7 @@
                 {0, getDisplayHeight() / 2, getDisplayWidth(), getDisplayHeight()}, RED);
 
         ReadbackBuffer readbackBuffer(getPrimaryDisplayId(), mComposerClient, getDisplayWidth(),
-                                      getDisplayHeight(), mPixelFormat);
+                                      getDisplayHeight(), mPixelFormat, mDataspace);
         ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
 
         auto deviceLayer = std::make_shared<TestBufferLayer>(
@@ -923,8 +637,10 @@
         deviceLayer->write(*mWriter);
 
         PixelFormat clientFormat = PixelFormat::RGBA_8888;
-        auto clientUsage =
-                GRALLOC_USAGE_HW_FB | GRALLOC_USAGE_SW_READ_OFTEN | GRALLOC_USAGE_SW_WRITE_OFTEN;
+        auto clientUsage = static_cast<uint32_t>(
+                static_cast<uint64_t>(common::BufferUsage::CPU_READ_OFTEN) |
+                static_cast<uint32_t>(common::BufferUsage::CPU_WRITE_OFTEN) |
+                static_cast<uint32_t>(common::BufferUsage::COMPOSER_CLIENT_TARGET));
         Dataspace clientDataspace = ReadbackHelper::getDataspaceForColorMode(mode);
         int32_t clientWidth = getDisplayWidth();
         int32_t clientHeight = getDisplayHeight() / 2;
@@ -946,8 +662,8 @@
         }
         // create client target buffer
         ASSERT_EQ(Composition::CLIENT, changedCompositionTypes[0].composition);
-        sp<GraphicBuffer> graphicBuffer = allocateBuffer(clientUsage);
-        ASSERT_NE(nullptr, graphicBuffer);
+        const auto& [graphicBufferStatus, graphicBuffer] = allocateBuffer(clientUsage);
+        ASSERT_TRUE(graphicBufferStatus);
         const auto& buffer = graphicBuffer->handle;
 
         void* clientBufData;
@@ -1009,7 +725,7 @@
         std::vector<std::shared_ptr<TestLayer>> layers = {layer};
 
         ReadbackBuffer readbackBuffer(getPrimaryDisplayId(), mComposerClient, getDisplayWidth(),
-                                      getDisplayHeight(), mPixelFormat);
+                                      getDisplayHeight(), mPixelFormat, mDataspace);
         ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
 
         writeLayers(layers);
@@ -1077,7 +793,7 @@
         std::vector<std::shared_ptr<TestLayer>> layers = {layer};
 
         ReadbackBuffer readbackBuffer(getPrimaryDisplayId(), mComposerClient, getDisplayWidth(),
-                                      getDisplayHeight(), mPixelFormat);
+                                      getDisplayHeight(), mPixelFormat, mDataspace);
 
         ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
 
@@ -1143,7 +859,7 @@
         ReadbackHelper::fillColorsArea(expectedColors, getDisplayWidth(),
                                        {0, 0, getDisplayWidth(), getDisplayHeight()}, BLUE);
         ReadbackBuffer readbackBuffer(getPrimaryDisplayId(), mComposerClient, getDisplayWidth(),
-                                      getDisplayHeight(), mPixelFormat);
+                                      getDisplayHeight(), mPixelFormat, mDataspace);
         ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
         writeLayers(layers);
         ASSERT_TRUE(mReader.takeErrors().empty());
@@ -1200,7 +916,7 @@
         ReadbackHelper::fillColorsArea(expectedColors, getDisplayWidth(), redRect, RED);
 
         ReadbackBuffer readbackBuffer(getPrimaryDisplayId(), mComposerClient, getDisplayWidth(),
-                                      getDisplayHeight(), mPixelFormat);
+                                      getDisplayHeight(), mPixelFormat, mDataspace);
         ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
 
         writeLayers(layers);
@@ -1310,7 +1026,7 @@
         ReadbackHelper::fillColorsArea(expectedColors, getDisplayWidth(), dimmerRedRect, DIM_RED);
 
         ReadbackBuffer readbackBuffer(getPrimaryDisplayId(), mComposerClient, getDisplayWidth(),
-                                      getDisplayHeight(), mPixelFormat);
+                                      getDisplayHeight(), mPixelFormat, mDataspace);
         ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
 
         writeLayers(layers);
@@ -1446,7 +1162,7 @@
         setExpectedColors(expectedColors);
 
         ReadbackBuffer readbackBuffer(getPrimaryDisplayId(), mComposerClient, getDisplayWidth(),
-                                      getDisplayHeight(), mPixelFormat);
+                                      getDisplayHeight(), mPixelFormat, mDataspace);
         ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
         writeLayers(mLayers);
         ASSERT_TRUE(mReader.takeErrors().empty());
@@ -1491,7 +1207,7 @@
         setExpectedColors(expectedColors);
 
         ReadbackBuffer readbackBuffer(getPrimaryDisplayId(), mComposerClient, getDisplayWidth(),
-                                      getDisplayHeight(), mPixelFormat);
+                                      getDisplayHeight(), mPixelFormat, mDataspace);
         ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
         writeLayers(mLayers);
         ASSERT_TRUE(mReader.takeErrors().empty());
@@ -1531,7 +1247,7 @@
         setExpectedColors(expectedColors);
 
         ReadbackBuffer readbackBuffer(getPrimaryDisplayId(), mComposerClient, getDisplayWidth(),
-                                      getDisplayHeight(), mPixelFormat);
+                                      getDisplayHeight(), mPixelFormat, mDataspace);
         ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
         writeLayers(mLayers);
         ASSERT_TRUE(mReader.takeErrors().empty());
@@ -1605,7 +1321,7 @@
             return;
         }
         ReadbackBuffer readbackBuffer(getPrimaryDisplayId(), mComposerClient, getDisplayWidth(),
-                                      getDisplayHeight(), mPixelFormat);
+                                      getDisplayHeight(), mPixelFormat, mDataspace);
         ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
         mLayer->setTransform(Transform::FLIP_H);
         mLayer->setDataspace(ReadbackHelper::getDataspaceForColorMode(mode), *mWriter);
@@ -1650,7 +1366,7 @@
             return;
         }
         ReadbackBuffer readbackBuffer(getPrimaryDisplayId(), mComposerClient, getDisplayWidth(),
-                                      getDisplayHeight(), mPixelFormat);
+                                      getDisplayHeight(), mPixelFormat, mDataspace);
         ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
 
         mLayer->setTransform(Transform::FLIP_V);
@@ -1695,7 +1411,7 @@
             return;
         }
         ReadbackBuffer readbackBuffer(getPrimaryDisplayId(), mComposerClient, getDisplayWidth(),
-                                      getDisplayHeight(), mPixelFormat);
+                                      getDisplayHeight(), mPixelFormat, mDataspace);
         ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
 
         mLayer->setTransform(Transform::ROT_180);
diff --git a/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_TargetTest.cpp b/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_TargetTest.cpp
index 7b852e0..55e0a13 100644
--- a/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_TargetTest.cpp
+++ b/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_TargetTest.cpp
@@ -621,6 +621,63 @@
     }
 }
 
+TEST_P(GraphicsComposerAidlTest, GetHdrConversionCapabilities) {
+    if (!hasCapability(Capability::HDR_OUTPUT_CONVERSION_CONFIG)) {
+        GTEST_SUCCEED() << "HDR output conversion not supported";
+        return;
+    }
+    const auto& [status, conversionCapabilities] = mComposerClient->getHdrConversionCapabilities();
+    EXPECT_TRUE(status.isOk());
+}
+
+TEST_P(GraphicsComposerAidlTest, SetHdrConversionStrategy_Passthrough) {
+    if (!hasCapability(Capability::HDR_OUTPUT_CONVERSION_CONFIG)) {
+        GTEST_SUCCEED() << "HDR output conversion not supported";
+        return;
+    }
+    common::HdrConversionStrategy hdrConversionStrategy;
+    hdrConversionStrategy.set<common::HdrConversionStrategy::Tag::passthrough>(true);
+    const auto& status = mComposerClient->setHdrConversionStrategy(hdrConversionStrategy);
+    EXPECT_TRUE(status.isOk());
+}
+
+TEST_P(GraphicsComposerAidlTest, SetHdrConversionStrategy_Force) {
+    if (!hasCapability(Capability::HDR_OUTPUT_CONVERSION_CONFIG)) {
+        GTEST_SUCCEED() << "HDR output conversion not supported";
+        return;
+    }
+    const auto& [status, conversionCapabilities] = mComposerClient->getHdrConversionCapabilities();
+    for (auto conversionCapability : conversionCapabilities) {
+        if (conversionCapability.outputType) {
+            common::HdrConversionStrategy hdrConversionStrategy;
+            hdrConversionStrategy.set<common::HdrConversionStrategy::Tag::forceHdrConversion>(
+                    conversionCapability.outputType->hdr);
+            const auto& statusSet =
+                    mComposerClient->setHdrConversionStrategy(hdrConversionStrategy);
+            EXPECT_TRUE(status.isOk());
+        }
+    }
+}
+
+TEST_P(GraphicsComposerAidlTest, SetHdrConversionStrategy_Auto) {
+    if (!hasCapability(Capability::HDR_OUTPUT_CONVERSION_CONFIG)) {
+        GTEST_SUCCEED() << "HDR output conversion not supported";
+        return;
+    }
+    const auto& [status, conversionCapabilities] = mComposerClient->getHdrConversionCapabilities();
+    std::vector<aidl::android::hardware::graphics::common::Hdr> autoHdrTypes;
+    for (auto conversionCapability : conversionCapabilities) {
+        if (conversionCapability.outputType) {
+            autoHdrTypes.push_back(conversionCapability.outputType->hdr);
+        }
+    }
+    common::HdrConversionStrategy hdrConversionStrategy;
+    hdrConversionStrategy.set<common::HdrConversionStrategy::Tag::autoAllowedHdrTypes>(
+            autoHdrTypes);
+    const auto& statusSet = mComposerClient->setHdrConversionStrategy(hdrConversionStrategy);
+    EXPECT_TRUE(status.isOk());
+}
+
 TEST_P(GraphicsComposerAidlTest, SetAutoLowLatencyMode_BadDisplay) {
     auto status = mComposerClient->setAutoLowLatencyMode(getInvalidDisplayId(), /*isEnabled*/ true);
     EXPECT_FALSE(status.isOk());
@@ -812,7 +869,7 @@
 }
 
 TEST_P(GraphicsComposerAidlTest, GetOverlaySupport) {
-    const auto& [status, _] = mComposerClient->getOverlaySupport();
+    const auto& [status, properties] = mComposerClient->getOverlaySupport();
     if (!status.isOk() && status.getExceptionCode() == EX_SERVICE_SPECIFIC &&
         status.getServiceSpecificError() == IComposerClient::EX_UNSUPPORTED) {
         GTEST_SUCCEED() << "getOverlaySupport is not supported";
@@ -820,6 +877,23 @@
     }
 
     ASSERT_TRUE(status.isOk());
+    for (const auto& i : properties.combinations) {
+        for (const auto standard : i.standards) {
+            const auto val = static_cast<int32_t>(standard) &
+                             static_cast<int32_t>(common::Dataspace::STANDARD_MASK);
+            ASSERT_TRUE(val == static_cast<int32_t>(standard));
+        }
+        for (const auto transfer : i.transfers) {
+            const auto val = static_cast<int32_t>(transfer) &
+                             static_cast<int32_t>(common::Dataspace::TRANSFER_MASK);
+            ASSERT_TRUE(val == static_cast<int32_t>(transfer));
+        }
+        for (const auto range : i.ranges) {
+            const auto val = static_cast<int32_t>(range) &
+                             static_cast<int32_t>(common::Dataspace::RANGE_MASK);
+            ASSERT_TRUE(val == static_cast<int32_t>(range));
+        }
+    }
 }
 
 TEST_P(GraphicsComposerAidlTest, GetDisplayPhysicalOrientation_BadDisplay) {
@@ -1131,19 +1205,15 @@
         }
     }
 
-    sp<GraphicBuffer> allocate(uint32_t width, uint32_t height,
-                               ::android::PixelFormat pixelFormat) {
-        return sp<GraphicBuffer>::make(
-                width, height, pixelFormat, /*layerCount*/ 1U,
-                static_cast<uint64_t>(common::BufferUsage::CPU_WRITE_OFTEN) |
-                        static_cast<uint64_t>(common::BufferUsage::CPU_READ_OFTEN) |
-                        static_cast<uint64_t>(common::BufferUsage::COMPOSER_OVERLAY),
-                "VtsHalGraphicsComposer3_TargetTest");
-    }
-
     sp<GraphicBuffer> allocate(::android::PixelFormat pixelFormat) {
-        return allocate(static_cast<uint32_t>(getPrimaryDisplay().getDisplayWidth()),
-                        static_cast<uint32_t>(getPrimaryDisplay().getDisplayHeight()), pixelFormat);
+        return sp<GraphicBuffer>::make(
+                static_cast<uint32_t>(getPrimaryDisplay().getDisplayWidth()),
+                static_cast<uint32_t>(getPrimaryDisplay().getDisplayHeight()), pixelFormat,
+                /*layerCount*/ 1U,
+                (static_cast<uint64_t>(common::BufferUsage::CPU_WRITE_OFTEN) |
+                 static_cast<uint64_t>(common::BufferUsage::CPU_READ_OFTEN) |
+                 static_cast<uint64_t>(common::BufferUsage::COMPOSER_OVERLAY)),
+                "VtsHalGraphicsComposer3_TargetTest");
     }
 
     void sendRefreshFrame(const VtsDisplay& display, const VsyncPeriodChangeTimeline* timeline) {
@@ -1646,90 +1716,6 @@
     execute();
 }
 
-TEST_P(GraphicsComposerAidlCommandTest, SetLayerBufferWithSlotsToClear) {
-    const auto& [versionStatus, version] = mComposerClient->getInterfaceVersion();
-    ASSERT_TRUE(versionStatus.isOk());
-    if (version == 1) {
-        GTEST_SUCCEED() << "Device does not support the new API for clearing buffer slots";
-        return;
-    }
-
-    const auto& [layerStatus, layer] =
-            mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount);
-    EXPECT_TRUE(layerStatus.isOk());
-
-    auto& writer = getWriter(getPrimaryDisplayId());
-
-    const auto buffer1 = allocate(::android::PIXEL_FORMAT_RGBA_8888);
-    ASSERT_NE(nullptr, buffer1);
-    const auto handle1 = buffer1->handle;
-    writer.setLayerBuffer(getPrimaryDisplayId(), layer, /*slot*/ 0, handle1, /*acquireFence*/ -1);
-    execute();
-    ASSERT_TRUE(mReader.takeErrors().empty());
-
-    const auto buffer2 = allocate(::android::PIXEL_FORMAT_RGBA_8888);
-    ASSERT_NE(nullptr, buffer2);
-    const auto handle2 = buffer2->handle;
-    writer.setLayerBuffer(getPrimaryDisplayId(), layer, /*slot*/ 1, handle2, /*acquireFence*/ -1);
-    execute();
-    ASSERT_TRUE(mReader.takeErrors().empty());
-
-    // Ensure we can clear the buffer slots and then set the active slot with a new buffer
-    const auto buffer3 = allocate(::android::PIXEL_FORMAT_RGBA_8888);
-    ASSERT_NE(nullptr, buffer3);
-    const auto handle3 = buffer3->handle;
-    writer.setLayerBufferSlotsToClear(getPrimaryDisplayId(), layer, /*slotsToClear*/ {0, 1});
-    writer.setLayerBuffer(getPrimaryDisplayId(), layer, /*slot*/ 1, handle3, /*acquireFence*/ -1);
-    execute();
-    ASSERT_TRUE(mReader.takeErrors().empty());
-}
-
-TEST_P(GraphicsComposerAidlCommandTest, SetLayerBufferWithSlotsToClear_backwardsCompatible) {
-    const auto& [versionStatus, version] = mComposerClient->getInterfaceVersion();
-    ASSERT_TRUE(versionStatus.isOk());
-    if (version > 1) {
-        GTEST_SUCCEED() << "Device does not need a backwards compatible way to clear buffer slots";
-        return;
-    }
-
-    auto clearSlotBuffer = allocate(1u, 1u, ::android::PIXEL_FORMAT_RGB_888);
-    ASSERT_NE(nullptr, clearSlotBuffer);
-    auto clearSlotBufferHandle = clearSlotBuffer->handle;
-
-    const auto& [layerStatus, layer] =
-            mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount);
-    EXPECT_TRUE(layerStatus.isOk());
-
-    auto& writer = getWriter(getPrimaryDisplayId());
-
-    const auto buffer1 = allocate(::android::PIXEL_FORMAT_RGBA_8888);
-    ASSERT_NE(nullptr, buffer1);
-    const auto handle1 = buffer1->handle;
-    writer.setLayerBuffer(getPrimaryDisplayId(), layer, /*slot*/ 0, handle1, /*acquireFence*/ -1);
-    execute();
-    ASSERT_TRUE(mReader.takeErrors().empty());
-
-    const auto buffer2 = allocate(::android::PIXEL_FORMAT_RGBA_8888);
-    ASSERT_NE(nullptr, buffer2);
-    const auto handle2 = buffer2->handle;
-    EXPECT_TRUE(layerStatus.isOk());
-    writer.setLayerBuffer(getPrimaryDisplayId(), layer, /*slot*/ 1, handle2, /*acquireFence*/ -1);
-    execute();
-    ASSERT_TRUE(mReader.takeErrors().empty());
-
-    // Ensure we can clear a buffer slot and then set that same slot with a new buffer
-    const auto buffer3 = allocate(::android::PIXEL_FORMAT_RGBA_8888);
-    ASSERT_NE(nullptr, buffer3);
-    const auto handle3 = buffer2->handle;
-    // SurfaceFlinger will never clear the active buffer, instead it will clear non-active buffers
-    // and then re-use the active buffer's slot for the new buffer
-    writer.setLayerBufferWithNewCommand(getPrimaryDisplayId(), layer, /*slot*/ 0,
-                                        clearSlotBufferHandle, /*acquireFence*/ -1);
-    writer.setLayerBuffer(getPrimaryDisplayId(), layer, /*slot*/ 1, handle3, /*acquireFence*/ -1);
-    execute();
-    ASSERT_TRUE(mReader.takeErrors().empty());
-}
-
 TEST_P(GraphicsComposerAidlCommandTest, SetLayerSurfaceDamage) {
     const auto& [layerStatus, layer] =
             mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount);
@@ -2319,6 +2305,22 @@
     // TODO(b/251842321): Try to present on multiple threads.
 }
 
+/**
+ * Test Capability::SKIP_VALIDATE
+ *
+ * Capability::SKIP_VALIDATE has been deprecated and should not be enabled.
+ */
+TEST_P(GraphicsComposerAidlCommandTest, SkipValidateDeprecatedTest) {
+    const auto& [versionStatus, version] = mComposerClient->getInterfaceVersion();
+    ASSERT_TRUE(versionStatus.isOk());
+    if (version <= 1) {
+        GTEST_SUCCEED() << "HAL at version 1 or lower can contain Capability::SKIP_VALIDATE.";
+        return;
+    }
+    ASSERT_FALSE(hasCapability(Capability::SKIP_VALIDATE))
+            << "Found Capability::SKIP_VALIDATE capability.";
+}
+
 GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(GraphicsComposerAidlCommandTest);
 INSTANTIATE_TEST_SUITE_P(
         PerInstance, GraphicsComposerAidlCommandTest,
@@ -2378,4 +2380,4 @@
     }
 
     return RUN_ALL_TESTS();
-}
+}
\ No newline at end of file
diff --git a/graphics/mapper/4.0/vts/functional/VtsHalGraphicsMapperV4_0TargetTest.cpp b/graphics/mapper/4.0/vts/functional/VtsHalGraphicsMapperV4_0TargetTest.cpp
index 5a450e3..1e7cb8e 100644
--- a/graphics/mapper/4.0/vts/functional/VtsHalGraphicsMapperV4_0TargetTest.cpp
+++ b/graphics/mapper/4.0/vts/functional/VtsHalGraphicsMapperV4_0TargetTest.cpp
@@ -952,7 +952,6 @@
     EXPECT_EQ(PlaneLayoutComponentType::RAW,
               static_cast<PlaneLayoutComponentType>(planeLayoutComponent.type.value));
     EXPECT_EQ(0, planeLayoutComponent.offsetInBits % 8);
-    EXPECT_EQ(-1, planeLayoutComponent.sizeInBits);
 
     ASSERT_NO_FATAL_FAILURE(fence.reset(mGralloc->unlock(bufferHandle)));
 }
@@ -994,7 +993,6 @@
     EXPECT_EQ(PlaneLayoutComponentType::RAW,
               static_cast<PlaneLayoutComponentType>(planeLayoutComponent.type.value));
     EXPECT_EQ(0, planeLayoutComponent.offsetInBits % 8);
-    EXPECT_EQ(-1, planeLayoutComponent.sizeInBits);
 
     ASSERT_NO_FATAL_FAILURE(fence.reset(mGralloc->unlock(bufferHandle)));
 }
diff --git a/graphics/mapper/stable-c/README.md b/graphics/mapper/stable-c/README.md
index 30f3ccc..0b9b499 100644
--- a/graphics/mapper/stable-c/README.md
+++ b/graphics/mapper/stable-c/README.md
@@ -15,7 +15,6 @@
         <name>mapper</name>
         <version>5.0</version>
         <interface>
-            <name>I</name>
             <instance>minigbm</instance>
         </interface>
     </hal>
diff --git a/graphics/mapper/stable-c/implutils/impltests.cpp b/graphics/mapper/stable-c/implutils/impltests.cpp
index f12b069..01a1db9 100644
--- a/graphics/mapper/stable-c/implutils/impltests.cpp
+++ b/graphics/mapper/stable-c/implutils/impltests.cpp
@@ -359,35 +359,35 @@
     auto mpbuf = encode<StandardMetadataType::BUFFER_ID>(42);
     hidl_vec<uint8_t> g4buf;
     ASSERT_EQ(NO_ERROR, gralloc4::encodeBufferId(42, &g4buf));
-    EXPECT_EQ(mpbuf, g4buf);
+    EXPECT_EQ(g4buf, mpbuf);
 }
 
 TEST(MetadataGralloc4Interop, Name) {
     auto mpbuf = encode<StandardMetadataType::NAME>("Hello, Interop!");
     hidl_vec<uint8_t> g4buf;
     ASSERT_EQ(NO_ERROR, gralloc4::encodeName("Hello, Interop!", &g4buf));
-    EXPECT_EQ(mpbuf, g4buf);
+    EXPECT_EQ(g4buf, mpbuf);
 }
 
 TEST(MetadataGralloc4Interop, Width) {
     auto mpbuf = encode<StandardMetadataType::WIDTH>(128);
     hidl_vec<uint8_t> g4buf;
     ASSERT_EQ(NO_ERROR, gralloc4::encodeWidth(128, &g4buf));
-    EXPECT_EQ(mpbuf, g4buf);
+    EXPECT_EQ(g4buf, mpbuf);
 }
 
 TEST(MetadataGralloc4Interop, Height) {
     auto mpbuf = encode<StandardMetadataType::HEIGHT>(64);
     hidl_vec<uint8_t> g4buf;
     ASSERT_EQ(NO_ERROR, gralloc4::encodeHeight(64, &g4buf));
-    EXPECT_EQ(mpbuf, g4buf);
+    EXPECT_EQ(g4buf, mpbuf);
 }
 
 TEST(MetadataGralloc4Interop, LayerCount) {
     auto mpbuf = encode<StandardMetadataType::LAYER_COUNT>(3);
     hidl_vec<uint8_t> g4buf;
     ASSERT_EQ(NO_ERROR, gralloc4::encodeLayerCount(3, &g4buf));
-    EXPECT_EQ(mpbuf, g4buf);
+    EXPECT_EQ(g4buf, mpbuf);
 }
 
 TEST(MetadataGralloc4Interop, PixelFormatRequested) {
@@ -395,21 +395,21 @@
     hidl_vec<uint8_t> g4buf;
     ASSERT_EQ(NO_ERROR, gralloc4::encodePixelFormatRequested(
                                 hardware::graphics::common::V1_2::PixelFormat::RGBX_8888, &g4buf));
-    EXPECT_EQ(mpbuf, g4buf);
+    EXPECT_EQ(g4buf, mpbuf);
 }
 
 TEST(MetadataGralloc4Interop, PixelFormatFourcc) {
     auto mpbuf = encode<StandardMetadataType::PIXEL_FORMAT_FOURCC>(DRM_FORMAT_ABGR8888);
     hidl_vec<uint8_t> g4buf;
     ASSERT_EQ(NO_ERROR, gralloc4::encodePixelFormatFourCC(DRM_FORMAT_ABGR8888, &g4buf));
-    EXPECT_EQ(mpbuf, g4buf);
+    EXPECT_EQ(g4buf, mpbuf);
 }
 
 TEST(MetadataGralloc4Interop, PixelFormatModifier) {
     auto mpbuf = encode<StandardMetadataType::PIXEL_FORMAT_MODIFIER>(123456);
     hidl_vec<uint8_t> g4buf;
     ASSERT_EQ(NO_ERROR, gralloc4::encodePixelFormatModifier(123456, &g4buf));
-    EXPECT_EQ(mpbuf, g4buf);
+    EXPECT_EQ(g4buf, mpbuf);
 }
 
 TEST(MetadataGralloc4Interop, Usage) {
@@ -420,21 +420,21 @@
                       static_cast<uint64_t>(
                               hardware::graphics::common::V1_2::BufferUsage::COMPOSER_OVERLAY),
                       &g4buf));
-    EXPECT_EQ(mpbuf, g4buf);
+    EXPECT_EQ(g4buf, mpbuf);
 }
 
 TEST(MetadataGralloc4Interop, AllocationSize) {
     auto mpbuf = encode<StandardMetadataType::ALLOCATION_SIZE>(10200);
     hidl_vec<uint8_t> g4buf;
     ASSERT_EQ(NO_ERROR, gralloc4::encodeAllocationSize(10200, &g4buf));
-    EXPECT_EQ(mpbuf, g4buf);
+    EXPECT_EQ(g4buf, mpbuf);
 }
 
 TEST(MetadataGralloc4Interop, ProtectedContent) {
     auto mpbuf = encode<StandardMetadataType::PROTECTED_CONTENT>(1);
     hidl_vec<uint8_t> g4buf;
     ASSERT_EQ(NO_ERROR, gralloc4::encodeProtectedContent(1, &g4buf));
-    EXPECT_EQ(mpbuf, g4buf);
+    EXPECT_EQ(g4buf, mpbuf);
 }
 
 TEST(MetadataGralloc4Interop, Compression) {
@@ -443,14 +443,14 @@
     hidl_vec<uint8_t> g4buf;
     ASSERT_EQ(NO_ERROR,
               gralloc4::encodeCompression(gralloc4::Compression_DisplayStreamCompression, &g4buf));
-    EXPECT_EQ(mpbuf, g4buf);
+    EXPECT_EQ(g4buf, mpbuf);
 }
 
 TEST(MetadataGralloc4Interop, Interlaced) {
     auto mpbuf = encode<StandardMetadataType::INTERLACED>(gralloc4::Interlaced_TopBottom);
     hidl_vec<uint8_t> g4buf;
     ASSERT_EQ(NO_ERROR, gralloc4::encodeInterlaced(gralloc4::Interlaced_TopBottom, &g4buf));
-    EXPECT_EQ(mpbuf, g4buf);
+    EXPECT_EQ(g4buf, mpbuf);
 }
 
 TEST(MetadataGralloc4Interop, ChromeSitting) {
@@ -459,14 +459,14 @@
     hidl_vec<uint8_t> g4buf;
     ASSERT_EQ(NO_ERROR,
               gralloc4::encodeChromaSiting(gralloc4::ChromaSiting_SitedInterstitial, &g4buf));
-    EXPECT_EQ(mpbuf, g4buf);
+    EXPECT_EQ(g4buf, mpbuf);
 }
 
 TEST(MetadataGralloc4Interop, PlaneLayouts) {
     auto mpbuf = encode<StandardMetadataType::PLANE_LAYOUTS>(fakePlaneLayouts());
     hidl_vec<uint8_t> g4buf;
     ASSERT_EQ(NO_ERROR, gralloc4::encodePlaneLayouts(fakePlaneLayouts(), &g4buf));
-    EXPECT_EQ(mpbuf, g4buf);
+    EXPECT_EQ(g4buf, mpbuf);
 }
 
 TEST(MetadataGralloc4Interop, Crop) {
@@ -474,21 +474,21 @@
     auto mpbuf = encode<StandardMetadataType::CROP>(cropRects);
     hidl_vec<uint8_t> g4buf;
     ASSERT_EQ(NO_ERROR, gralloc4::encodeCrop(cropRects, &g4buf));
-    EXPECT_EQ(mpbuf, g4buf);
+    EXPECT_EQ(g4buf, mpbuf);
 }
 
 TEST(MetadataGralloc4Interop, Dataspace) {
     auto mpbuf = encode<StandardMetadataType::DATASPACE>(Dataspace::DISPLAY_P3);
     hidl_vec<uint8_t> g4buf;
     ASSERT_EQ(NO_ERROR, gralloc4::encodeDataspace(Dataspace::DISPLAY_P3, &g4buf));
-    EXPECT_EQ(mpbuf, g4buf);
+    EXPECT_EQ(g4buf, mpbuf);
 }
 
 TEST(MetadataGralloc4Interop, BlendMode) {
     auto mpbuf = encode<StandardMetadataType::BLEND_MODE>(BlendMode::PREMULTIPLIED);
     hidl_vec<uint8_t> g4buf;
     ASSERT_EQ(NO_ERROR, gralloc4::encodeBlendMode(BlendMode::PREMULTIPLIED, &g4buf));
-    EXPECT_EQ(mpbuf, g4buf);
+    EXPECT_EQ(g4buf, mpbuf);
 }
 
 TEST(MetadataGralloc4Interop, Smpte2086) {
@@ -498,7 +498,7 @@
     auto mpbuf = encode<StandardMetadataType::SMPTE2086>(hdrdata);
     hidl_vec<uint8_t> g4buf;
     ASSERT_EQ(NO_ERROR, gralloc4::encodeSmpte2086(hdrdata, &g4buf));
-    EXPECT_EQ(mpbuf, g4buf);
+    EXPECT_EQ(g4buf, mpbuf);
 }
 
 TEST(MetadataGralloc4Interop, Cta861_3) {
@@ -506,29 +506,29 @@
     auto mpbuf = encode<StandardMetadataType::CTA861_3>(hdrdata);
     hidl_vec<uint8_t> g4buf;
     ASSERT_EQ(NO_ERROR, gralloc4::encodeCta861_3(hdrdata, &g4buf));
-    EXPECT_EQ(mpbuf, g4buf);
+    EXPECT_EQ(g4buf, mpbuf);
 }
 
 TEST(MetadataGralloc4Interop, Smpte2094_10) {
     auto mpbuf = encode<StandardMetadataType::SMPTE2094_10>(std::nullopt);
     hidl_vec<uint8_t> g4buf;
     ASSERT_EQ(NO_ERROR, gralloc4::encodeSmpte2094_10(std::nullopt, &g4buf));
-    EXPECT_EQ(mpbuf, g4buf);
+    EXPECT_EQ(g4buf, mpbuf);
 
     std::vector<uint8_t> hdrdata{1, 2, 3, 4, 5, 6};
     mpbuf = encode<StandardMetadataType::SMPTE2094_10>(hdrdata);
     ASSERT_EQ(NO_ERROR, gralloc4::encodeSmpte2094_10(hdrdata, &g4buf));
-    EXPECT_EQ(mpbuf, g4buf);
+    EXPECT_EQ(g4buf, mpbuf);
 }
 
 TEST(MetadataGralloc4Interop, Smpte2094_40) {
     auto mpbuf = encode<StandardMetadataType::SMPTE2094_40>(std::nullopt);
     hidl_vec<uint8_t> g4buf;
     ASSERT_EQ(NO_ERROR, gralloc4::encodeSmpte2094_40(std::nullopt, &g4buf));
-    EXPECT_EQ(mpbuf, g4buf);
+    EXPECT_EQ(g4buf, mpbuf);
 
     std::vector<uint8_t> hdrdata{1, 2, 3, 4, 5, 6};
     mpbuf = encode<StandardMetadataType::SMPTE2094_40>(hdrdata);
     ASSERT_EQ(NO_ERROR, gralloc4::encodeSmpte2094_40(hdrdata, &g4buf));
-    EXPECT_EQ(mpbuf, g4buf);
+    EXPECT_EQ(g4buf, mpbuf);
 }
diff --git a/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h b/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h
index e9dea1a..75e436d 100644
--- a/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h
+++ b/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h
@@ -239,7 +239,9 @@
      * acceptable.
      *
      * 1D buffers (width = size in bytes, height = 1, pixel_format = BLOB) must
-     * "lock in place". The buffers must be directly accessible via mapping.
+     * "lock in place" and behave similar to shared memory. That is, multiple threads or processes
+     * may lock the buffer for reading & writing and the results must follow the device's memory
+     * model.
      *
      * The client must not modify the content of the buffer outside of
      * @p accessRegion, and the device need not guarantee that content outside
diff --git a/health/aidl/Android.bp b/health/aidl/Android.bp
index a4d4ace..6d4f914 100644
--- a/health/aidl/Android.bp
+++ b/health/aidl/Android.bp
@@ -46,8 +46,8 @@
 
 }
 
-cc_library {
-    name: "android.hardware.health-translate-ndk",
+cc_defaults {
+    name: "android.hardware.health-translate-ndk_defaults",
     vendor_available: true,
     recovery_available: true,
     host_supported: true,
@@ -55,7 +55,6 @@
     shared_libs: [
         "libbinder_ndk",
         "libhidlbase",
-        "android.hardware.health-V1-ndk",
         "android.hardware.health@2.0",
         "android.hardware.health@2.1",
     ],
@@ -71,11 +70,28 @@
     },
 }
 
+cc_library {
+    name: "android.hardware.health-translate-ndk",
+    defaults: ["android.hardware.health-translate-ndk_defaults"],
+    shared_libs: [
+        "android.hardware.health-V2-ndk",
+    ],
+}
+
+// TODO(b/251425963): remove when android.hardware.health is upgraded to V2.
+cc_library {
+    name: "android.hardware.health-translate-V1-ndk",
+    defaults: ["android.hardware.health-translate-ndk_defaults"],
+    shared_libs: [
+        "android.hardware.health-V1-ndk",
+    ],
+}
+
 java_library {
     name: "android.hardware.health-translate-java",
     srcs: ["android/hardware/health/Translate.java"],
     libs: [
-        "android.hardware.health-V1-java",
+        "android.hardware.health-V2-java",
         "android.hardware.health-V2.0-java",
         "android.hardware.health-V2.1-java",
     ],
diff --git a/audio/aidl/aidl_api/android.hardware.audio.core/current/android/hardware/audio/core/AudioMode.aidl b/health/aidl/aidl_api/android.hardware.health/current/android/hardware/health/BatteryChargingPolicy.aidl
similarity index 91%
copy from audio/aidl/aidl_api/android.hardware.audio.core/current/android/hardware/audio/core/AudioMode.aidl
copy to health/aidl/aidl_api/android.hardware.health/current/android/hardware/health/BatteryChargingPolicy.aidl
index 336f9b5..42fbf95 100644
--- a/audio/aidl/aidl_api/android.hardware.audio.core/current/android/hardware/audio/core/AudioMode.aidl
+++ b/health/aidl/aidl_api/android.hardware.health/current/android/hardware/health/BatteryChargingPolicy.aidl
@@ -31,12 +31,11 @@
 // with such a backward incompatible change, it has a high risk of breaking
 // later when a module using the interface is updated, e.g., Mainline modules.
 
-package android.hardware.audio.core;
+package android.hardware.health;
 @Backing(type="int") @VintfStability
-enum AudioMode {
-  NORMAL = 0,
-  RINGTONE = 1,
-  IN_CALL = 2,
-  IN_COMMUNICATION = 3,
-  CALL_SCREEN = 4,
+enum BatteryChargingPolicy {
+  INVALID = 0,
+  DEFAULT = 1,
+  LONG_LIFE = 2,
+  ADAPTIVE = 3,
 }
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleAreaMirror.aidl b/health/aidl/aidl_api/android.hardware.health/current/android/hardware/health/BatteryChargingState.aidl
similarity index 91%
copy from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleAreaMirror.aidl
copy to health/aidl/aidl_api/android.hardware.health/current/android/hardware/health/BatteryChargingState.aidl
index c1e2fbd..e21eb28 100644
--- a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleAreaMirror.aidl
+++ b/health/aidl/aidl_api/android.hardware.health/current/android/hardware/health/BatteryChargingState.aidl
@@ -31,10 +31,13 @@
 // with such a backward incompatible change, it has a high risk of breaking
 // later when a module using the interface is updated, e.g., Mainline modules.
 
-package android.hardware.automotive.vehicle;
+package android.hardware.health;
 @Backing(type="int") @VintfStability
-enum VehicleAreaMirror {
-  DRIVER_LEFT = 1,
-  DRIVER_RIGHT = 2,
-  DRIVER_CENTER = 4,
+enum BatteryChargingState {
+  INVALID = 0,
+  NORMAL = 1,
+  TOO_COLD = 2,
+  TOO_HOT = 3,
+  LONG_LIFE = 4,
+  ADAPTIVE = 5,
 }
diff --git a/health/aidl/aidl_api/android.hardware.health/current/android/hardware/health/BatteryHealth.aidl b/health/aidl/aidl_api/android.hardware.health/current/android/hardware/health/BatteryHealth.aidl
index 4ce7952..8d13198 100644
--- a/health/aidl/aidl_api/android.hardware.health/current/android/hardware/health/BatteryHealth.aidl
+++ b/health/aidl/aidl_api/android.hardware.health/current/android/hardware/health/BatteryHealth.aidl
@@ -41,4 +41,7 @@
   OVER_VOLTAGE = 5,
   UNSPECIFIED_FAILURE = 6,
   COLD = 7,
+  FAIR = 8,
+  NOT_AVAILABLE = 11,
+  INCONSISTENT = 12,
 }
diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/AnbrBitrate.aidl b/health/aidl/aidl_api/android.hardware.health/current/android/hardware/health/BatteryHealthData.aidl
similarity index 91%
copy from radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/AnbrBitrate.aidl
copy to health/aidl/aidl_api/android.hardware.health/current/android/hardware/health/BatteryHealthData.aidl
index 711ac19..d523fad 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/AnbrBitrate.aidl
+++ b/health/aidl/aidl_api/android.hardware.health/current/android/hardware/health/BatteryHealthData.aidl
@@ -31,10 +31,9 @@
 // with such a backward incompatible change, it has a high risk of breaking
 // later when a module using the interface is updated, e.g., Mainline modules.
 
-package android.hardware.radio.ims.media;
+package android.hardware.health;
 @VintfStability
-parcelable AnbrBitrate {
-  int uplinkBps;
-  int downlinkBps;
-  const int INVALID_ANBR_BITRATE = -1;
+parcelable BatteryHealthData {
+  long batteryManufacturingDateSeconds;
+  long batteryFirstUsageSeconds;
 }
diff --git a/health/aidl/aidl_api/android.hardware.health/current/android/hardware/health/HealthInfo.aidl b/health/aidl/aidl_api/android.hardware.health/current/android/hardware/health/HealthInfo.aidl
index 97d9e84..664cc70 100644
--- a/health/aidl/aidl_api/android.hardware.health/current/android/hardware/health/HealthInfo.aidl
+++ b/health/aidl/aidl_api/android.hardware.health/current/android/hardware/health/HealthInfo.aidl
@@ -57,5 +57,9 @@
   android.hardware.health.BatteryCapacityLevel batteryCapacityLevel;
   long batteryChargeTimeToFullNowSeconds;
   int batteryFullChargeDesignCapacityUah;
+  int batteryStateOfHealth;
+  android.hardware.health.BatteryChargingState chargingState;
+  android.hardware.health.BatteryChargingPolicy chargingPolicy;
+  @nullable android.hardware.health.BatteryHealthData batteryHealthData;
   const int BATTERY_CHARGE_TIME_TO_FULL_NOW_SECONDS_UNSUPPORTED = -1;
 }
diff --git a/health/aidl/aidl_api/android.hardware.health/current/android/hardware/health/IHealth.aidl b/health/aidl/aidl_api/android.hardware.health/current/android/hardware/health/IHealth.aidl
index 7016ae4..b49dfff 100644
--- a/health/aidl/aidl_api/android.hardware.health/current/android/hardware/health/IHealth.aidl
+++ b/health/aidl/aidl_api/android.hardware.health/current/android/hardware/health/IHealth.aidl
@@ -46,6 +46,9 @@
   android.hardware.health.StorageInfo[] getStorageInfo();
   android.hardware.health.DiskStats[] getDiskStats();
   android.hardware.health.HealthInfo getHealthInfo();
+  void setChargingPolicy(android.hardware.health.BatteryChargingPolicy in_value);
+  android.hardware.health.BatteryChargingPolicy getChargingPolicy();
+  android.hardware.health.BatteryHealthData getBatteryHealthData();
   const int STATUS_UNKNOWN = 2;
   const int STATUS_CALLBACK_DIED = 4;
 }
diff --git a/radio/aidl/android/hardware/radio/ims/media/AnbrBitrate.aidl b/health/aidl/android/hardware/health/BatteryChargingPolicy.aidl
similarity index 63%
copy from radio/aidl/android/hardware/radio/ims/media/AnbrBitrate.aidl
copy to health/aidl/android/hardware/health/BatteryChargingPolicy.aidl
index 61239d0..0aeee41 100644
--- a/radio/aidl/android/hardware/radio/ims/media/AnbrBitrate.aidl
+++ b/health/aidl/android/hardware/health/BatteryChargingPolicy.aidl
@@ -14,15 +14,25 @@
  * limitations under the License.
  */
 
-package android.hardware.radio.ims.media;
+package android.hardware.health;
 
+/**
+ * Battery charging policy.
+ */
 @VintfStability
-parcelable AnbrBitrate {
-    /** default value to represent NOT_SET */
-    const int INVALID_ANBR_BITRATE = -1;
-
-    /** Received bitrate in seconds for Uplink from NW or peer UE for ANBR */
-    int uplinkBps;
-    /** Received bitrate in secondsfor Downlink from NW or peer UE for ANBR */
-    int downlinkBps;
+@Backing(type="int")
+enum BatteryChargingPolicy {
+    INVALID = 0,
+    /**
+     * default policy
+     */
+    DEFAULT = 1,
+    /**
+     * @see BatteryChargingState.LONG_LIFE
+     */
+    LONG_LIFE = 2,
+    /**
+     * @see BatteryChargingState.ADAPTIVE
+     */
+    ADAPTIVE = 3,
 }
diff --git a/health/aidl/android/hardware/health/BatteryChargingState.aidl b/health/aidl/android/hardware/health/BatteryChargingState.aidl
new file mode 100644
index 0000000..af62077
--- /dev/null
+++ b/health/aidl/android/hardware/health/BatteryChargingState.aidl
@@ -0,0 +1,52 @@
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.health;
+
+/**
+ * Possible values for Battery Health.
+ * Note: These are currently in sync with BatteryManager and must not
+ * be extended / altered.
+ */
+@VintfStability
+@Backing(type="int")
+enum BatteryChargingState {
+    INVALID = 0,
+    /**
+     * Default state.
+     */
+    NORMAL = 1,
+    /**
+     * Reported when the battery is too cold to charge at a normal
+     * rate or stopped charging due to low temperature.
+     */
+    TOO_COLD = 2,
+    /**
+     * Reported when the battery is too hot to charge at a normal
+     * rate or stopped charging due to hot temperature.
+     */
+    TOO_HOT = 3,
+    /**
+     * The device is using a special charging profile that designed
+     * to prevent accelerated aging.
+     */
+    LONG_LIFE = 4,
+    /**
+     * The device is using a special charging profile designed to
+     * improve battery cycle life, performances or both.
+     */
+    ADAPTIVE = 5,
+}
diff --git a/health/aidl/android/hardware/health/BatteryHealth.aidl b/health/aidl/android/hardware/health/BatteryHealth.aidl
index 2b6e51f..65abdc2 100644
--- a/health/aidl/android/hardware/health/BatteryHealth.aidl
+++ b/health/aidl/android/hardware/health/BatteryHealth.aidl
@@ -24,8 +24,15 @@
 @VintfStability
 @Backing(type="int")
 enum BatteryHealth {
+    /**
+     * Battery health is not supported from the device.
+     */
     UNKNOWN = 1,
     GOOD = 2,
+    /**
+     * Must be consistent with BatteryChargingState.
+     * If BatteryHealth is OVERHEAT, then BatteryChargingState must be TOO_HOT.
+     */
     OVERHEAT = 3,
     DEAD = 4,
     OVER_VOLTAGE = 5,
@@ -33,5 +40,28 @@
      * Battery experienced an unknown/unspecified failure.
      */
     UNSPECIFIED_FAILURE = 6,
+    /**
+     * Must be consistent with BatteryChargingState.
+     * If BatteryHealth is COLD, then BatteryChargingState must be TOO_COLD.
+     */
     COLD = 7,
+    /**
+     * Battery health is marginal.
+     */
+    FAIR = 8,
+    /**
+     * The reserve data below 10 are used to recognize the battery real health.
+     */
+    /**
+     * There is not enough information to determine an accurate
+     * value. The value might become UNSPECIFIED_FAILURE, DEAD
+     * or any other state except for UNKNOWN later.
+     */
+    NOT_AVAILABLE = 11,
+    /**
+     * The internal data is inconsistent and the battery needs to
+     * go through a recalibration process. The value might become
+     * UNSPECIFIED_FAILURE, DEAD or any other state except for UNKNOWN later.
+     */
+    INCONSISTENT = 12,
 }
diff --git a/radio/aidl/android/hardware/radio/ims/media/AnbrBitrate.aidl b/health/aidl/android/hardware/health/BatteryHealthData.aidl
similarity index 63%
copy from radio/aidl/android/hardware/radio/ims/media/AnbrBitrate.aidl
copy to health/aidl/android/hardware/health/BatteryHealthData.aidl
index 61239d0..fb17f63 100644
--- a/radio/aidl/android/hardware/radio/ims/media/AnbrBitrate.aidl
+++ b/health/aidl/android/hardware/health/BatteryHealthData.aidl
@@ -14,15 +14,19 @@
  * limitations under the License.
  */
 
-package android.hardware.radio.ims.media;
+package android.hardware.health;
 
+/*
+ * Battery health data
+ */
 @VintfStability
-parcelable AnbrBitrate {
-    /** default value to represent NOT_SET */
-    const int INVALID_ANBR_BITRATE = -1;
-
-    /** Received bitrate in seconds for Uplink from NW or peer UE for ANBR */
-    int uplinkBps;
-    /** Received bitrate in secondsfor Downlink from NW or peer UE for ANBR */
-    int downlinkBps;
+parcelable BatteryHealthData {
+    /**
+     * Battery manufacturing date is reported in epoch.
+     */
+    long batteryManufacturingDateSeconds;
+    /**
+     * The date of first usage is reported in epoch.
+     */
+    long batteryFirstUsageSeconds;
 }
diff --git a/health/aidl/android/hardware/health/HealthInfo.aidl b/health/aidl/android/hardware/health/HealthInfo.aidl
index 5b98baf..238f524 100644
--- a/health/aidl/android/hardware/health/HealthInfo.aidl
+++ b/health/aidl/android/hardware/health/HealthInfo.aidl
@@ -17,7 +17,10 @@
 package android.hardware.health;
 
 import android.hardware.health.BatteryCapacityLevel;
+import android.hardware.health.BatteryChargingPolicy;
+import android.hardware.health.BatteryChargingState;
 import android.hardware.health.BatteryHealth;
+import android.hardware.health.BatteryHealthData;
 import android.hardware.health.BatteryStatus;
 import android.hardware.health.DiskStats;
 import android.hardware.health.StorageInfo;
@@ -133,4 +136,23 @@
      * Value must be less than 100 000 000 µAh if known.
      */
     int batteryFullChargeDesignCapacityUah;
+    /**
+     * Measured battery state of health (remaining estimate full charge capacity
+     * relative to the rated capacity in %).
+     * Value must be 0 if batteryStatus is UNKNOWN.
+     * Otherwise, value must be in the range 0 to 100.
+     */
+    int batteryStateOfHealth;
+    /**
+     * Battery charging state
+     */
+    BatteryChargingState chargingState;
+    /**
+     * Battery charging policy. See {@link BatteryChargingPolicy} for more details.
+     */
+    BatteryChargingPolicy chargingPolicy;
+    /**
+     * Battery health data
+     */
+    @nullable BatteryHealthData batteryHealthData;
 }
diff --git a/health/aidl/android/hardware/health/IHealth.aidl b/health/aidl/android/hardware/health/IHealth.aidl
index d541eca..bdfe07a 100644
--- a/health/aidl/android/hardware/health/IHealth.aidl
+++ b/health/aidl/android/hardware/health/IHealth.aidl
@@ -16,6 +16,8 @@
 
 package android.hardware.health;
 
+import android.hardware.health.BatteryChargingPolicy;
+import android.hardware.health.BatteryHealthData;
 import android.hardware.health.BatteryStatus;
 import android.hardware.health.DiskStats;
 import android.hardware.health.HealthInfo;
@@ -102,7 +104,7 @@
      *           if this property is not supported
      *                 (e.g. the file that stores this property does not exist),
      *         - Return service specific error with code STATUS_UNKNOWN
-     *           for for other errors.
+     *           for other errors.
      */
     int getCurrentNowMicroamps();
 
@@ -120,7 +122,7 @@
      *           if this property is not supported
      *                 (e.g. the file that stores this property does not exist),
      *         - Return service specific error with code STATUS_UNKNOWN
-     *           for for other errors.
+     *           for other errors.
      */
     int getCurrentAverageMicroamps();
 
@@ -134,7 +136,7 @@
      *           if this property is not supported
      *                 (e.g. the file that stores this property does not exist),
      *         - Return service specific error with code STATUS_UNKNOWN
-     *           for for other errors.
+     *           for other errors.
      */
     int getCapacity();
 
@@ -146,7 +148,7 @@
      *         - Return exception with code EX_UNSUPPORTED_OPERATION
      *           if this property is not supported,
      *         - Return service specific error with code STATUS_UNKNOWN
-     *           for for other errors.
+     *           for other errors.
      */
     long getEnergyCounterNwh();
 
@@ -197,7 +199,47 @@
      *         - Return exception with code EX_UNSUPPORTED_OPERATION
      *           if this API is not supported,
      *         - Return service specific error with code STATUS_UNKNOWN
-     *           for for other errors.
+     *           for other errors.
      */
     HealthInfo getHealthInfo();
+
+    /**
+     * Set battery charging policy
+     *
+     * @return If error, return service specific error with code:
+     *         - Return exception with code EX_UNSUPPORTED_OPERATION
+     *           if this property is not supported
+     *                 (e.g. the file that stores this property does not exist),
+     *         - Return status with code INVALID_OPERATION
+     *           if the operation failed.
+     *         - Return service specific error with code STATUS_UNKNOWN
+     *           for other errors.
+     */
+    void setChargingPolicy(BatteryChargingPolicy in_value);
+
+    /**
+     * Get current battery charging policy
+     *
+     * @return current battery charging policy if successful.
+     *         If error:
+     *         - Return exception with code EX_UNSUPPORTED_OPERATION
+     *           if this property is not supported
+     *                 (e.g. the file that stores this property does not exist),
+     *         - Return service specific error with code STATUS_UNKNOWN
+     *           for other errors.
+     */
+    BatteryChargingPolicy getChargingPolicy();
+
+    /**
+     * Get battery health data
+     *
+     * @return Battery health data if successful.
+     *         If error:
+     *         - Return exception with code EX_UNSUPPORTED_OPERATION
+     *           if this property is not supported
+     *                 (e.g. the file that stores this property does not exist),
+     *         - Return service specific error with code STATUS_UNKNOWN
+     *           for other errors.
+     */
+    BatteryHealthData getBatteryHealthData();
 }
diff --git a/health/aidl/default/Android.bp b/health/aidl/default/Android.bp
index 4eb3cb1..b51e4f3 100644
--- a/health/aidl/default/Android.bp
+++ b/health/aidl/default/Android.bp
@@ -29,7 +29,7 @@
         "libcutils",
         "liblog",
         "libutils",
-        "android.hardware.health-V1-ndk",
+        "android.hardware.health-V2-ndk",
 
         // TODO(b/177269435): remove when BatteryMonitor works with AIDL HealthInfo.
         "libhidlbase",
@@ -48,7 +48,7 @@
     name: "libhealth_aidl_charger_defaults",
     shared_libs: [
         // common
-        "android.hardware.health-V1-ndk",
+        "android.hardware.health-V2-ndk",
         "libbase",
         "libcutils",
         "liblog",
@@ -195,7 +195,7 @@
         "service_fuzzer_defaults",
     ],
     static_libs: [
-        "android.hardware.health-V1-ndk",
+        "android.hardware.health-V2-ndk",
         "libbase",
         "liblog",
         "fuzz_libhealth_aidl_impl",
diff --git a/health/aidl/default/Health.cpp b/health/aidl/default/Health.cpp
index d41d01a..15a3dbc 100644
--- a/health/aidl/default/Health.cpp
+++ b/health/aidl/default/Health.cpp
@@ -115,6 +115,42 @@
                        BatteryStatus::UNKNOWN, out);
 }
 
+ndk::ScopedAStatus Health::setChargingPolicy(BatteryChargingPolicy in_value) {
+    ::android::status_t err = battery_monitor_.setChargingPolicy(static_cast<int>(in_value));
+
+    switch (err) {
+        case ::android::OK:
+            return ndk::ScopedAStatus::ok();
+        case ::android::NAME_NOT_FOUND:
+            return ndk::ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION);
+        case ::android::BAD_VALUE:
+            return ndk::ScopedAStatus::fromStatus(::android::INVALID_OPERATION);
+        default:
+            return ndk::ScopedAStatus::fromServiceSpecificErrorWithMessage(
+                    IHealth::STATUS_UNKNOWN, ::android::statusToString(err).c_str());
+    }
+}
+
+ndk::ScopedAStatus Health::getChargingPolicy(BatteryChargingPolicy* out) {
+    return GetProperty(&battery_monitor_, ::android::BATTERY_PROP_CHARGING_POLICY,
+                       BatteryChargingPolicy::DEFAULT, out);
+}
+
+ndk::ScopedAStatus Health::getBatteryHealthData(BatteryHealthData* out) {
+    if (auto res =
+                GetProperty<int64_t>(&battery_monitor_, ::android::BATTERY_PROP_MANUFACTURING_DATE,
+                                     0, &out->batteryManufacturingDateSeconds);
+        !res.isOk()) {
+        LOG(WARNING) << "Cannot get Manufacturing_date: " << res.getDescription();
+    }
+    if (auto res = GetProperty<int64_t>(&battery_monitor_, ::android::BATTERY_PROP_FIRST_USAGE_DATE,
+                                        0, &out->batteryFirstUsageSeconds);
+        !res.isOk()) {
+        LOG(WARNING) << "Cannot get First_usage_date: " << res.getDescription();
+    }
+    return ndk::ScopedAStatus::ok();
+}
+
 ndk::ScopedAStatus Health::getDiskStats(std::vector<DiskStats>*) {
     // This implementation does not support DiskStats. An implementation may extend this
     // class and override this function to support disk stats.
diff --git a/health/aidl/default/android.hardware.health-service.example.xml b/health/aidl/default/android.hardware.health-service.example.xml
index 98026cb..1fe9b8d 100644
--- a/health/aidl/default/android.hardware.health-service.example.xml
+++ b/health/aidl/default/android.hardware.health-service.example.xml
@@ -1,7 +1,7 @@
 <manifest version="1.0" type="device">
     <hal format="aidl">
         <name>android.hardware.health</name>
-        <version>1</version>
+        <version>2</version>
         <fqname>IHealth/default</fqname>
     </hal>
 </manifest>
diff --git a/health/aidl/default/include/health-impl/Health.h b/health/aidl/default/include/health-impl/Health.h
index 6bd4946..dc3a0ef 100644
--- a/health/aidl/default/include/health-impl/Health.h
+++ b/health/aidl/default/include/health-impl/Health.h
@@ -72,6 +72,10 @@
     ndk::ScopedAStatus getDiskStats(std::vector<DiskStats>* out) override;
     ndk::ScopedAStatus getStorageInfo(std::vector<StorageInfo>* out) override;
 
+    ndk::ScopedAStatus setChargingPolicy(BatteryChargingPolicy in_value) override;
+    ndk::ScopedAStatus getChargingPolicy(BatteryChargingPolicy* out) override;
+    ndk::ScopedAStatus getBatteryHealthData(BatteryHealthData* out) override;
+
     // A subclass may override these to provide a different implementation.
     binder_status_t dump(int fd, const char** args, uint32_t num_args) override;
 
diff --git a/health/aidl/vts/functional/Android.bp b/health/aidl/vts/functional/Android.bp
index f9da79f..b735a87 100644
--- a/health/aidl/vts/functional/Android.bp
+++ b/health/aidl/vts/functional/Android.bp
@@ -39,7 +39,7 @@
         "libbinder_ndk",
     ],
     static_libs: [
-        "android.hardware.health-V1-ndk",
+        "android.hardware.health-V2-ndk",
         "libgmock",
     ],
     header_libs: [
diff --git a/health/aidl/vts/functional/VtsHalHealthTargetTest.cpp b/health/aidl/vts/functional/VtsHalHealthTargetTest.cpp
index 3e07188..dd0bd81 100644
--- a/health/aidl/vts/functional/VtsHalHealthTargetTest.cpp
+++ b/health/aidl/vts/functional/VtsHalHealthTargetTest.cpp
@@ -225,6 +225,61 @@
     ASSERT_THAT(value, IsValidEnum<BatteryStatus>());
 }
 
+/*
+ * Tests the values returned by getChargingPolicy() from interface IHealth.
+ */
+TEST_P(HealthAidl, getChargingPolicy) {
+    BatteryChargingPolicy value;
+    auto status = health->getChargingPolicy(&value);
+    ASSERT_THAT(status, AnyOf(IsOk(), ExceptionIs(EX_UNSUPPORTED_OPERATION)));
+    if (!status.isOk()) return;
+    ASSERT_THAT(value, IsValidEnum<BatteryChargingPolicy>());
+}
+
+/*
+ * Tests that setChargingPolicy() writes the value and compared the returned
+ * value by getChargingPolicy() from interface IHealth.
+ */
+TEST_P(HealthAidl, setChargingPolicy) {
+    BatteryChargingPolicy value;
+
+    /* set ChargingPolicy*/
+    auto status = health->setChargingPolicy(static_cast<BatteryChargingPolicy>(2));  // LONG_LIFE
+    ASSERT_THAT(status, AnyOf(IsOk(), ExceptionIs(EX_UNSUPPORTED_OPERATION)));
+    if (!status.isOk()) return;
+
+    /* get ChargingPolicy*/
+    status = health->getChargingPolicy(&value);
+    ASSERT_THAT(status, AnyOf(IsOk(), ExceptionIs(EX_UNSUPPORTED_OPERATION)));
+    if (!status.isOk()) return;
+    ASSERT_THAT(static_cast<int>(value), Eq(2));
+}
+
+MATCHER(IsValidHealthData, "") {
+    *result_listener << "value is " << arg.toString() << ".";
+    if (!ExplainMatchResult(Ge(-1), arg.batteryManufacturingDateSeconds, result_listener)) {
+        *result_listener << " for batteryManufacturingDateSeconds.";
+        return false;
+    }
+    if (!ExplainMatchResult(Ge(-1), arg.batteryFirstUsageSeconds, result_listener)) {
+        *result_listener << " for batteryFirstUsageSeconds.";
+        return false;
+    }
+
+    return true;
+}
+
+/*
+ * Tests the values returned by getBatteryHealthData() from interface IHealth.
+ */
+TEST_P(HealthAidl, getBatteryHealthData) {
+    BatteryHealthData value;
+    auto status = health->getBatteryHealthData(&value);
+    ASSERT_THAT(status, AnyOf(IsOk(), ExceptionIs(EX_UNSUPPORTED_OPERATION)));
+    if (!status.isOk()) return;
+    ASSERT_THAT(value, IsValidHealthData());
+}
+
 MATCHER(IsValidStorageInfo, "") {
     *result_listener << "value is " << arg.toString() << ".";
     if (!ExplainMatchResult(InClosedRange(0, 3), arg.eol, result_listener)) {
diff --git a/health/utils/libhealthshim/Android.bp b/health/utils/libhealthshim/Android.bp
index 3a1415f..14c32ae 100644
--- a/health/utils/libhealthshim/Android.bp
+++ b/health/utils/libhealthshim/Android.bp
@@ -34,7 +34,7 @@
         "-Werror",
     ],
     static_libs: [
-        "android.hardware.health-V1-ndk",
+        "android.hardware.health-V2-ndk",
         "android.hardware.health-translate-ndk",
         "android.hardware.health@1.0",
         "android.hardware.health@2.0",
diff --git a/health/utils/libhealthshim/include/health-shim/shim.h b/health/utils/libhealthshim/include/health-shim/shim.h
index f36fa5d..ff6849b 100644
--- a/health/utils/libhealthshim/include/health-shim/shim.h
+++ b/health/utils/libhealthshim/include/health-shim/shim.h
@@ -45,6 +45,9 @@
     ndk::ScopedAStatus getStorageInfo(std::vector<StorageInfo>* _aidl_return) override;
     ndk::ScopedAStatus getDiskStats(std::vector<DiskStats>* _aidl_return) override;
     ndk::ScopedAStatus getHealthInfo(HealthInfo* _aidl_return) override;
+    ndk::ScopedAStatus setChargingPolicy(BatteryChargingPolicy in_value) override;
+    ndk::ScopedAStatus getChargingPolicy(BatteryChargingPolicy* _aidl_return) override;
+    ndk::ScopedAStatus getBatteryHealthData(BatteryHealthData* _aidl_return) override;
 
   private:
     ::android::sp<HidlHealth> service_;
diff --git a/health/utils/libhealthshim/shim.cpp b/health/utils/libhealthshim/shim.cpp
index 1329679..6a5f512 100644
--- a/health/utils/libhealthshim/shim.cpp
+++ b/health/utils/libhealthshim/shim.cpp
@@ -217,4 +217,20 @@
     return ReturnAndResultToStatus(ret, out_result);
 }
 
+ScopedAStatus HealthShim::setChargingPolicy(BatteryChargingPolicy in_value) {
+    in_value = static_cast<BatteryChargingPolicy>(0);
+    return ResultToStatus(Result::NOT_SUPPORTED);
+}
+
+ScopedAStatus HealthShim::getChargingPolicy(BatteryChargingPolicy* out) {
+    *out = static_cast<BatteryChargingPolicy>(0);
+    return ResultToStatus(Result::NOT_SUPPORTED);
+}
+
+ScopedAStatus HealthShim::getBatteryHealthData(BatteryHealthData* out) {
+    out->batteryManufacturingDateSeconds = 0;
+    out->batteryFirstUsageSeconds = 0;
+    return ResultToStatus(Result::NOT_SUPPORTED);
+}
+
 }  // namespace aidl::android::hardware::health
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 fb5048a..728cc91 100644
--- a/keymaster/4.0/vts/functional/keymaster_hidl_hal_test.cpp
+++ b/keymaster/4.0/vts/functional/keymaster_hidl_hal_test.cpp
@@ -4866,6 +4866,11 @@
     if (vsr_api_level < 33) {
         GTEST_SKIP() << "Applies only to VSR API level 33, this device is: " << vsr_api_level;
     }
+    char soc_model[PROPERTY_VALUE_MAX] = {};
+    property_get("ro.soc.model", soc_model, "");
+    if (!strcmp(soc_model, "SM8550")) {
+        GTEST_SKIP() << "Skip QTI SM8550 chipset, the SOC model of this device is: " << soc_model;
+    }
     FAIL() << "VSR 13+ requires KeyMint version 2";
 }
 
diff --git a/radio/aidl/Android.bp b/radio/aidl/Android.bp
index e8cebd7..dfccb4c 100644
--- a/radio/aidl/Android.bp
+++ b/radio/aidl/Android.bp
@@ -262,3 +262,19 @@
         },
     },
 }
+
+aidl_interface {
+    name: "android.hardware.radio.satellite",
+    vendor_available: true,
+    srcs: ["android/hardware/radio/satellite/*.aidl"],
+    stability: "vintf",
+    imports: ["android.hardware.radio-V2"],
+    backend: {
+        cpp: {
+            enabled: false,
+        },
+        java: {
+            sdk_version: "module_current",
+        },
+    },
+}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/MultipleEnabledProfilesMode.aidl b/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/MultipleEnabledProfilesMode.aidl
index fad767c..74017e4 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/MultipleEnabledProfilesMode.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/MultipleEnabledProfilesMode.aidl
@@ -34,8 +34,8 @@
 package android.hardware.radio.config;
 @Backing(type="int") @JavaDerive(toString=true) @VintfStability
 enum MultipleEnabledProfilesMode {
-  NONE = 0,
-  MEP_A1 = 1,
-  MEP_A2 = 2,
-  MEP_B = 3,
+  NONE,
+  MEP_A1,
+  MEP_A2,
+  MEP_B,
 }
diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/ApnAuthType.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/ApnAuthType.aidl
index 86272c2..a33ad6e 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/ApnAuthType.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/ApnAuthType.aidl
@@ -34,8 +34,8 @@
 package android.hardware.radio.data;
 @Backing(type="int") @JavaDerive(toString=true) @VintfStability
 enum ApnAuthType {
-  NO_PAP_NO_CHAP = 0,
-  PAP_NO_CHAP = 1,
-  NO_PAP_CHAP = 2,
-  PAP_CHAP = 3,
+  NO_PAP_NO_CHAP,
+  PAP_NO_CHAP,
+  NO_PAP_CHAP,
+  PAP_CHAP,
 }
diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/ApnTypes.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/ApnTypes.aidl
index 1518a57..45d22c8 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/ApnTypes.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/ApnTypes.aidl
@@ -35,19 +35,19 @@
 @Backing(type="int") @JavaDerive(toString=true) @VintfStability
 enum ApnTypes {
   NONE = 0,
-  DEFAULT = 1,
-  MMS = 2,
-  SUPL = 4,
-  DUN = 8,
-  HIPRI = 16,
-  FOTA = 32,
-  IMS = 64,
-  CBS = 128,
-  IA = 256,
-  EMERGENCY = 512,
-  MCX = 1024,
-  XCAP = 2048,
-  VSIM = 4096,
-  BIP = 8192,
-  ENTERPRISE = 16384,
+  DEFAULT = (1 << 0),
+  MMS = (1 << 1),
+  SUPL = (1 << 2),
+  DUN = (1 << 3),
+  HIPRI = (1 << 4),
+  FOTA = (1 << 5),
+  IMS = (1 << 6),
+  CBS = (1 << 7),
+  IA = (1 << 8),
+  EMERGENCY = (1 << 9),
+  MCX = (1 << 10),
+  XCAP = (1 << 11),
+  VSIM = (1 << 12),
+  BIP = (1 << 13),
+  ENTERPRISE = (1 << 14),
 }
diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/DataCallFailCause.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/DataCallFailCause.aidl
index d7d6983..8a3fd4f 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/DataCallFailCause.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/DataCallFailCause.aidl
@@ -35,343 +35,347 @@
 @Backing(type="int") @JavaDerive(toString=true) @VintfStability
 enum DataCallFailCause {
   NONE = 0,
-  OPERATOR_BARRED = 8,
-  NAS_SIGNALLING = 14,
-  INSUFFICIENT_RESOURCES = 26,
-  MISSING_UNKNOWN_APN = 27,
-  UNKNOWN_PDP_ADDRESS_TYPE = 28,
-  USER_AUTHENTICATION = 29,
-  ACTIVATION_REJECT_GGSN = 30,
-  ACTIVATION_REJECT_UNSPECIFIED = 31,
-  SERVICE_OPTION_NOT_SUPPORTED = 32,
-  SERVICE_OPTION_NOT_SUBSCRIBED = 33,
-  SERVICE_OPTION_OUT_OF_ORDER = 34,
-  NSAPI_IN_USE = 35,
-  REGULAR_DEACTIVATION = 36,
-  QOS_NOT_ACCEPTED = 37,
-  NETWORK_FAILURE = 38,
-  UMTS_REACTIVATION_REQ = 39,
-  FEATURE_NOT_SUPP = 40,
-  TFT_SEMANTIC_ERROR = 41,
-  TFT_SYTAX_ERROR = 42,
-  UNKNOWN_PDP_CONTEXT = 43,
-  FILTER_SEMANTIC_ERROR = 44,
-  FILTER_SYTAX_ERROR = 45,
-  PDP_WITHOUT_ACTIVE_TFT = 46,
-  ONLY_IPV4_ALLOWED = 50,
-  ONLY_IPV6_ALLOWED = 51,
-  ONLY_SINGLE_BEARER_ALLOWED = 52,
-  ESM_INFO_NOT_RECEIVED = 53,
-  PDN_CONN_DOES_NOT_EXIST = 54,
-  MULTI_CONN_TO_SAME_PDN_NOT_ALLOWED = 55,
-  MAX_ACTIVE_PDP_CONTEXT_REACHED = 65,
-  UNSUPPORTED_APN_IN_CURRENT_PLMN = 66,
-  INVALID_TRANSACTION_ID = 81,
-  MESSAGE_INCORRECT_SEMANTIC = 95,
-  INVALID_MANDATORY_INFO = 96,
-  MESSAGE_TYPE_UNSUPPORTED = 97,
-  MSG_TYPE_NONCOMPATIBLE_STATE = 98,
-  UNKNOWN_INFO_ELEMENT = 99,
-  CONDITIONAL_IE_ERROR = 100,
-  MSG_AND_PROTOCOL_STATE_UNCOMPATIBLE = 101,
-  PROTOCOL_ERRORS = 111,
-  APN_TYPE_CONFLICT = 112,
-  INVALID_PCSCF_ADDR = 113,
-  INTERNAL_CALL_PREEMPT_BY_HIGH_PRIO_APN = 114,
-  EMM_ACCESS_BARRED = 115,
-  EMERGENCY_IFACE_ONLY = 116,
-  IFACE_MISMATCH = 117,
-  COMPANION_IFACE_IN_USE = 118,
-  IP_ADDRESS_MISMATCH = 119,
-  IFACE_AND_POL_FAMILY_MISMATCH = 120,
-  EMM_ACCESS_BARRED_INFINITE_RETRY = 121,
-  AUTH_FAILURE_ON_EMERGENCY_CALL = 122,
-  OEM_DCFAILCAUSE_1 = 4097,
-  OEM_DCFAILCAUSE_2 = 4098,
-  OEM_DCFAILCAUSE_3 = 4099,
-  OEM_DCFAILCAUSE_4 = 4100,
-  OEM_DCFAILCAUSE_5 = 4101,
-  OEM_DCFAILCAUSE_6 = 4102,
-  OEM_DCFAILCAUSE_7 = 4103,
-  OEM_DCFAILCAUSE_8 = 4104,
-  OEM_DCFAILCAUSE_9 = 4105,
-  OEM_DCFAILCAUSE_10 = 4106,
-  OEM_DCFAILCAUSE_11 = 4107,
-  OEM_DCFAILCAUSE_12 = 4108,
-  OEM_DCFAILCAUSE_13 = 4109,
-  OEM_DCFAILCAUSE_14 = 4110,
-  OEM_DCFAILCAUSE_15 = 4111,
-  VOICE_REGISTRATION_FAIL = -1,
-  DATA_REGISTRATION_FAIL = -2,
-  SIGNAL_LOST = -3,
-  PREF_RADIO_TECH_CHANGED = -4,
-  RADIO_POWER_OFF = -5,
-  TETHERED_CALL_ACTIVE = -6,
-  ERROR_UNSPECIFIED = 65535,
-  LLC_SNDCP = 25,
-  ACTIVATION_REJECTED_BCM_VIOLATION = 48,
-  COLLISION_WITH_NETWORK_INITIATED_REQUEST = 56,
-  ONLY_IPV4V6_ALLOWED = 57,
-  ONLY_NON_IP_ALLOWED = 58,
-  UNSUPPORTED_QCI_VALUE = 59,
-  BEARER_HANDLING_NOT_SUPPORTED = 60,
-  INVALID_DNS_ADDR = 123,
-  INVALID_PCSCF_OR_DNS_ADDRESS = 124,
-  CALL_PREEMPT_BY_EMERGENCY_APN = 127,
-  UE_INITIATED_DETACH_OR_DISCONNECT = 128,
-  MIP_FA_REASON_UNSPECIFIED = 2000,
-  MIP_FA_ADMIN_PROHIBITED = 2001,
-  MIP_FA_INSUFFICIENT_RESOURCES = 2002,
-  MIP_FA_MOBILE_NODE_AUTHENTICATION_FAILURE = 2003,
-  MIP_FA_HOME_AGENT_AUTHENTICATION_FAILURE = 2004,
-  MIP_FA_REQUESTED_LIFETIME_TOO_LONG = 2005,
-  MIP_FA_MALFORMED_REQUEST = 2006,
-  MIP_FA_MALFORMED_REPLY = 2007,
-  MIP_FA_ENCAPSULATION_UNAVAILABLE = 2008,
-  MIP_FA_VJ_HEADER_COMPRESSION_UNAVAILABLE = 2009,
-  MIP_FA_REVERSE_TUNNEL_UNAVAILABLE = 2010,
-  MIP_FA_REVERSE_TUNNEL_IS_MANDATORY = 2011,
-  MIP_FA_DELIVERY_STYLE_NOT_SUPPORTED = 2012,
-  MIP_FA_MISSING_NAI = 2013,
-  MIP_FA_MISSING_HOME_AGENT = 2014,
-  MIP_FA_MISSING_HOME_ADDRESS = 2015,
-  MIP_FA_UNKNOWN_CHALLENGE = 2016,
-  MIP_FA_MISSING_CHALLENGE = 2017,
-  MIP_FA_STALE_CHALLENGE = 2018,
-  MIP_HA_REASON_UNSPECIFIED = 2019,
-  MIP_HA_ADMIN_PROHIBITED = 2020,
-  MIP_HA_INSUFFICIENT_RESOURCES = 2021,
-  MIP_HA_MOBILE_NODE_AUTHENTICATION_FAILURE = 2022,
-  MIP_HA_FOREIGN_AGENT_AUTHENTICATION_FAILURE = 2023,
-  MIP_HA_REGISTRATION_ID_MISMATCH = 2024,
-  MIP_HA_MALFORMED_REQUEST = 2025,
-  MIP_HA_UNKNOWN_HOME_AGENT_ADDRESS = 2026,
-  MIP_HA_REVERSE_TUNNEL_UNAVAILABLE = 2027,
-  MIP_HA_REVERSE_TUNNEL_IS_MANDATORY = 2028,
-  MIP_HA_ENCAPSULATION_UNAVAILABLE = 2029,
-  CLOSE_IN_PROGRESS = 2030,
-  NETWORK_INITIATED_TERMINATION = 2031,
-  MODEM_APP_PREEMPTED = 2032,
-  PDN_IPV4_CALL_DISALLOWED = 2033,
-  PDN_IPV4_CALL_THROTTLED = 2034,
-  PDN_IPV6_CALL_DISALLOWED = 2035,
-  PDN_IPV6_CALL_THROTTLED = 2036,
-  MODEM_RESTART = 2037,
-  PDP_PPP_NOT_SUPPORTED = 2038,
-  UNPREFERRED_RAT = 2039,
-  PHYSICAL_LINK_CLOSE_IN_PROGRESS = 2040,
-  APN_PENDING_HANDOVER = 2041,
-  PROFILE_BEARER_INCOMPATIBLE = 2042,
-  SIM_CARD_CHANGED = 2043,
-  LOW_POWER_MODE_OR_POWERING_DOWN = 2044,
-  APN_DISABLED = 2045,
-  MAX_PPP_INACTIVITY_TIMER_EXPIRED = 2046,
-  IPV6_ADDRESS_TRANSFER_FAILED = 2047,
-  TRAT_SWAP_FAILED = 2048,
-  EHRPD_TO_HRPD_FALLBACK = 2049,
-  MIP_CONFIG_FAILURE = 2050,
-  PDN_INACTIVITY_TIMER_EXPIRED = 2051,
-  MAX_IPV4_CONNECTIONS = 2052,
-  MAX_IPV6_CONNECTIONS = 2053,
-  APN_MISMATCH = 2054,
-  IP_VERSION_MISMATCH = 2055,
-  DUN_CALL_DISALLOWED = 2056,
-  INTERNAL_EPC_NONEPC_TRANSITION = 2057,
-  INTERFACE_IN_USE = 2058,
-  APN_DISALLOWED_ON_ROAMING = 2059,
-  APN_PARAMETERS_CHANGED = 2060,
-  NULL_APN_DISALLOWED = 2061,
-  THERMAL_MITIGATION = 2062,
-  DATA_SETTINGS_DISABLED = 2063,
-  DATA_ROAMING_SETTINGS_DISABLED = 2064,
-  DDS_SWITCHED = 2065,
-  FORBIDDEN_APN_NAME = 2066,
-  DDS_SWITCH_IN_PROGRESS = 2067,
-  CALL_DISALLOWED_IN_ROAMING = 2068,
-  NON_IP_NOT_SUPPORTED = 2069,
-  PDN_NON_IP_CALL_THROTTLED = 2070,
-  PDN_NON_IP_CALL_DISALLOWED = 2071,
-  CDMA_LOCK = 2072,
-  CDMA_INTERCEPT = 2073,
-  CDMA_REORDER = 2074,
-  CDMA_RELEASE_DUE_TO_SO_REJECTION = 2075,
-  CDMA_INCOMING_CALL = 2076,
-  CDMA_ALERT_STOP = 2077,
-  CHANNEL_ACQUISITION_FAILURE = 2078,
-  MAX_ACCESS_PROBE = 2079,
-  CONCURRENT_SERVICE_NOT_SUPPORTED_BY_BASE_STATION = 2080,
-  NO_RESPONSE_FROM_BASE_STATION = 2081,
-  REJECTED_BY_BASE_STATION = 2082,
-  CONCURRENT_SERVICES_INCOMPATIBLE = 2083,
-  NO_CDMA_SERVICE = 2084,
-  RUIM_NOT_PRESENT = 2085,
-  CDMA_RETRY_ORDER = 2086,
-  ACCESS_BLOCK = 2087,
-  ACCESS_BLOCK_ALL = 2088,
-  IS707B_MAX_ACCESS_PROBES = 2089,
-  THERMAL_EMERGENCY = 2090,
-  CONCURRENT_SERVICES_NOT_ALLOWED = 2091,
-  INCOMING_CALL_REJECTED = 2092,
-  NO_SERVICE_ON_GATEWAY = 2093,
-  NO_GPRS_CONTEXT = 2094,
-  ILLEGAL_MS = 2095,
-  ILLEGAL_ME = 2096,
-  GPRS_SERVICES_AND_NON_GPRS_SERVICES_NOT_ALLOWED = 2097,
-  GPRS_SERVICES_NOT_ALLOWED = 2098,
-  MS_IDENTITY_CANNOT_BE_DERIVED_BY_THE_NETWORK = 2099,
-  IMPLICITLY_DETACHED = 2100,
-  PLMN_NOT_ALLOWED = 2101,
-  LOCATION_AREA_NOT_ALLOWED = 2102,
-  GPRS_SERVICES_NOT_ALLOWED_IN_THIS_PLMN = 2103,
-  PDP_DUPLICATE = 2104,
-  UE_RAT_CHANGE = 2105,
-  CONGESTION = 2106,
-  NO_PDP_CONTEXT_ACTIVATED = 2107,
-  ACCESS_CLASS_DSAC_REJECTION = 2108,
-  PDP_ACTIVATE_MAX_RETRY_FAILED = 2109,
-  RADIO_ACCESS_BEARER_FAILURE = 2110,
-  ESM_UNKNOWN_EPS_BEARER_CONTEXT = 2111,
-  DRB_RELEASED_BY_RRC = 2112,
-  CONNECTION_RELEASED = 2113,
-  EMM_DETACHED = 2114,
-  EMM_ATTACH_FAILED = 2115,
-  EMM_ATTACH_STARTED = 2116,
-  LTE_NAS_SERVICE_REQUEST_FAILED = 2117,
-  DUPLICATE_BEARER_ID = 2118,
-  ESM_COLLISION_SCENARIOS = 2119,
-  ESM_BEARER_DEACTIVATED_TO_SYNC_WITH_NETWORK = 2120,
-  ESM_NW_ACTIVATED_DED_BEARER_WITH_ID_OF_DEF_BEARER = 2121,
-  ESM_BAD_OTA_MESSAGE = 2122,
-  ESM_DOWNLOAD_SERVER_REJECTED_THE_CALL = 2123,
-  ESM_CONTEXT_TRANSFERRED_DUE_TO_IRAT = 2124,
-  DS_EXPLICIT_DEACTIVATION = 2125,
-  ESM_LOCAL_CAUSE_NONE = 2126,
-  LTE_THROTTLING_NOT_REQUIRED = 2127,
-  ACCESS_CONTROL_LIST_CHECK_FAILURE = 2128,
-  SERVICE_NOT_ALLOWED_ON_PLMN = 2129,
-  EMM_T3417_EXPIRED = 2130,
-  EMM_T3417_EXT_EXPIRED = 2131,
-  RRC_UPLINK_DATA_TRANSMISSION_FAILURE = 2132,
-  RRC_UPLINK_DELIVERY_FAILED_DUE_TO_HANDOVER = 2133,
-  RRC_UPLINK_CONNECTION_RELEASE = 2134,
-  RRC_UPLINK_RADIO_LINK_FAILURE = 2135,
-  RRC_UPLINK_ERROR_REQUEST_FROM_NAS = 2136,
-  RRC_CONNECTION_ACCESS_STRATUM_FAILURE = 2137,
-  RRC_CONNECTION_ANOTHER_PROCEDURE_IN_PROGRESS = 2138,
-  RRC_CONNECTION_ACCESS_BARRED = 2139,
-  RRC_CONNECTION_CELL_RESELECTION = 2140,
-  RRC_CONNECTION_CONFIG_FAILURE = 2141,
-  RRC_CONNECTION_TIMER_EXPIRED = 2142,
-  RRC_CONNECTION_LINK_FAILURE = 2143,
-  RRC_CONNECTION_CELL_NOT_CAMPED = 2144,
-  RRC_CONNECTION_SYSTEM_INTERVAL_FAILURE = 2145,
-  RRC_CONNECTION_REJECT_BY_NETWORK = 2146,
-  RRC_CONNECTION_NORMAL_RELEASE = 2147,
-  RRC_CONNECTION_RADIO_LINK_FAILURE = 2148,
-  RRC_CONNECTION_REESTABLISHMENT_FAILURE = 2149,
-  RRC_CONNECTION_OUT_OF_SERVICE_DURING_CELL_REGISTER = 2150,
-  RRC_CONNECTION_ABORT_REQUEST = 2151,
-  RRC_CONNECTION_SYSTEM_INFORMATION_BLOCK_READ_ERROR = 2152,
-  NETWORK_INITIATED_DETACH_WITH_AUTO_REATTACH = 2153,
-  NETWORK_INITIATED_DETACH_NO_AUTO_REATTACH = 2154,
-  ESM_PROCEDURE_TIME_OUT = 2155,
-  INVALID_CONNECTION_ID = 2156,
-  MAXIMIUM_NSAPIS_EXCEEDED = 2157,
-  INVALID_PRIMARY_NSAPI = 2158,
-  CANNOT_ENCODE_OTA_MESSAGE = 2159,
-  RADIO_ACCESS_BEARER_SETUP_FAILURE = 2160,
-  PDP_ESTABLISH_TIMEOUT_EXPIRED = 2161,
-  PDP_MODIFY_TIMEOUT_EXPIRED = 2162,
-  PDP_INACTIVE_TIMEOUT_EXPIRED = 2163,
-  PDP_LOWERLAYER_ERROR = 2164,
-  PDP_MODIFY_COLLISION = 2165,
-  MAXINUM_SIZE_OF_L2_MESSAGE_EXCEEDED = 2166,
-  NAS_REQUEST_REJECTED_BY_NETWORK = 2167,
-  RRC_CONNECTION_INVALID_REQUEST = 2168,
-  RRC_CONNECTION_TRACKING_AREA_ID_CHANGED = 2169,
-  RRC_CONNECTION_RF_UNAVAILABLE = 2170,
-  RRC_CONNECTION_ABORTED_DUE_TO_IRAT_CHANGE = 2171,
-  RRC_CONNECTION_RELEASED_SECURITY_NOT_ACTIVE = 2172,
-  RRC_CONNECTION_ABORTED_AFTER_HANDOVER = 2173,
-  RRC_CONNECTION_ABORTED_AFTER_IRAT_CELL_CHANGE = 2174,
-  RRC_CONNECTION_ABORTED_DURING_IRAT_CELL_CHANGE = 2175,
-  IMSI_UNKNOWN_IN_HOME_SUBSCRIBER_SERVER = 2176,
-  IMEI_NOT_ACCEPTED = 2177,
-  EPS_SERVICES_AND_NON_EPS_SERVICES_NOT_ALLOWED = 2178,
-  EPS_SERVICES_NOT_ALLOWED_IN_PLMN = 2179,
-  MSC_TEMPORARILY_NOT_REACHABLE = 2180,
-  CS_DOMAIN_NOT_AVAILABLE = 2181,
-  ESM_FAILURE = 2182,
-  MAC_FAILURE = 2183,
-  SYNCHRONIZATION_FAILURE = 2184,
-  UE_SECURITY_CAPABILITIES_MISMATCH = 2185,
-  SECURITY_MODE_REJECTED = 2186,
-  UNACCEPTABLE_NON_EPS_AUTHENTICATION = 2187,
-  CS_FALLBACK_CALL_ESTABLISHMENT_NOT_ALLOWED = 2188,
-  NO_EPS_BEARER_CONTEXT_ACTIVATED = 2189,
-  INVALID_EMM_STATE = 2190,
-  NAS_LAYER_FAILURE = 2191,
-  MULTIPLE_PDP_CALL_NOT_ALLOWED = 2192,
-  EMBMS_NOT_ENABLED = 2193,
-  IRAT_HANDOVER_FAILED = 2194,
-  EMBMS_REGULAR_DEACTIVATION = 2195,
-  TEST_LOOPBACK_REGULAR_DEACTIVATION = 2196,
-  LOWER_LAYER_REGISTRATION_FAILURE = 2197,
-  DATA_PLAN_EXPIRED = 2198,
-  UMTS_HANDOVER_TO_IWLAN = 2199,
-  EVDO_CONNECTION_DENY_BY_GENERAL_OR_NETWORK_BUSY = 2200,
-  EVDO_CONNECTION_DENY_BY_BILLING_OR_AUTHENTICATION_FAILURE = 2201,
-  EVDO_HDR_CHANGED = 2202,
-  EVDO_HDR_EXITED = 2203,
-  EVDO_HDR_NO_SESSION = 2204,
-  EVDO_USING_GPS_FIX_INSTEAD_OF_HDR_CALL = 2205,
-  EVDO_HDR_CONNECTION_SETUP_TIMEOUT = 2206,
-  FAILED_TO_ACQUIRE_COLOCATED_HDR = 2207,
-  OTASP_COMMIT_IN_PROGRESS = 2208,
-  NO_HYBRID_HDR_SERVICE = 2209,
-  HDR_NO_LOCK_GRANTED = 2210,
-  DBM_OR_SMS_IN_PROGRESS = 2211,
-  HDR_FADE = 2212,
-  HDR_ACCESS_FAILURE = 2213,
-  UNSUPPORTED_1X_PREV = 2214,
-  LOCAL_END = 2215,
-  NO_SERVICE = 2216,
-  FADE = 2217,
-  NORMAL_RELEASE = 2218,
-  ACCESS_ATTEMPT_ALREADY_IN_PROGRESS = 2219,
-  REDIRECTION_OR_HANDOFF_IN_PROGRESS = 2220,
-  EMERGENCY_MODE = 2221,
-  PHONE_IN_USE = 2222,
-  INVALID_MODE = 2223,
-  INVALID_SIM_STATE = 2224,
-  NO_COLLOCATED_HDR = 2225,
-  UE_IS_ENTERING_POWERSAVE_MODE = 2226,
-  DUAL_SWITCH = 2227,
-  PPP_TIMEOUT = 2228,
-  PPP_AUTH_FAILURE = 2229,
-  PPP_OPTION_MISMATCH = 2230,
-  PPP_PAP_FAILURE = 2231,
-  PPP_CHAP_FAILURE = 2232,
-  PPP_CLOSE_IN_PROGRESS = 2233,
-  LIMITED_TO_IPV4 = 2234,
-  LIMITED_TO_IPV6 = 2235,
-  VSNCP_TIMEOUT = 2236,
-  VSNCP_GEN_ERROR = 2237,
-  VSNCP_APN_UNAUTHORIZED = 2238,
-  VSNCP_PDN_LIMIT_EXCEEDED = 2239,
-  VSNCP_NO_PDN_GATEWAY_ADDRESS = 2240,
-  VSNCP_PDN_GATEWAY_UNREACHABLE = 2241,
-  VSNCP_PDN_GATEWAY_REJECT = 2242,
-  VSNCP_INSUFFICIENT_PARAMETERS = 2243,
-  VSNCP_RESOURCE_UNAVAILABLE = 2244,
-  VSNCP_ADMINISTRATIVELY_PROHIBITED = 2245,
-  VSNCP_PDN_ID_IN_USE = 2246,
-  VSNCP_SUBSCRIBER_LIMITATION = 2247,
-  VSNCP_PDN_EXISTS_FOR_THIS_APN = 2248,
-  VSNCP_RECONNECT_NOT_ALLOWED = 2249,
-  IPV6_PREFIX_UNAVAILABLE = 2250,
-  HANDOFF_PREFERENCE_CHANGED = 2251,
-  SLICE_REJECTED = 2252,
-  MATCH_ALL_RULE_NOT_ALLOWED = 2253,
-  ALL_MATCHING_RULES_FAILED = 2254,
+  OPERATOR_BARRED = 0x08,
+  NAS_SIGNALLING = 0x0E,
+  INSUFFICIENT_RESOURCES = 0x1A,
+  MISSING_UNKNOWN_APN = 0x1B,
+  UNKNOWN_PDP_ADDRESS_TYPE = 0x1C,
+  USER_AUTHENTICATION = 0x1D,
+  ACTIVATION_REJECT_GGSN = 0x1E,
+  ACTIVATION_REJECT_UNSPECIFIED = 0x1F,
+  SERVICE_OPTION_NOT_SUPPORTED = 0x20,
+  SERVICE_OPTION_NOT_SUBSCRIBED = 0x21,
+  SERVICE_OPTION_OUT_OF_ORDER = 0x22,
+  NSAPI_IN_USE = 0x23,
+  REGULAR_DEACTIVATION = 0x24,
+  QOS_NOT_ACCEPTED = 0x25,
+  NETWORK_FAILURE = 0x26,
+  UMTS_REACTIVATION_REQ = 0x27,
+  FEATURE_NOT_SUPP = 0x28,
+  TFT_SEMANTIC_ERROR = 0x29,
+  TFT_SYTAX_ERROR = 0x2A,
+  UNKNOWN_PDP_CONTEXT = 0x2B,
+  FILTER_SEMANTIC_ERROR = 0x2C,
+  FILTER_SYTAX_ERROR = 0x2D,
+  PDP_WITHOUT_ACTIVE_TFT = 0x2E,
+  ONLY_IPV4_ALLOWED = 0x32,
+  ONLY_IPV6_ALLOWED = 0x33,
+  ONLY_SINGLE_BEARER_ALLOWED = 0x34,
+  ESM_INFO_NOT_RECEIVED = 0x35,
+  PDN_CONN_DOES_NOT_EXIST = 0x36,
+  MULTI_CONN_TO_SAME_PDN_NOT_ALLOWED = 0x37,
+  MAX_ACTIVE_PDP_CONTEXT_REACHED = 0x41,
+  UNSUPPORTED_APN_IN_CURRENT_PLMN = 0x42,
+  INVALID_TRANSACTION_ID = 0x51,
+  MESSAGE_INCORRECT_SEMANTIC = 0x5F,
+  INVALID_MANDATORY_INFO = 0x60,
+  MESSAGE_TYPE_UNSUPPORTED = 0x61,
+  MSG_TYPE_NONCOMPATIBLE_STATE = 0x62,
+  UNKNOWN_INFO_ELEMENT = 0x63,
+  CONDITIONAL_IE_ERROR = 0x64,
+  MSG_AND_PROTOCOL_STATE_UNCOMPATIBLE = 0x65,
+  PROTOCOL_ERRORS = 0x6F,
+  APN_TYPE_CONFLICT = 0x70,
+  INVALID_PCSCF_ADDR = 0x71,
+  INTERNAL_CALL_PREEMPT_BY_HIGH_PRIO_APN = 0x72,
+  EMM_ACCESS_BARRED = 0x73,
+  EMERGENCY_IFACE_ONLY = 0x74,
+  IFACE_MISMATCH = 0x75,
+  COMPANION_IFACE_IN_USE = 0x76,
+  IP_ADDRESS_MISMATCH = 0x77,
+  IFACE_AND_POL_FAMILY_MISMATCH = 0x78,
+  EMM_ACCESS_BARRED_INFINITE_RETRY = 0x79,
+  AUTH_FAILURE_ON_EMERGENCY_CALL = 0x7A,
+  OEM_DCFAILCAUSE_1 = 0x1001,
+  OEM_DCFAILCAUSE_2 = 0x1002,
+  OEM_DCFAILCAUSE_3 = 0x1003,
+  OEM_DCFAILCAUSE_4 = 0x1004,
+  OEM_DCFAILCAUSE_5 = 0x1005,
+  OEM_DCFAILCAUSE_6 = 0x1006,
+  OEM_DCFAILCAUSE_7 = 0x1007,
+  OEM_DCFAILCAUSE_8 = 0x1008,
+  OEM_DCFAILCAUSE_9 = 0x1009,
+  OEM_DCFAILCAUSE_10 = 0x100A,
+  OEM_DCFAILCAUSE_11 = 0x100B,
+  OEM_DCFAILCAUSE_12 = 0x100C,
+  OEM_DCFAILCAUSE_13 = 0x100D,
+  OEM_DCFAILCAUSE_14 = 0x100E,
+  OEM_DCFAILCAUSE_15 = 0x100F,
+  VOICE_REGISTRATION_FAIL = (-1),
+  DATA_REGISTRATION_FAIL = (-2),
+  SIGNAL_LOST = (-3),
+  PREF_RADIO_TECH_CHANGED = (-4),
+  RADIO_POWER_OFF = (-5),
+  TETHERED_CALL_ACTIVE = (-6),
+  ERROR_UNSPECIFIED = 0xffff,
+  LLC_SNDCP = 0x19,
+  ACTIVATION_REJECTED_BCM_VIOLATION = 0x30,
+  COLLISION_WITH_NETWORK_INITIATED_REQUEST = 0x38,
+  ONLY_IPV4V6_ALLOWED = 0x39,
+  ONLY_NON_IP_ALLOWED = 0x3A,
+  UNSUPPORTED_QCI_VALUE = 0x3B,
+  BEARER_HANDLING_NOT_SUPPORTED = 0x3C,
+  INVALID_DNS_ADDR = 0x7B,
+  INVALID_PCSCF_OR_DNS_ADDRESS = 0x7C,
+  CALL_PREEMPT_BY_EMERGENCY_APN = 0x7F,
+  UE_INITIATED_DETACH_OR_DISCONNECT = 0x80,
+  MIP_FA_REASON_UNSPECIFIED = 0x7D0,
+  MIP_FA_ADMIN_PROHIBITED = 0x7D1,
+  MIP_FA_INSUFFICIENT_RESOURCES = 0x7D2,
+  MIP_FA_MOBILE_NODE_AUTHENTICATION_FAILURE = 0x7D3,
+  MIP_FA_HOME_AGENT_AUTHENTICATION_FAILURE = 0x7D4,
+  MIP_FA_REQUESTED_LIFETIME_TOO_LONG = 0x7D5,
+  MIP_FA_MALFORMED_REQUEST = 0x7D6,
+  MIP_FA_MALFORMED_REPLY = 0x7D7,
+  MIP_FA_ENCAPSULATION_UNAVAILABLE = 0x7D8,
+  MIP_FA_VJ_HEADER_COMPRESSION_UNAVAILABLE = 0x7D9,
+  MIP_FA_REVERSE_TUNNEL_UNAVAILABLE = 0x7DA,
+  MIP_FA_REVERSE_TUNNEL_IS_MANDATORY = 0x7DB,
+  MIP_FA_DELIVERY_STYLE_NOT_SUPPORTED = 0x7DC,
+  MIP_FA_MISSING_NAI = 0x7DD,
+  MIP_FA_MISSING_HOME_AGENT = 0x7DE,
+  MIP_FA_MISSING_HOME_ADDRESS = 0x7DF,
+  MIP_FA_UNKNOWN_CHALLENGE = 0x7E0,
+  MIP_FA_MISSING_CHALLENGE = 0x7E1,
+  MIP_FA_STALE_CHALLENGE = 0x7E2,
+  MIP_HA_REASON_UNSPECIFIED = 0x7E3,
+  MIP_HA_ADMIN_PROHIBITED = 0x7E4,
+  MIP_HA_INSUFFICIENT_RESOURCES = 0x7E5,
+  MIP_HA_MOBILE_NODE_AUTHENTICATION_FAILURE = 0x7E6,
+  MIP_HA_FOREIGN_AGENT_AUTHENTICATION_FAILURE = 0x7E7,
+  MIP_HA_REGISTRATION_ID_MISMATCH = 0x7E8,
+  MIP_HA_MALFORMED_REQUEST = 0x7E9,
+  MIP_HA_UNKNOWN_HOME_AGENT_ADDRESS = 0x7EA,
+  MIP_HA_REVERSE_TUNNEL_UNAVAILABLE = 0x7EB,
+  MIP_HA_REVERSE_TUNNEL_IS_MANDATORY = 0x7EC,
+  MIP_HA_ENCAPSULATION_UNAVAILABLE = 0x7ED,
+  CLOSE_IN_PROGRESS = 0x7EE,
+  NETWORK_INITIATED_TERMINATION = 0x7EF,
+  MODEM_APP_PREEMPTED = 0x7F0,
+  PDN_IPV4_CALL_DISALLOWED = 0x7F1,
+  PDN_IPV4_CALL_THROTTLED = 0x7F2,
+  PDN_IPV6_CALL_DISALLOWED = 0x7F3,
+  PDN_IPV6_CALL_THROTTLED = 0x7F4,
+  MODEM_RESTART = 0x7F5,
+  PDP_PPP_NOT_SUPPORTED = 0x7F6,
+  UNPREFERRED_RAT = 0x7F7,
+  PHYSICAL_LINK_CLOSE_IN_PROGRESS = 0x7F8,
+  APN_PENDING_HANDOVER = 0x7F9,
+  PROFILE_BEARER_INCOMPATIBLE = 0x7FA,
+  SIM_CARD_CHANGED = 0x7FB,
+  LOW_POWER_MODE_OR_POWERING_DOWN = 0x7FC,
+  APN_DISABLED = 0x7FD,
+  MAX_PPP_INACTIVITY_TIMER_EXPIRED = 0x7FE,
+  IPV6_ADDRESS_TRANSFER_FAILED = 0x7FF,
+  TRAT_SWAP_FAILED = 0x800,
+  EHRPD_TO_HRPD_FALLBACK = 0x801,
+  MIP_CONFIG_FAILURE = 0x802,
+  PDN_INACTIVITY_TIMER_EXPIRED = 0x803,
+  MAX_IPV4_CONNECTIONS = 0x804,
+  MAX_IPV6_CONNECTIONS = 0x805,
+  APN_MISMATCH = 0x806,
+  IP_VERSION_MISMATCH = 0x807,
+  DUN_CALL_DISALLOWED = 0x808,
+  INTERNAL_EPC_NONEPC_TRANSITION = 0x809,
+  INTERFACE_IN_USE = 0x80A,
+  APN_DISALLOWED_ON_ROAMING = 0x80B,
+  APN_PARAMETERS_CHANGED = 0x80C,
+  NULL_APN_DISALLOWED = 0x80D,
+  THERMAL_MITIGATION = 0x80E,
+  DATA_SETTINGS_DISABLED = 0x80F,
+  DATA_ROAMING_SETTINGS_DISABLED = 0x810,
+  DDS_SWITCHED = 0x811,
+  FORBIDDEN_APN_NAME = 0x812,
+  DDS_SWITCH_IN_PROGRESS = 0x813,
+  CALL_DISALLOWED_IN_ROAMING = 0x814,
+  NON_IP_NOT_SUPPORTED = 0x815,
+  PDN_NON_IP_CALL_THROTTLED = 0x816,
+  PDN_NON_IP_CALL_DISALLOWED = 0x817,
+  CDMA_LOCK = 0x818,
+  CDMA_INTERCEPT = 0x819,
+  CDMA_REORDER = 0x81A,
+  CDMA_RELEASE_DUE_TO_SO_REJECTION = 0x81B,
+  CDMA_INCOMING_CALL = 0x81C,
+  CDMA_ALERT_STOP = 0x81D,
+  CHANNEL_ACQUISITION_FAILURE = 0x81E,
+  MAX_ACCESS_PROBE = 0x81F,
+  CONCURRENT_SERVICE_NOT_SUPPORTED_BY_BASE_STATION = 0x820,
+  NO_RESPONSE_FROM_BASE_STATION = 0x821,
+  REJECTED_BY_BASE_STATION = 0x822,
+  CONCURRENT_SERVICES_INCOMPATIBLE = 0x823,
+  NO_CDMA_SERVICE = 0x824,
+  RUIM_NOT_PRESENT = 0x825,
+  CDMA_RETRY_ORDER = 0x826,
+  ACCESS_BLOCK = 0x827,
+  ACCESS_BLOCK_ALL = 0x828,
+  IS707B_MAX_ACCESS_PROBES = 0x829,
+  THERMAL_EMERGENCY = 0x82A,
+  CONCURRENT_SERVICES_NOT_ALLOWED = 0x82B,
+  INCOMING_CALL_REJECTED = 0x82C,
+  NO_SERVICE_ON_GATEWAY = 0x82D,
+  NO_GPRS_CONTEXT = 0x82E,
+  ILLEGAL_MS = 0x82F,
+  ILLEGAL_ME = 0x830,
+  GPRS_SERVICES_AND_NON_GPRS_SERVICES_NOT_ALLOWED = 0x831,
+  GPRS_SERVICES_NOT_ALLOWED = 0x832,
+  MS_IDENTITY_CANNOT_BE_DERIVED_BY_THE_NETWORK = 0x833,
+  IMPLICITLY_DETACHED = 0x834,
+  PLMN_NOT_ALLOWED = 0x835,
+  LOCATION_AREA_NOT_ALLOWED = 0x836,
+  GPRS_SERVICES_NOT_ALLOWED_IN_THIS_PLMN = 0x837,
+  PDP_DUPLICATE = 0x838,
+  UE_RAT_CHANGE = 0x839,
+  CONGESTION = 0x83A,
+  NO_PDP_CONTEXT_ACTIVATED = 0x83B,
+  ACCESS_CLASS_DSAC_REJECTION = 0x83C,
+  PDP_ACTIVATE_MAX_RETRY_FAILED = 0x83D,
+  RADIO_ACCESS_BEARER_FAILURE = 0x83E,
+  ESM_UNKNOWN_EPS_BEARER_CONTEXT = 0x83F,
+  DRB_RELEASED_BY_RRC = 0x840,
+  CONNECTION_RELEASED = 0x841,
+  EMM_DETACHED = 0x842,
+  EMM_ATTACH_FAILED = 0x843,
+  EMM_ATTACH_STARTED = 0x844,
+  LTE_NAS_SERVICE_REQUEST_FAILED = 0x845,
+  DUPLICATE_BEARER_ID = 0x846,
+  ESM_COLLISION_SCENARIOS = 0x847,
+  ESM_BEARER_DEACTIVATED_TO_SYNC_WITH_NETWORK = 0x848,
+  ESM_NW_ACTIVATED_DED_BEARER_WITH_ID_OF_DEF_BEARER = 0x849,
+  ESM_BAD_OTA_MESSAGE = 0x84A,
+  ESM_DOWNLOAD_SERVER_REJECTED_THE_CALL = 0x84B,
+  ESM_CONTEXT_TRANSFERRED_DUE_TO_IRAT = 0x84C,
+  DS_EXPLICIT_DEACTIVATION = 0x84D,
+  ESM_LOCAL_CAUSE_NONE = 0x84E,
+  LTE_THROTTLING_NOT_REQUIRED = 0x84F,
+  ACCESS_CONTROL_LIST_CHECK_FAILURE = 0x850,
+  SERVICE_NOT_ALLOWED_ON_PLMN = 0x851,
+  EMM_T3417_EXPIRED = 0x852,
+  EMM_T3417_EXT_EXPIRED = 0x853,
+  RRC_UPLINK_DATA_TRANSMISSION_FAILURE = 0x854,
+  RRC_UPLINK_DELIVERY_FAILED_DUE_TO_HANDOVER = 0x855,
+  RRC_UPLINK_CONNECTION_RELEASE = 0x856,
+  RRC_UPLINK_RADIO_LINK_FAILURE = 0x857,
+  RRC_UPLINK_ERROR_REQUEST_FROM_NAS = 0x858,
+  RRC_CONNECTION_ACCESS_STRATUM_FAILURE = 0x859,
+  RRC_CONNECTION_ANOTHER_PROCEDURE_IN_PROGRESS = 0x85A,
+  RRC_CONNECTION_ACCESS_BARRED = 0x85B,
+  RRC_CONNECTION_CELL_RESELECTION = 0x85C,
+  RRC_CONNECTION_CONFIG_FAILURE = 0x85D,
+  RRC_CONNECTION_TIMER_EXPIRED = 0x85E,
+  RRC_CONNECTION_LINK_FAILURE = 0x85F,
+  RRC_CONNECTION_CELL_NOT_CAMPED = 0x860,
+  RRC_CONNECTION_SYSTEM_INTERVAL_FAILURE = 0x861,
+  RRC_CONNECTION_REJECT_BY_NETWORK = 0x862,
+  RRC_CONNECTION_NORMAL_RELEASE = 0x863,
+  RRC_CONNECTION_RADIO_LINK_FAILURE = 0x864,
+  RRC_CONNECTION_REESTABLISHMENT_FAILURE = 0x865,
+  RRC_CONNECTION_OUT_OF_SERVICE_DURING_CELL_REGISTER = 0x866,
+  RRC_CONNECTION_ABORT_REQUEST = 0x867,
+  RRC_CONNECTION_SYSTEM_INFORMATION_BLOCK_READ_ERROR = 0x868,
+  NETWORK_INITIATED_DETACH_WITH_AUTO_REATTACH = 0x869,
+  NETWORK_INITIATED_DETACH_NO_AUTO_REATTACH = 0x86A,
+  ESM_PROCEDURE_TIME_OUT = 0x86B,
+  INVALID_CONNECTION_ID = 0x86C,
+  MAXIMIUM_NSAPIS_EXCEEDED = 0x86D,
+  INVALID_PRIMARY_NSAPI = 0x86E,
+  CANNOT_ENCODE_OTA_MESSAGE = 0x86F,
+  RADIO_ACCESS_BEARER_SETUP_FAILURE = 0x870,
+  PDP_ESTABLISH_TIMEOUT_EXPIRED = 0x871,
+  PDP_MODIFY_TIMEOUT_EXPIRED = 0x872,
+  PDP_INACTIVE_TIMEOUT_EXPIRED = 0x873,
+  PDP_LOWERLAYER_ERROR = 0x874,
+  PDP_MODIFY_COLLISION = 0x875,
+  /**
+   * @deprecated use MAXIMUM_SIZE_OF_L2_MESSAGE_EXCEEDED instead.
+   */
+  MAXINUM_SIZE_OF_L2_MESSAGE_EXCEEDED = 0x876,
+  MAXIMUM_SIZE_OF_L2_MESSAGE_EXCEEDED = 0x876,
+  NAS_REQUEST_REJECTED_BY_NETWORK = 0x877,
+  RRC_CONNECTION_INVALID_REQUEST = 0x878,
+  RRC_CONNECTION_TRACKING_AREA_ID_CHANGED = 0x879,
+  RRC_CONNECTION_RF_UNAVAILABLE = 0x87A,
+  RRC_CONNECTION_ABORTED_DUE_TO_IRAT_CHANGE = 0x87B,
+  RRC_CONNECTION_RELEASED_SECURITY_NOT_ACTIVE = 0x87C,
+  RRC_CONNECTION_ABORTED_AFTER_HANDOVER = 0x87D,
+  RRC_CONNECTION_ABORTED_AFTER_IRAT_CELL_CHANGE = 0x87E,
+  RRC_CONNECTION_ABORTED_DURING_IRAT_CELL_CHANGE = 0x87F,
+  IMSI_UNKNOWN_IN_HOME_SUBSCRIBER_SERVER = 0x880,
+  IMEI_NOT_ACCEPTED = 0x881,
+  EPS_SERVICES_AND_NON_EPS_SERVICES_NOT_ALLOWED = 0x882,
+  EPS_SERVICES_NOT_ALLOWED_IN_PLMN = 0x883,
+  MSC_TEMPORARILY_NOT_REACHABLE = 0x884,
+  CS_DOMAIN_NOT_AVAILABLE = 0x885,
+  ESM_FAILURE = 0x886,
+  MAC_FAILURE = 0x887,
+  SYNCHRONIZATION_FAILURE = 0x888,
+  UE_SECURITY_CAPABILITIES_MISMATCH = 0x889,
+  SECURITY_MODE_REJECTED = 0x88A,
+  UNACCEPTABLE_NON_EPS_AUTHENTICATION = 0x88B,
+  CS_FALLBACK_CALL_ESTABLISHMENT_NOT_ALLOWED = 0x88C,
+  NO_EPS_BEARER_CONTEXT_ACTIVATED = 0x88D,
+  INVALID_EMM_STATE = 0x88E,
+  NAS_LAYER_FAILURE = 0x88F,
+  MULTIPLE_PDP_CALL_NOT_ALLOWED = 0x890,
+  EMBMS_NOT_ENABLED = 0x891,
+  IRAT_HANDOVER_FAILED = 0x892,
+  EMBMS_REGULAR_DEACTIVATION = 0x893,
+  TEST_LOOPBACK_REGULAR_DEACTIVATION = 0x894,
+  LOWER_LAYER_REGISTRATION_FAILURE = 0x895,
+  DATA_PLAN_EXPIRED = 0x896,
+  UMTS_HANDOVER_TO_IWLAN = 0x897,
+  EVDO_CONNECTION_DENY_BY_GENERAL_OR_NETWORK_BUSY = 0x898,
+  EVDO_CONNECTION_DENY_BY_BILLING_OR_AUTHENTICATION_FAILURE = 0x899,
+  EVDO_HDR_CHANGED = 0x89A,
+  EVDO_HDR_EXITED = 0x89B,
+  EVDO_HDR_NO_SESSION = 0x89C,
+  EVDO_USING_GPS_FIX_INSTEAD_OF_HDR_CALL = 0x89D,
+  EVDO_HDR_CONNECTION_SETUP_TIMEOUT = 0x89E,
+  FAILED_TO_ACQUIRE_COLOCATED_HDR = 0x89F,
+  OTASP_COMMIT_IN_PROGRESS = 0x8A0,
+  NO_HYBRID_HDR_SERVICE = 0x8A1,
+  HDR_NO_LOCK_GRANTED = 0x8A2,
+  DBM_OR_SMS_IN_PROGRESS = 0x8A3,
+  HDR_FADE = 0x8A4,
+  HDR_ACCESS_FAILURE = 0x8A5,
+  UNSUPPORTED_1X_PREV = 0x8A6,
+  LOCAL_END = 0x8A7,
+  NO_SERVICE = 0x8A8,
+  FADE = 0x8A9,
+  NORMAL_RELEASE = 0x8AA,
+  ACCESS_ATTEMPT_ALREADY_IN_PROGRESS = 0x8AB,
+  REDIRECTION_OR_HANDOFF_IN_PROGRESS = 0x8AC,
+  EMERGENCY_MODE = 0x8AD,
+  PHONE_IN_USE = 0x8AE,
+  INVALID_MODE = 0x8AF,
+  INVALID_SIM_STATE = 0x8B0,
+  NO_COLLOCATED_HDR = 0x8B1,
+  UE_IS_ENTERING_POWERSAVE_MODE = 0x8B2,
+  DUAL_SWITCH = 0x8B3,
+  PPP_TIMEOUT = 0x8B4,
+  PPP_AUTH_FAILURE = 0x8B5,
+  PPP_OPTION_MISMATCH = 0x8B6,
+  PPP_PAP_FAILURE = 0x8B7,
+  PPP_CHAP_FAILURE = 0x8B8,
+  PPP_CLOSE_IN_PROGRESS = 0x8B9,
+  LIMITED_TO_IPV4 = 0x8BA,
+  LIMITED_TO_IPV6 = 0x8BB,
+  VSNCP_TIMEOUT = 0x8BC,
+  VSNCP_GEN_ERROR = 0x8BD,
+  VSNCP_APN_UNAUTHORIZED = 0x8BE,
+  VSNCP_PDN_LIMIT_EXCEEDED = 0x8BF,
+  VSNCP_NO_PDN_GATEWAY_ADDRESS = 0x8C0,
+  VSNCP_PDN_GATEWAY_UNREACHABLE = 0x8C1,
+  VSNCP_PDN_GATEWAY_REJECT = 0x8C2,
+  VSNCP_INSUFFICIENT_PARAMETERS = 0x8C3,
+  VSNCP_RESOURCE_UNAVAILABLE = 0x8C4,
+  VSNCP_ADMINISTRATIVELY_PROHIBITED = 0x8C5,
+  VSNCP_PDN_ID_IN_USE = 0x8C6,
+  VSNCP_SUBSCRIBER_LIMITATION = 0x8C7,
+  VSNCP_PDN_EXISTS_FOR_THIS_APN = 0x8C8,
+  VSNCP_RECONNECT_NOT_ALLOWED = 0x8C9,
+  IPV6_PREFIX_UNAVAILABLE = 0x8CA,
+  HANDOFF_PREFERENCE_CHANGED = 0x8CB,
+  SLICE_REJECTED = 0x8CC,
+  MATCH_ALL_RULE_NOT_ALLOWED = 0x8CD,
+  ALL_MATCHING_RULES_FAILED = 0x8CE,
 }
diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/DataProfileInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/DataProfileInfo.aidl
index 16fada1..0136fa4 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/DataProfileInfo.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/DataProfileInfo.aidl
@@ -60,7 +60,7 @@
   const int ID_FOTA = 3;
   const int ID_CBS = 4;
   const int ID_OEM_BASE = 1000;
-  const int ID_INVALID = -1;
+  const int ID_INVALID = 0xFFFFFFFF;
   const int TYPE_COMMON = 0;
   const int TYPE_3GPP = 1;
   const int TYPE_3GPP2 = 2;
diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/DataThrottlingAction.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/DataThrottlingAction.aidl
index 4f976cd..e80a764 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/DataThrottlingAction.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/DataThrottlingAction.aidl
@@ -34,8 +34,8 @@
 package android.hardware.radio.data;
 @Backing(type="byte") @JavaDerive(toString=true) @VintfStability
 enum DataThrottlingAction {
-  NO_DATA_THROTTLING = 0,
-  THROTTLE_SECONDARY_CARRIER = 1,
-  THROTTLE_ANCHOR_CARRIER = 2,
-  HOLD = 3,
+  NO_DATA_THROTTLING,
+  THROTTLE_SECONDARY_CARRIER,
+  THROTTLE_ANCHOR_CARRIER,
+  HOLD,
 }
diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/LinkAddress.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/LinkAddress.aidl
index 48e646e..77d637b 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/LinkAddress.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/LinkAddress.aidl
@@ -39,5 +39,5 @@
   long deprecationTime;
   long expirationTime;
   const int ADDRESS_PROPERTY_NONE = 0;
-  const int ADDRESS_PROPERTY_DEPRECATED = 32;
+  const int ADDRESS_PROPERTY_DEPRECATED = 0x20;
 }
diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/NrQos.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/NrQos.aidl
index a0792c3..be859b7 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/NrQos.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/NrQos.aidl
@@ -37,12 +37,13 @@
   int fiveQi;
   android.hardware.radio.data.QosBandwidth downlink;
   android.hardware.radio.data.QosBandwidth uplink;
-  /**
-   * @deprecated use qosFlowIdentifier.
-   */
   byte qfi;
+  /**
+   * @deprecated use averagingWindowMillis;
+   */
   char averagingWindowMs;
-  int qosFlowIdentifier;
+  int averagingWindowMillis = AVERAGING_WINDOW_UNKNOWN;
   const byte FLOW_ID_RANGE_MIN = 1;
   const byte FLOW_ID_RANGE_MAX = 63;
+  const int AVERAGING_WINDOW_UNKNOWN = (-1);
 }
diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/PdpProtocolType.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/PdpProtocolType.aidl
index 9771e5c..d1c4a62 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/PdpProtocolType.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/PdpProtocolType.aidl
@@ -34,7 +34,7 @@
 package android.hardware.radio.data;
 @Backing(type="int") @JavaDerive(toString=true) @VintfStability
 enum PdpProtocolType {
-  UNKNOWN = -1,
+  UNKNOWN = (-1),
   IP = 0,
   IPV6 = 1,
   IPV4V6 = 2,
diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/QosFilter.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/QosFilter.aidl
index e22b359..de45cc5 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/QosFilter.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/QosFilter.aidl
@@ -47,7 +47,7 @@
   const byte DIRECTION_DOWNLINK = 0;
   const byte DIRECTION_UPLINK = 1;
   const byte DIRECTION_BIDIRECTIONAL = 2;
-  const byte PROTOCOL_UNSPECIFIED = -1;
+  const byte PROTOCOL_UNSPECIFIED = (-1);
   const byte PROTOCOL_TCP = 6;
   const byte PROTOCOL_UDP = 17;
   const byte PROTOCOL_ESP = 50;
diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/RouteSelectionDescriptor.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/RouteSelectionDescriptor.aidl
index 434ee7d..d83df81 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/RouteSelectionDescriptor.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/RouteSelectionDescriptor.aidl
@@ -39,7 +39,7 @@
   byte sscMode;
   android.hardware.radio.data.SliceInfo[] sliceInfo;
   String[] dnn;
-  const byte SSC_MODE_UNKNOWN = -1;
+  const byte SSC_MODE_UNKNOWN = (-1);
   const byte SSC_MODE_1 = 1;
   const byte SSC_MODE_2 = 2;
   const byte SSC_MODE_3 = 3;
diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/AmrMode.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/AmrMode.aidl
index 5179169..84376b7 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/AmrMode.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/AmrMode.aidl
@@ -34,13 +34,13 @@
 package android.hardware.radio.ims.media;
 @Backing(type="int") @VintfStability
 enum AmrMode {
-  AMR_MODE_0 = 1 << 0,
-  AMR_MODE_1 = 1 << 1,
-  AMR_MODE_2 = 1 << 2,
-  AMR_MODE_3 = 1 << 3,
-  AMR_MODE_4 = 1 << 4,
-  AMR_MODE_5 = 1 << 5,
-  AMR_MODE_6 = 1 << 6,
-  AMR_MODE_7 = 1 << 7,
-  AMR_MODE_8 = 1 << 8,
+  AMR_MODE_0 = (1 << 0),
+  AMR_MODE_1 = (1 << 1),
+  AMR_MODE_2 = (1 << 2),
+  AMR_MODE_3 = (1 << 3),
+  AMR_MODE_4 = (1 << 4),
+  AMR_MODE_5 = (1 << 5),
+  AMR_MODE_6 = (1 << 6),
+  AMR_MODE_7 = (1 << 7),
+  AMR_MODE_8 = (1 << 8),
 }
diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/AnbrBitrate.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/AnbrMode.aidl
similarity index 90%
copy from radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/AnbrBitrate.aidl
copy to radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/AnbrMode.aidl
index 711ac19..c108c07 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/AnbrBitrate.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/AnbrMode.aidl
@@ -32,9 +32,8 @@
 // later when a module using the interface is updated, e.g., Mainline modules.
 
 package android.hardware.radio.ims.media;
-@VintfStability
-parcelable AnbrBitrate {
-  int uplinkBps;
-  int downlinkBps;
-  const int INVALID_ANBR_BITRATE = -1;
+@JavaDerive(toString=true) @VintfStability
+parcelable AnbrMode {
+  android.hardware.radio.ims.media.CodecMode anbrUplinkMode;
+  android.hardware.radio.ims.media.CodecMode anbrDownlinkMode;
 }
diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/AnbrBitrate.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/CodecMode.aidl
similarity index 90%
copy from radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/AnbrBitrate.aidl
copy to radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/CodecMode.aidl
index 711ac19..0e9140f 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/AnbrBitrate.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/CodecMode.aidl
@@ -32,9 +32,9 @@
 // later when a module using the interface is updated, e.g., Mainline modules.
 
 package android.hardware.radio.ims.media;
-@VintfStability
-parcelable AnbrBitrate {
-  int uplinkBps;
-  int downlinkBps;
-  const int INVALID_ANBR_BITRATE = -1;
+@JavaDerive(toString=true) @VintfStability
+union CodecMode {
+  boolean noinit;
+  android.hardware.radio.ims.media.AmrMode amr;
+  android.hardware.radio.ims.media.EvsMode evs;
 }
diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/CodecType.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/CodecType.aidl
index 56d2800..9eaf129 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/CodecType.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/CodecType.aidl
@@ -34,9 +34,9 @@
 package android.hardware.radio.ims.media;
 @Backing(type="int") @VintfStability
 enum CodecType {
-  AMR = 1,
-  AMR_WB = 2,
-  EVS = 4,
-  PCMA = 8,
-  PCMU = 16,
+  AMR = (1 << 0),
+  AMR_WB = (1 << 1),
+  EVS = (1 << 2),
+  PCMA = (1 << 3),
+  PCMU = (1 << 4),
 }
diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/EvsBandwidth.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/EvsBandwidth.aidl
index eb31175..5e80f91 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/EvsBandwidth.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/EvsBandwidth.aidl
@@ -35,8 +35,8 @@
 @Backing(type="int") @VintfStability
 enum EvsBandwidth {
   NONE = 0,
-  NARROW_BAND = 1,
-  WIDE_BAND = 2,
-  SUPER_WIDE_BAND = 4,
-  FULL_BAND = 8,
+  NARROW_BAND = (1 << 0),
+  WIDE_BAND = (1 << 1),
+  SUPER_WIDE_BAND = (1 << 2),
+  FULL_BAND = (1 << 3),
 }
diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/EvsMode.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/EvsMode.aidl
index a067357..a530a8d 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/EvsMode.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/EvsMode.aidl
@@ -34,25 +34,25 @@
 package android.hardware.radio.ims.media;
 @Backing(type="int") @VintfStability
 enum EvsMode {
-  EVS_MODE_0 = 1 << 0,
-  EVS_MODE_1 = 1 << 1,
-  EVS_MODE_2 = 1 << 2,
-  EVS_MODE_3 = 1 << 3,
-  EVS_MODE_4 = 1 << 4,
-  EVS_MODE_5 = 1 << 5,
-  EVS_MODE_6 = 1 << 6,
-  EVS_MODE_7 = 1 << 7,
-  EVS_MODE_8 = 1 << 8,
-  EVS_MODE_9 = 1 << 9,
-  EVS_MODE_10 = 1 << 10,
-  EVS_MODE_11 = 1 << 11,
-  EVS_MODE_12 = 1 << 12,
-  EVS_MODE_13 = 1 << 13,
-  EVS_MODE_14 = 1 << 14,
-  EVS_MODE_15 = 1 << 15,
-  EVS_MODE_16 = 1 << 16,
-  EVS_MODE_17 = 1 << 17,
-  EVS_MODE_18 = 1 << 18,
-  EVS_MODE_19 = 1 << 19,
-  EVS_MODE_20 = 1 << 20,
+  EVS_MODE_0 = (1 << 0),
+  EVS_MODE_1 = (1 << 1),
+  EVS_MODE_2 = (1 << 2),
+  EVS_MODE_3 = (1 << 3),
+  EVS_MODE_4 = (1 << 4),
+  EVS_MODE_5 = (1 << 5),
+  EVS_MODE_6 = (1 << 6),
+  EVS_MODE_7 = (1 << 7),
+  EVS_MODE_8 = (1 << 8),
+  EVS_MODE_9 = (1 << 9),
+  EVS_MODE_10 = (1 << 10),
+  EVS_MODE_11 = (1 << 11),
+  EVS_MODE_12 = (1 << 12),
+  EVS_MODE_13 = (1 << 13),
+  EVS_MODE_14 = (1 << 14),
+  EVS_MODE_15 = (1 << 15),
+  EVS_MODE_16 = (1 << 16),
+  EVS_MODE_17 = (1 << 17),
+  EVS_MODE_18 = (1 << 18),
+  EVS_MODE_19 = (1 << 19),
+  EVS_MODE_20 = (1 << 20),
 }
diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/IImsMediaSessionListener.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/IImsMediaSessionListener.aidl
index f03b29e..cb221df 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/IImsMediaSessionListener.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/IImsMediaSessionListener.aidl
@@ -37,10 +37,8 @@
   oneway void onModifySessionResponse(in android.hardware.radio.ims.media.RtpConfig config, android.hardware.radio.ims.media.RtpError error);
   oneway void onFirstMediaPacketReceived(in android.hardware.radio.ims.media.RtpConfig config);
   oneway void onHeaderExtensionReceived(in List<android.hardware.radio.ims.media.RtpHeaderExtension> extensions);
-  oneway void notifyMediaInactivity(android.hardware.radio.ims.media.MediaProtocolType packetType);
-  oneway void notifyPacketLoss(int packetLossPercentage);
-  oneway void notifyJitter(int jitter);
+  oneway void notifyMediaQualityStatus(in android.hardware.radio.ims.media.MediaQualityStatus quality);
   oneway void triggerAnbrQuery(in android.hardware.radio.ims.media.RtpConfig config);
-  oneway void onDtmfReceived(char dtmfDigit);
+  oneway void onDtmfReceived(char dtmfDigit, int durationMs);
   oneway void onCallQualityChanged(in android.hardware.radio.ims.media.CallQuality callQuality);
 }
diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/AnbrBitrate.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/MediaQualityStatus.aidl
similarity index 89%
copy from radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/AnbrBitrate.aidl
copy to radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/MediaQualityStatus.aidl
index 711ac19..4accf53 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/AnbrBitrate.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/MediaQualityStatus.aidl
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2022 The Android Open Source Project
+ * Copyright (C) 2023 The Android Open Source Project
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -33,8 +33,9 @@
 
 package android.hardware.radio.ims.media;
 @VintfStability
-parcelable AnbrBitrate {
-  int uplinkBps;
-  int downlinkBps;
-  const int INVALID_ANBR_BITRATE = -1;
+parcelable MediaQualityStatus {
+  int rtpInactivityTimeMillis;
+  int rtcpInactivityTimeMillis;
+  int rtpPacketLossRate;
+  int rtpJitterMillis;
 }
diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/MediaQualityThreshold.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/MediaQualityThreshold.aidl
index a448bac..31cf373 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/MediaQualityThreshold.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/MediaQualityThreshold.aidl
@@ -34,10 +34,11 @@
 package android.hardware.radio.ims.media;
 @VintfStability
 parcelable MediaQualityThreshold {
-  int rtpInactivityTimerMillis;
+  int[] rtpInactivityTimerMillis;
   int rtcpInactivityTimerMillis;
   int rtpPacketLossDurationMillis;
-  int rtpPacketLossRate;
-  int jitterDurationMillis;
-  int rtpJitterMillis;
+  int rtpHysteresisTimeInMillis;
+  int[] rtpPacketLossRate;
+  int[] rtpJitterMillis;
+  boolean notifyCurrentStatus;
 }
diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/RtcpXrReportBlockType.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/RtcpXrReportBlockType.aidl
index 2eefe6f..0663754 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/RtcpXrReportBlockType.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/RtcpXrReportBlockType.aidl
@@ -35,11 +35,11 @@
 @Backing(type="int") @VintfStability
 enum RtcpXrReportBlockType {
   RTCPXR_NONE = 0,
-  RTCPXR_LOSS_RLE_REPORT_BLOCK = 1,
-  RTCPXR_DUPLICATE_RLE_REPORT_BLOCK = 2,
-  RTCPXR_PACKET_RECEIPT_TIMES_REPORT_BLOCK = 4,
-  RTCPXR_RECEIVER_REFERENCE_TIME_REPORT_BLOCK = 8,
-  RTCPXR_DLRR_REPORT_BLOCK = 16,
-  RTCPXR_STATISTICS_SUMMARY_REPORT_BLOCK = 32,
-  RTCPXR_VOIP_METRICS_REPORT_BLOCK = 64,
+  RTCPXR_LOSS_RLE_REPORT_BLOCK = (1 << 0),
+  RTCPXR_DUPLICATE_RLE_REPORT_BLOCK = (1 << 1),
+  RTCPXR_PACKET_RECEIPT_TIMES_REPORT_BLOCK = (1 << 2),
+  RTCPXR_RECEIVER_REFERENCE_TIME_REPORT_BLOCK = (1 << 3),
+  RTCPXR_DLRR_REPORT_BLOCK = (1 << 4),
+  RTCPXR_STATISTICS_SUMMARY_REPORT_BLOCK = (1 << 5),
+  RTCPXR_VOIP_METRICS_REPORT_BLOCK = (1 << 6),
 }
diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/RtpConfig.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/RtpConfig.aidl
index ad8b86c..1a8921e 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/RtpConfig.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/RtpConfig.aidl
@@ -39,5 +39,5 @@
   android.hardware.radio.ims.media.RtpAddress remoteAddress;
   android.hardware.radio.ims.media.RtpSessionParams sessionParams;
   android.hardware.radio.ims.media.RtcpConfig rtcpConfig;
-  android.hardware.radio.ims.media.AnbrBitrate anbrBitrateParams;
+  android.hardware.radio.ims.media.AnbrMode anbrModeParams;
 }
diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/ConnectionFailureInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/ConnectionFailureInfo.aidl
index 030479f..90e75f9 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/ConnectionFailureInfo.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/ConnectionFailureInfo.aidl
@@ -48,6 +48,6 @@
     REASON_NO_SERVICE = 7,
     REASON_PDN_NOT_AVAILABLE = 8,
     REASON_RF_BUSY = 9,
-    REASON_UNSPECIFIED = 65535,
+    REASON_UNSPECIFIED = 0xFFFF,
   }
 }
diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/ImsCall.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/ImsCall.aidl
index e48653b..6e14830 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/ImsCall.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/ImsCall.aidl
@@ -42,23 +42,23 @@
   boolean isHeldByRemote;
   @Backing(type="int")
   enum CallType {
-    NORMAL = 0,
-    EMERGENCY = 1,
+    NORMAL,
+    EMERGENCY,
   }
   @Backing(type="int")
   enum CallState {
-    ACTIVE = 0,
-    HOLDING = 1,
-    DIALING = 2,
-    ALERTING = 3,
-    INCOMING = 4,
-    WAITING = 5,
-    DISCONNECTING = 6,
-    DISCONNECTED = 7,
+    ACTIVE,
+    HOLDING,
+    DIALING,
+    ALERTING,
+    INCOMING,
+    WAITING,
+    DISCONNECTING,
+    DISCONNECTED,
   }
   @Backing(type="int")
   enum Direction {
-    INCOMING = 0,
-    OUTGOING = 1,
+    INCOMING,
+    OUTGOING,
   }
 }
diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/ImsRegistration.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/ImsRegistration.aidl
index 1c4c12a..be5e004 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/ImsRegistration.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/ImsRegistration.aidl
@@ -39,8 +39,8 @@
   android.hardware.radio.ims.SuggestedAction suggestedAction;
   int capabilities;
   const int IMS_MMTEL_CAPABILITY_NONE = 0;
-  const int IMS_MMTEL_CAPABILITY_VOICE = 1;
-  const int IMS_MMTEL_CAPABILITY_VIDEO = 2;
-  const int IMS_MMTEL_CAPABILITY_SMS = 4;
-  const int IMS_RCS_CAPABILITIES = 8;
+  const int IMS_MMTEL_CAPABILITY_VOICE = (1 << 0);
+  const int IMS_MMTEL_CAPABILITY_VIDEO = (1 << 1);
+  const int IMS_MMTEL_CAPABILITY_SMS = (1 << 2);
+  const int IMS_RCS_CAPABILITIES = (1 << 3);
 }
diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/ImsRegistrationState.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/ImsRegistrationState.aidl
index 664f561..6302b47 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/ImsRegistrationState.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/ImsRegistrationState.aidl
@@ -34,6 +34,6 @@
 package android.hardware.radio.ims;
 @Backing(type="int") @JavaDerive(toString=true) @VintfStability
 enum ImsRegistrationState {
-  NOT_REGISTERED = 0,
-  REGISTERED = 1,
+  NOT_REGISTERED,
+  REGISTERED,
 }
diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/ImsTrafficType.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/ImsTrafficType.aidl
index f7654b4..b1a0b77 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/ImsTrafficType.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/ImsTrafficType.aidl
@@ -34,11 +34,11 @@
 package android.hardware.radio.ims;
 @Backing(type="int") @JavaDerive(toString=true) @VintfStability
 enum ImsTrafficType {
-  EMERGENCY = 0,
-  EMERGENCY_SMS = 1,
-  VOICE = 2,
-  VIDEO = 3,
-  SMS = 4,
-  REGISTRATION = 5,
-  UT_XCAP = 6,
+  EMERGENCY,
+  EMERGENCY_SMS,
+  VOICE,
+  VIDEO,
+  SMS,
+  REGISTRATION,
+  UT_XCAP,
 }
diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/SrvccCall.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/SrvccCall.aidl
index a8b7cfc..5119b0f 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/SrvccCall.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/SrvccCall.aidl
@@ -47,18 +47,18 @@
   int namePresentation;
   @Backing(type="int") @VintfStability
   enum CallType {
-    NORMAL = 0,
-    EMERGENCY = 1,
+    NORMAL,
+    EMERGENCY,
   }
   @Backing(type="int") @VintfStability
   enum CallSubState {
-    NONE = 0,
-    PREALERTING = 1,
+    NONE,
+    PREALERTING,
   }
   @Backing(type="int") @VintfStability
   enum ToneType {
-    NONE = 0,
-    LOCAL = 1,
-    NETWORK = 2,
+    NONE,
+    LOCAL,
+    NETWORK,
   }
 }
diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/SuggestedAction.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/SuggestedAction.aidl
index da19774..bbe170e 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/SuggestedAction.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/SuggestedAction.aidl
@@ -34,7 +34,7 @@
 package android.hardware.radio.ims;
 @Backing(type="int") @JavaDerive(toString=true) @VintfStability
 enum SuggestedAction {
-  NONE = 0,
-  TRIGGER_PLMN_BLOCK = 1,
-  TRIGGER_PLMN_BLOCK_WITH_TIMEOUT = 2,
+  NONE,
+  TRIGGER_PLMN_BLOCK,
+  TRIGGER_PLMN_BLOCK_WITH_TIMEOUT,
 }
diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/SmsAcknowledgeFailCause.aidl b/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/SmsAcknowledgeFailCause.aidl
index 019b185..d061c9e 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/SmsAcknowledgeFailCause.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/SmsAcknowledgeFailCause.aidl
@@ -34,6 +34,6 @@
 package android.hardware.radio.messaging;
 @Backing(type="int") @JavaDerive(toString=true) @VintfStability
 enum SmsAcknowledgeFailCause {
-  MEMORY_CAPACITY_EXCEEDED = 211,
-  UNSPECIFIED_ERROR = 255,
+  MEMORY_CAPACITY_EXCEEDED = 0xD3,
+  UNSPECIFIED_ERROR = 0XFF,
 }
diff --git a/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/DeviceStateType.aidl b/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/DeviceStateType.aidl
index 4e8c6d7..acc0b22 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/DeviceStateType.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/DeviceStateType.aidl
@@ -34,7 +34,7 @@
 package android.hardware.radio.modem;
 @Backing(type="int") @JavaDerive(toString=true) @VintfStability
 enum DeviceStateType {
-  POWER_SAVE_MODE = 0,
-  CHARGING_STATE = 1,
-  LOW_DATA_EXPECTED = 2,
+  POWER_SAVE_MODE,
+  CHARGING_STATE,
+  LOW_DATA_EXPECTED,
 }
diff --git a/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/ImeiInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/ImeiInfo.aidl
index dda7062..f8776ec 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/ImeiInfo.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/ImeiInfo.aidl
@@ -34,12 +34,12 @@
 package android.hardware.radio.modem;
 @JavaDerive(toString=true) @VintfStability
 parcelable ImeiInfo {
+  android.hardware.radio.modem.ImeiInfo.ImeiType type;
+  String imei;
+  String svn;
   @Backing(type="int") @VintfStability
   enum ImeiType {
     PRIMARY = 1,
     SECONDARY = 2,
   }
-  ImeiType type;
-  String imei;
-  String svn;
-}
\ No newline at end of file
+}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/ResetNvType.aidl b/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/ResetNvType.aidl
index e3b5796..37622b1 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/ResetNvType.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/ResetNvType.aidl
@@ -34,7 +34,7 @@
 package android.hardware.radio.modem;
 @Backing(type="int") @JavaDerive(toString=true) @VintfStability
 enum ResetNvType {
-  RELOAD = 0,
-  ERASE = 1,
-  FACTORY_RESET = 2,
+  RELOAD,
+  ERASE,
+  FACTORY_RESET,
 }
diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/Cdma2000RegistrationInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/Cdma2000RegistrationInfo.aidl
index 74c4e29..927f9ac 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/Cdma2000RegistrationInfo.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/Cdma2000RegistrationInfo.aidl
@@ -38,7 +38,7 @@
   int roamingIndicator;
   int systemIsInPrl;
   int defaultRoamingIndicator;
-  const int PRL_INDICATOR_NOT_REGISTERED = -1;
+  const int PRL_INDICATOR_NOT_REGISTERED = (-1);
   const int PRL_INDICATOR_NOT_IN_PRL = 0;
   const int PRL_INDICATOR_IN_PRL = 1;
 }
diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CdmaRoamingType.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CdmaRoamingType.aidl
index 24ec26b..2a4db70 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CdmaRoamingType.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CdmaRoamingType.aidl
@@ -34,7 +34,7 @@
 package android.hardware.radio.network;
 @Backing(type="int") @JavaDerive(toString=true) @VintfStability
 enum CdmaRoamingType {
-  HOME_NETWORK = 0,
-  AFFILIATED_ROAM = 1,
-  ANY_ROAM = 2,
+  HOME_NETWORK,
+  AFFILIATED_ROAM,
+  ANY_ROAM,
 }
diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CellConnectionStatus.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CellConnectionStatus.aidl
index 8986d71..5ce3b3e 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CellConnectionStatus.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CellConnectionStatus.aidl
@@ -34,7 +34,7 @@
 package android.hardware.radio.network;
 @Backing(type="int") @JavaDerive(toString=true) @VintfStability
 enum CellConnectionStatus {
-  NONE = 0,
-  PRIMARY_SERVING = 1,
-  SECONDARY_SERVING = 2,
+  NONE,
+  PRIMARY_SERVING,
+  SECONDARY_SERVING,
 }
diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/Domain.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/Domain.aidl
index 209cf5e..6b022b6 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/Domain.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/Domain.aidl
@@ -34,6 +34,6 @@
 package android.hardware.radio.network;
 @Backing(type="int") @JavaDerive(toString=true) @VintfStability
 enum Domain {
-  CS = 1,
-  PS = 2,
+  CS = (1 << 0),
+  PS = (1 << 1),
 }
diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/EutranRegistrationInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/EutranRegistrationInfo.aidl
index 93df3a4..90e342a 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/EutranRegistrationInfo.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/EutranRegistrationInfo.aidl
@@ -38,11 +38,11 @@
   android.hardware.radio.network.NrIndicators nrIndicators;
   android.hardware.radio.network.EutranRegistrationInfo.AttachResultType lteAttachResultType;
   int extraInfo;
-  const int EXTRA_CSFB_NOT_PREFERRED = 1;
-  const int EXTRA_SMS_ONLY = 2;
+  const int EXTRA_CSFB_NOT_PREFERRED = (1 << 0);
+  const int EXTRA_SMS_ONLY = (1 << 1);
   enum AttachResultType {
-    NONE = 0,
-    EPS_ONLY = 1,
-    COMBINED = 2,
+    NONE,
+    EPS_ONLY,
+    COMBINED,
   }
 }
diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/IndicationFilter.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/IndicationFilter.aidl
index d9ed68e..00ba346 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/IndicationFilter.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/IndicationFilter.aidl
@@ -35,12 +35,12 @@
 @Backing(type="int") @JavaDerive(toString=true) @VintfStability
 enum IndicationFilter {
   NONE = 0,
-  ALL = -1,
-  SIGNAL_STRENGTH = 1,
-  FULL_NETWORK_STATE = 2,
-  DATA_CALL_DORMANCY_CHANGED = 4,
-  LINK_CAPACITY_ESTIMATE = 8,
-  PHYSICAL_CHANNEL_CONFIG = 16,
-  REGISTRATION_FAILURE = 32,
-  BARRING_INFO = 64,
+  ALL = (~0),
+  SIGNAL_STRENGTH = (1 << 0),
+  FULL_NETWORK_STATE = (1 << 1),
+  DATA_CALL_DORMANCY_CHANGED = (1 << 2),
+  LINK_CAPACITY_ESTIMATE = (1 << 3),
+  PHYSICAL_CHANNEL_CONFIG = (1 << 4),
+  REGISTRATION_FAILURE = (1 << 5),
+  BARRING_INFO = (1 << 6),
 }
diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/PhoneRestrictedState.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/PhoneRestrictedState.aidl
index 41555f9..4e3e39e 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/PhoneRestrictedState.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/PhoneRestrictedState.aidl
@@ -34,9 +34,9 @@
 package android.hardware.radio.network;
 @Backing(type="int") @JavaDerive(toString=true) @VintfStability
 enum PhoneRestrictedState {
-  NONE = 0,
-  CS_EMERGENCY = 1,
-  CS_NORMAL = 2,
-  CS_ALL = 4,
-  PS_ALL = 16,
+  NONE = 0x00,
+  CS_EMERGENCY = 0x01,
+  CS_NORMAL = 0x02,
+  CS_ALL = 0x04,
+  PS_ALL = 0x10,
 }
diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/RadioBandMode.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/RadioBandMode.aidl
index e9a9f60..74696fb 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/RadioBandMode.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/RadioBandMode.aidl
@@ -34,23 +34,23 @@
 package android.hardware.radio.network;
 @Backing(type="int") @JavaDerive(toString=true) @VintfStability
 enum RadioBandMode {
-  BAND_MODE_UNSPECIFIED = 0,
-  BAND_MODE_EURO = 1,
-  BAND_MODE_USA = 2,
-  BAND_MODE_JPN = 3,
-  BAND_MODE_AUS = 4,
-  BAND_MODE_AUS_2 = 5,
-  BAND_MODE_CELL_800 = 6,
-  BAND_MODE_PCS = 7,
-  BAND_MODE_JTACS = 8,
-  BAND_MODE_KOREA_PCS = 9,
-  BAND_MODE_5_450M = 10,
-  BAND_MODE_IMT2000 = 11,
-  BAND_MODE_7_700M_2 = 12,
-  BAND_MODE_8_1800M = 13,
-  BAND_MODE_9_900M = 14,
-  BAND_MODE_10_800M_2 = 15,
-  BAND_MODE_EURO_PAMR_400M = 16,
-  BAND_MODE_AWS = 17,
-  BAND_MODE_USA_2500M = 18,
+  BAND_MODE_UNSPECIFIED,
+  BAND_MODE_EURO,
+  BAND_MODE_USA,
+  BAND_MODE_JPN,
+  BAND_MODE_AUS,
+  BAND_MODE_AUS_2,
+  BAND_MODE_CELL_800,
+  BAND_MODE_PCS,
+  BAND_MODE_JTACS,
+  BAND_MODE_KOREA_PCS,
+  BAND_MODE_5_450M,
+  BAND_MODE_IMT2000,
+  BAND_MODE_7_700M_2,
+  BAND_MODE_8_1800M,
+  BAND_MODE_9_900M,
+  BAND_MODE_10_800M_2,
+  BAND_MODE_EURO_PAMR_400M,
+  BAND_MODE_AWS,
+  BAND_MODE_USA_2500M,
 }
diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/RegistrationFailCause.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/RegistrationFailCause.aidl
index e2cd44c..8acf8ab 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/RegistrationFailCause.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/RegistrationFailCause.aidl
@@ -56,7 +56,7 @@
   CONGESTION = 22,
   GSM_AUTHENTICATION_UNACCEPTABLE = 23,
   NOT_AUTHORIZED_FOR_THIS_CSG = 25,
-  SMS_PROVIDED_BY_GPRS_IN_ROUTING_AREA = 26,
+  SMS_PROVIDED_BY_GPRS_IN_ROUTING_AREA,
   SERVICE_OPTION_NOT_SUPPORTED = 32,
   SERVICE_OPTION_NOT_SUBSCRIBED = 33,
   SERVICE_OPTION_TEMPORARILY_OUT_OF_ORDER = 34,
diff --git a/radio/aidl/aidl_api/android.hardware.radio.sap/current/android/hardware/radio/sap/SapApduType.aidl b/radio/aidl/aidl_api/android.hardware.radio.sap/current/android/hardware/radio/sap/SapApduType.aidl
index e0e2a03..6cef92b 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.sap/current/android/hardware/radio/sap/SapApduType.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.sap/current/android/hardware/radio/sap/SapApduType.aidl
@@ -34,6 +34,6 @@
 package android.hardware.radio.sap;
 @Backing(type="int") @VintfStability
 enum SapApduType {
-  APDU = 0,
-  APDU7816 = 1,
+  APDU,
+  APDU7816,
 }
diff --git a/radio/aidl/aidl_api/android.hardware.radio.sap/current/android/hardware/radio/sap/SapConnectRsp.aidl b/radio/aidl/aidl_api/android.hardware.radio.sap/current/android/hardware/radio/sap/SapConnectRsp.aidl
index aceac37..841dfe3 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.sap/current/android/hardware/radio/sap/SapConnectRsp.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.sap/current/android/hardware/radio/sap/SapConnectRsp.aidl
@@ -34,9 +34,9 @@
 package android.hardware.radio.sap;
 @Backing(type="int") @VintfStability
 enum SapConnectRsp {
-  SUCCESS = 0,
-  CONNECT_FAILURE = 1,
-  MSG_SIZE_TOO_LARGE = 2,
-  MSG_SIZE_TOO_SMALL = 3,
-  CONNECT_OK_CALL_ONGOING = 4,
+  SUCCESS,
+  CONNECT_FAILURE,
+  MSG_SIZE_TOO_LARGE,
+  MSG_SIZE_TOO_SMALL,
+  CONNECT_OK_CALL_ONGOING,
 }
diff --git a/radio/aidl/aidl_api/android.hardware.radio.sap/current/android/hardware/radio/sap/SapDisconnectType.aidl b/radio/aidl/aidl_api/android.hardware.radio.sap/current/android/hardware/radio/sap/SapDisconnectType.aidl
index 0447f9b..dace1e1 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.sap/current/android/hardware/radio/sap/SapDisconnectType.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.sap/current/android/hardware/radio/sap/SapDisconnectType.aidl
@@ -34,6 +34,6 @@
 package android.hardware.radio.sap;
 @Backing(type="int") @VintfStability
 enum SapDisconnectType {
-  GRACEFUL = 0,
-  IMMEDIATE = 1,
+  GRACEFUL,
+  IMMEDIATE,
 }
diff --git a/radio/aidl/aidl_api/android.hardware.radio.sap/current/android/hardware/radio/sap/SapResultCode.aidl b/radio/aidl/aidl_api/android.hardware.radio.sap/current/android/hardware/radio/sap/SapResultCode.aidl
index 1db226b..a2a6df0 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.sap/current/android/hardware/radio/sap/SapResultCode.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.sap/current/android/hardware/radio/sap/SapResultCode.aidl
@@ -34,12 +34,12 @@
 package android.hardware.radio.sap;
 @Backing(type="int") @VintfStability
 enum SapResultCode {
-  SUCCESS = 0,
-  GENERIC_FAILURE = 1,
-  CARD_NOT_ACCESSSIBLE = 2,
-  CARD_ALREADY_POWERED_OFF = 3,
-  CARD_REMOVED = 4,
-  CARD_ALREADY_POWERED_ON = 5,
-  DATA_NOT_AVAILABLE = 6,
-  NOT_SUPPORTED = 7,
+  SUCCESS,
+  GENERIC_FAILURE,
+  CARD_NOT_ACCESSSIBLE,
+  CARD_ALREADY_POWERED_OFF,
+  CARD_REMOVED,
+  CARD_ALREADY_POWERED_ON,
+  DATA_NOT_AVAILABLE,
+  NOT_SUPPORTED,
 }
diff --git a/radio/aidl/aidl_api/android.hardware.radio.sap/current/android/hardware/radio/sap/SapStatus.aidl b/radio/aidl/aidl_api/android.hardware.radio.sap/current/android/hardware/radio/sap/SapStatus.aidl
index 32f71c2..6988c99 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.sap/current/android/hardware/radio/sap/SapStatus.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.sap/current/android/hardware/radio/sap/SapStatus.aidl
@@ -34,10 +34,10 @@
 package android.hardware.radio.sap;
 @Backing(type="int") @VintfStability
 enum SapStatus {
-  UNKNOWN_ERROR = 0,
-  CARD_RESET = 1,
-  CARD_NOT_ACCESSIBLE = 2,
-  CARD_REMOVED = 3,
-  CARD_INSERTED = 4,
-  RECOVERED = 5,
+  UNKNOWN_ERROR,
+  CARD_RESET,
+  CARD_NOT_ACCESSIBLE,
+  CARD_REMOVED,
+  CARD_INSERTED,
+  RECOVERED,
 }
diff --git a/radio/aidl/aidl_api/android.hardware.radio.sap/current/android/hardware/radio/sap/SapTransferProtocol.aidl b/radio/aidl/aidl_api/android.hardware.radio.sap/current/android/hardware/radio/sap/SapTransferProtocol.aidl
index e3ffdb0..3c6852e 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.sap/current/android/hardware/radio/sap/SapTransferProtocol.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.sap/current/android/hardware/radio/sap/SapTransferProtocol.aidl
@@ -34,6 +34,6 @@
 package android.hardware.radio.sap;
 @Backing(type="int") @VintfStability
 enum SapTransferProtocol {
-  T0 = 0,
-  T1 = 1,
+  T0,
+  T1,
 }
diff --git a/radio/aidl/aidl_api/android.hardware.radio.satellite/current/android/hardware/radio/satellite/IRadioSatellite.aidl b/radio/aidl/aidl_api/android.hardware.radio.satellite/current/android/hardware/radio/satellite/IRadioSatellite.aidl
new file mode 100644
index 0000000..a00e4f5
--- /dev/null
+++ b/radio/aidl/aidl_api/android.hardware.radio.satellite/current/android/hardware/radio/satellite/IRadioSatellite.aidl
@@ -0,0 +1,53 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE.                          //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+//     the interface (from the latest frozen version), the build system will
+//     prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.radio.satellite;
+@VintfStability
+interface IRadioSatellite {
+  oneway void addAllowedSatelliteContacts(in int serial, in String[] contacts);
+  oneway void getCapabilities(in int serial);
+  oneway void getMaxCharactersPerTextMessage(in int serial);
+  oneway void getPendingMessages(in int serial);
+  oneway void getPowerState(in int serial);
+  oneway void getSatelliteMode(in int serial);
+  oneway void getTimeForNextSatelliteVisibility(in int serial);
+  oneway void provisionService(in int serial, in String imei, in String msisdn, in String imsi, in android.hardware.radio.satellite.SatelliteFeature[] features);
+  oneway void removeAllowedSatelliteContacts(in int serial, in String[] contacts);
+  oneway void responseAcknowledgement();
+  oneway void sendMessages(in int serial, in String[] messages, in String destination, in double latitude, in double longitude);
+  oneway void setIndicationFilter(in int serial, in int filterBitmask);
+  oneway void setPower(in int serial, in boolean on);
+  oneway void setResponseFunctions(in android.hardware.radio.satellite.IRadioSatelliteResponse satelliteResponse, in android.hardware.radio.satellite.IRadioSatelliteIndication satelliteIndication);
+  oneway void startSendingSatellitePointingInfo(in int serial);
+  oneway void stopSendingSatellitePointingInfo(in int serial);
+}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/AnbrBitrate.aidl b/radio/aidl/aidl_api/android.hardware.radio.satellite/current/android/hardware/radio/satellite/IRadioSatelliteIndication.aidl
similarity index 61%
copy from radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/AnbrBitrate.aidl
copy to radio/aidl/aidl_api/android.hardware.radio.satellite/current/android/hardware/radio/satellite/IRadioSatelliteIndication.aidl
index 711ac19..6a03f26 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/AnbrBitrate.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.satellite/current/android/hardware/radio/satellite/IRadioSatelliteIndication.aidl
@@ -31,10 +31,14 @@
 // with such a backward incompatible change, it has a high risk of breaking
 // later when a module using the interface is updated, e.g., Mainline modules.
 
-package android.hardware.radio.ims.media;
+package android.hardware.radio.satellite;
 @VintfStability
-parcelable AnbrBitrate {
-  int uplinkBps;
-  int downlinkBps;
-  const int INVALID_ANBR_BITRATE = -1;
+interface IRadioSatelliteIndication {
+  oneway void onMessagesTransferComplete(in android.hardware.radio.RadioIndicationType type, in boolean complete);
+  oneway void onNewMessages(in android.hardware.radio.RadioIndicationType type, in String[] messages);
+  oneway void onPendingMessageCount(in android.hardware.radio.RadioIndicationType type, in int count);
+  oneway void onProvisionStateChanged(in android.hardware.radio.RadioIndicationType type, boolean provisioned, in android.hardware.radio.satellite.SatelliteFeature[] features);
+  oneway void onSatelliteModeChanged(in android.hardware.radio.RadioIndicationType type, in android.hardware.radio.satellite.SatelliteMode mode);
+  oneway void onSatellitePointingInfoChanged(in android.hardware.radio.RadioIndicationType type, in android.hardware.radio.satellite.PointingInfo pointingInfo);
+  oneway void onSatelliteRadioTechnologyChanged(in android.hardware.radio.RadioIndicationType type, in android.hardware.radio.satellite.NTRadioTechnology technology);
 }
diff --git a/radio/aidl/aidl_api/android.hardware.radio.satellite/current/android/hardware/radio/satellite/IRadioSatelliteResponse.aidl b/radio/aidl/aidl_api/android.hardware.radio.satellite/current/android/hardware/radio/satellite/IRadioSatelliteResponse.aidl
new file mode 100644
index 0000000..f6614b1
--- /dev/null
+++ b/radio/aidl/aidl_api/android.hardware.radio.satellite/current/android/hardware/radio/satellite/IRadioSatelliteResponse.aidl
@@ -0,0 +1,52 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE.                          //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+//     the interface (from the latest frozen version), the build system will
+//     prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.radio.satellite;
+@VintfStability
+interface IRadioSatelliteResponse {
+  oneway void acknowledgeRequest(in int serial);
+  oneway void addAllowedSatelliteContactsResponse(in android.hardware.radio.RadioResponseInfo info);
+  oneway void getCapabilitiesResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.satellite.SatelliteCapabilities capabilities);
+  oneway void getMaxCharactersPerTextMessageResponse(in android.hardware.radio.RadioResponseInfo info, in int charLimit);
+  oneway void getPendingMessagesResponse(in android.hardware.radio.RadioResponseInfo info, in String[] messages);
+  oneway void getPowerStateResponse(in android.hardware.radio.RadioResponseInfo info, in boolean on);
+  oneway void getSatelliteModeResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.satellite.SatelliteMode mode, in android.hardware.radio.satellite.NTRadioTechnology technology);
+  oneway void getTimeForNextSatelliteVisibilityResponse(in android.hardware.radio.RadioResponseInfo info, in int timeInSeconds);
+  oneway void provisionServiceResponse(in android.hardware.radio.RadioResponseInfo info, in boolean provisioned);
+  oneway void removeAllowedSatelliteContactsResponse(in android.hardware.radio.RadioResponseInfo info);
+  oneway void sendMessagesResponse(in android.hardware.radio.RadioResponseInfo info);
+  oneway void setIndicationFilterResponse(in android.hardware.radio.RadioResponseInfo info);
+  oneway void setPowerResponse(in android.hardware.radio.RadioResponseInfo info);
+  oneway void startSendingSatellitePointingInfoResponse(in android.hardware.radio.RadioResponseInfo info);
+  oneway void stopSendingSatellitePointingInfoResponse(in android.hardware.radio.RadioResponseInfo info);
+}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/AnbrBitrate.aidl b/radio/aidl/aidl_api/android.hardware.radio.satellite/current/android/hardware/radio/satellite/IndicationFilter.aidl
similarity index 90%
copy from radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/AnbrBitrate.aidl
copy to radio/aidl/aidl_api/android.hardware.radio.satellite/current/android/hardware/radio/satellite/IndicationFilter.aidl
index 711ac19..5aa5739 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/AnbrBitrate.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.satellite/current/android/hardware/radio/satellite/IndicationFilter.aidl
@@ -31,10 +31,9 @@
 // with such a backward incompatible change, it has a high risk of breaking
 // later when a module using the interface is updated, e.g., Mainline modules.
 
-package android.hardware.radio.ims.media;
-@VintfStability
-parcelable AnbrBitrate {
-  int uplinkBps;
-  int downlinkBps;
-  const int INVALID_ANBR_BITRATE = -1;
+package android.hardware.radio.satellite;
+@Backing(type="int") @JavaDerive(toString=true) @VintfStability
+enum IndicationFilter {
+  NONE = 0,
+  SATELLITE_MODE = 1,
 }
diff --git a/audio/aidl/aidl_api/android.hardware.audio.core/current/android/hardware/audio/core/AudioMode.aidl b/radio/aidl/aidl_api/android.hardware.radio.satellite/current/android/hardware/radio/satellite/NTRadioTechnology.aidl
similarity index 88%
copy from audio/aidl/aidl_api/android.hardware.audio.core/current/android/hardware/audio/core/AudioMode.aidl
copy to radio/aidl/aidl_api/android.hardware.radio.satellite/current/android/hardware/radio/satellite/NTRadioTechnology.aidl
index 336f9b5..29de55f 100644
--- a/audio/aidl/aidl_api/android.hardware.audio.core/current/android/hardware/audio/core/AudioMode.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.satellite/current/android/hardware/radio/satellite/NTRadioTechnology.aidl
@@ -31,12 +31,11 @@
 // with such a backward incompatible change, it has a high risk of breaking
 // later when a module using the interface is updated, e.g., Mainline modules.
 
-package android.hardware.audio.core;
-@Backing(type="int") @VintfStability
-enum AudioMode {
-  NORMAL = 0,
-  RINGTONE = 1,
-  IN_CALL = 2,
-  IN_COMMUNICATION = 3,
-  CALL_SCREEN = 4,
+package android.hardware.radio.satellite;
+@Backing(type="int") @JavaDerive(toString=true) @VintfStability
+enum NTRadioTechnology {
+  NB_IOT_NTN = 0,
+  NR_NTN = 1,
+  EMTC_NTN = 2,
+  PROPRIETARY = 3,
 }
diff --git a/audio/aidl/aidl_api/android.hardware.audio.core/current/android/hardware/audio/core/AudioMode.aidl b/radio/aidl/aidl_api/android.hardware.radio.satellite/current/android/hardware/radio/satellite/PointingInfo.aidl
similarity index 85%
copy from audio/aidl/aidl_api/android.hardware.audio.core/current/android/hardware/audio/core/AudioMode.aidl
copy to radio/aidl/aidl_api/android.hardware.radio.satellite/current/android/hardware/radio/satellite/PointingInfo.aidl
index 336f9b5..dcfce34 100644
--- a/audio/aidl/aidl_api/android.hardware.audio.core/current/android/hardware/audio/core/AudioMode.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.satellite/current/android/hardware/radio/satellite/PointingInfo.aidl
@@ -31,12 +31,12 @@
 // with such a backward incompatible change, it has a high risk of breaking
 // later when a module using the interface is updated, e.g., Mainline modules.
 
-package android.hardware.audio.core;
-@Backing(type="int") @VintfStability
-enum AudioMode {
-  NORMAL = 0,
-  RINGTONE = 1,
-  IN_CALL = 2,
-  IN_COMMUNICATION = 3,
-  CALL_SCREEN = 4,
+package android.hardware.radio.satellite;
+@JavaDerive(toString=true) @VintfStability
+parcelable PointingInfo {
+  float satelliteAzimuthDegrees;
+  float satelliteElevationDegrees;
+  float antennaAzimuthDegrees;
+  float antennaPitchDegrees;
+  float antennaRollDegrees;
 }
diff --git a/audio/aidl/aidl_api/android.hardware.audio.core/current/android/hardware/audio/core/AudioMode.aidl b/radio/aidl/aidl_api/android.hardware.radio.satellite/current/android/hardware/radio/satellite/SatelliteCapabilities.aidl
similarity index 81%
copy from audio/aidl/aidl_api/android.hardware.audio.core/current/android/hardware/audio/core/AudioMode.aidl
copy to radio/aidl/aidl_api/android.hardware.radio.satellite/current/android/hardware/radio/satellite/SatelliteCapabilities.aidl
index 336f9b5..407a9d1 100644
--- a/audio/aidl/aidl_api/android.hardware.audio.core/current/android/hardware/audio/core/AudioMode.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.satellite/current/android/hardware/radio/satellite/SatelliteCapabilities.aidl
@@ -31,12 +31,12 @@
 // with such a backward incompatible change, it has a high risk of breaking
 // later when a module using the interface is updated, e.g., Mainline modules.
 
-package android.hardware.audio.core;
-@Backing(type="int") @VintfStability
-enum AudioMode {
-  NORMAL = 0,
-  RINGTONE = 1,
-  IN_CALL = 2,
-  IN_COMMUNICATION = 3,
-  CALL_SCREEN = 4,
+package android.hardware.radio.satellite;
+@JavaDerive(toString=true) @VintfStability
+parcelable SatelliteCapabilities {
+  android.hardware.radio.satellite.NTRadioTechnology[] supportedRadioTechnologies;
+  boolean isAlwaysOn;
+  boolean needsPointingToSatellite;
+  android.hardware.radio.satellite.SatelliteFeature[] supportedFeatures;
+  boolean needsSeparateSimProfile;
 }
diff --git a/audio/aidl/aidl_api/android.hardware.audio.core/current/android/hardware/audio/core/AudioMode.aidl b/radio/aidl/aidl_api/android.hardware.radio.satellite/current/android/hardware/radio/satellite/SatelliteFeature.aidl
similarity index 88%
copy from audio/aidl/aidl_api/android.hardware.audio.core/current/android/hardware/audio/core/AudioMode.aidl
copy to radio/aidl/aidl_api/android.hardware.radio.satellite/current/android/hardware/radio/satellite/SatelliteFeature.aidl
index 336f9b5..315359d 100644
--- a/audio/aidl/aidl_api/android.hardware.audio.core/current/android/hardware/audio/core/AudioMode.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.satellite/current/android/hardware/radio/satellite/SatelliteFeature.aidl
@@ -31,12 +31,11 @@
 // with such a backward incompatible change, it has a high risk of breaking
 // later when a module using the interface is updated, e.g., Mainline modules.
 
-package android.hardware.audio.core;
-@Backing(type="int") @VintfStability
-enum AudioMode {
-  NORMAL = 0,
-  RINGTONE = 1,
-  IN_CALL = 2,
-  IN_COMMUNICATION = 3,
-  CALL_SCREEN = 4,
+package android.hardware.radio.satellite;
+@Backing(type="int") @JavaDerive(toString=true) @VintfStability
+enum SatelliteFeature {
+  SOS_SMS = 0,
+  EMERGENCY_SMS = 1,
+  SMS = 2,
+  LOCATION_SHARING = 3,
 }
diff --git a/audio/aidl/aidl_api/android.hardware.audio.core/current/android/hardware/audio/core/AudioMode.aidl b/radio/aidl/aidl_api/android.hardware.radio.satellite/current/android/hardware/radio/satellite/SatelliteMode.aidl
similarity index 86%
copy from audio/aidl/aidl_api/android.hardware.audio.core/current/android/hardware/audio/core/AudioMode.aidl
copy to radio/aidl/aidl_api/android.hardware.radio.satellite/current/android/hardware/radio/satellite/SatelliteMode.aidl
index 336f9b5..1cf6a2c 100644
--- a/audio/aidl/aidl_api/android.hardware.audio.core/current/android/hardware/audio/core/AudioMode.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.satellite/current/android/hardware/radio/satellite/SatelliteMode.aidl
@@ -31,12 +31,12 @@
 // with such a backward incompatible change, it has a high risk of breaking
 // later when a module using the interface is updated, e.g., Mainline modules.
 
-package android.hardware.audio.core;
-@Backing(type="int") @VintfStability
-enum AudioMode {
-  NORMAL = 0,
-  RINGTONE = 1,
-  IN_CALL = 2,
-  IN_COMMUNICATION = 3,
-  CALL_SCREEN = 4,
+package android.hardware.radio.satellite;
+@Backing(type="int") @JavaDerive(toString=true) @VintfStability
+enum SatelliteMode {
+  POWERED_OFF = 0,
+  OUT_OF_SERVICE_NOT_SEARCHING = 1,
+  OUT_OF_SERVICE_SEARCHING = 2,
+  ACQUIRED = 3,
+  MESSAGE_TRANSFERRING = 4,
 }
diff --git a/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/CardPowerState.aidl b/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/CardPowerState.aidl
index 05bc13a..6bc3919 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/CardPowerState.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/CardPowerState.aidl
@@ -34,7 +34,7 @@
 package android.hardware.radio.sim;
 @Backing(type="int") @JavaDerive(toString=true) @VintfStability
 enum CardPowerState {
-  POWER_DOWN = 0,
-  POWER_UP = 1,
-  POWER_UP_PASS_THROUGH = 2,
+  POWER_DOWN,
+  POWER_UP,
+  POWER_UP_PASS_THROUGH,
 }
diff --git a/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/CarrierRestrictions.aidl b/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/CarrierRestrictions.aidl
index 8a61dca..3700de3 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/CarrierRestrictions.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/CarrierRestrictions.aidl
@@ -34,15 +34,14 @@
 package android.hardware.radio.sim;
 @JavaDerive(toString=true) @VintfStability
 parcelable CarrierRestrictions {
-    @Backing(type="int") @VintfStability
-    enum CarrierRestrictionStatus {
-        UNKNOWN = 0,
-        NOT_RESTRICTED = 1,
-        RESTRICTED = 2,
-    }
-    android.hardware.radio.sim.Carrier[] allowedCarriers;
-    android.hardware.radio.sim.Carrier[] excludedCarriers;
-    boolean allowedCarriersPrioritized;
-    CarrierRestrictionStatus status;
-    int carrierId;
+  android.hardware.radio.sim.Carrier[] allowedCarriers;
+  android.hardware.radio.sim.Carrier[] excludedCarriers;
+  boolean allowedCarriersPrioritized;
+  android.hardware.radio.sim.CarrierRestrictions.CarrierRestrictionStatus status;
+  @Backing(type="int") @VintfStability
+  enum CarrierRestrictionStatus {
+    UNKNOWN = 0,
+    NOT_RESTRICTED = 1,
+    RESTRICTED = 2,
+  }
 }
diff --git a/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/CdmaSubscriptionSource.aidl b/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/CdmaSubscriptionSource.aidl
index 13469f3..080aa5e 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/CdmaSubscriptionSource.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/CdmaSubscriptionSource.aidl
@@ -34,6 +34,6 @@
 package android.hardware.radio.sim;
 @Backing(type="int") @JavaDerive(toString=true) @VintfStability
 enum CdmaSubscriptionSource {
-  RUIM_SIM = 0,
-  NV = 1,
+  RUIM_SIM,
+  NV,
 }
diff --git a/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/PersoSubstate.aidl b/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/PersoSubstate.aidl
index e33769e..dc1d960 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/PersoSubstate.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/PersoSubstate.aidl
@@ -34,39 +34,39 @@
 package android.hardware.radio.sim;
 @Backing(type="int") @JavaDerive(toString=true) @VintfStability
 enum PersoSubstate {
-  UNKNOWN = 0,
-  IN_PROGRESS = 1,
-  READY = 2,
-  SIM_NETWORK = 3,
-  SIM_NETWORK_SUBSET = 4,
-  SIM_CORPORATE = 5,
-  SIM_SERVICE_PROVIDER = 6,
-  SIM_SIM = 7,
-  SIM_NETWORK_PUK = 8,
-  SIM_NETWORK_SUBSET_PUK = 9,
-  SIM_CORPORATE_PUK = 10,
-  SIM_SERVICE_PROVIDER_PUK = 11,
-  SIM_SIM_PUK = 12,
-  RUIM_NETWORK1 = 13,
-  RUIM_NETWORK2 = 14,
-  RUIM_HRPD = 15,
-  RUIM_CORPORATE = 16,
-  RUIM_SERVICE_PROVIDER = 17,
-  RUIM_RUIM = 18,
-  RUIM_NETWORK1_PUK = 19,
-  RUIM_NETWORK2_PUK = 20,
-  RUIM_HRPD_PUK = 21,
-  RUIM_CORPORATE_PUK = 22,
-  RUIM_SERVICE_PROVIDER_PUK = 23,
-  RUIM_RUIM_PUK = 24,
-  SIM_SPN = 25,
-  SIM_SPN_PUK = 26,
-  SIM_SP_EHPLMN = 27,
-  SIM_SP_EHPLMN_PUK = 28,
-  SIM_ICCID = 29,
-  SIM_ICCID_PUK = 30,
-  SIM_IMPI = 31,
-  SIM_IMPI_PUK = 32,
-  SIM_NS_SP = 33,
-  SIM_NS_SP_PUK = 34,
+  UNKNOWN,
+  IN_PROGRESS,
+  READY,
+  SIM_NETWORK,
+  SIM_NETWORK_SUBSET,
+  SIM_CORPORATE,
+  SIM_SERVICE_PROVIDER,
+  SIM_SIM,
+  SIM_NETWORK_PUK,
+  SIM_NETWORK_SUBSET_PUK,
+  SIM_CORPORATE_PUK,
+  SIM_SERVICE_PROVIDER_PUK,
+  SIM_SIM_PUK,
+  RUIM_NETWORK1,
+  RUIM_NETWORK2,
+  RUIM_HRPD,
+  RUIM_CORPORATE,
+  RUIM_SERVICE_PROVIDER,
+  RUIM_RUIM,
+  RUIM_NETWORK1_PUK,
+  RUIM_NETWORK2_PUK,
+  RUIM_HRPD_PUK,
+  RUIM_CORPORATE_PUK,
+  RUIM_SERVICE_PROVIDER_PUK,
+  RUIM_RUIM_PUK,
+  SIM_SPN,
+  SIM_SPN_PUK,
+  SIM_SP_EHPLMN,
+  SIM_SP_EHPLMN_PUK,
+  SIM_ICCID,
+  SIM_ICCID_PUK,
+  SIM_IMPI,
+  SIM_IMPI_PUK,
+  SIM_NS_SP,
+  SIM_NS_SP_PUK,
 }
diff --git a/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/PinState.aidl b/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/PinState.aidl
index 5cdc6d1..663ea73 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/PinState.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/PinState.aidl
@@ -34,10 +34,10 @@
 package android.hardware.radio.sim;
 @Backing(type="int") @JavaDerive(toString=true) @VintfStability
 enum PinState {
-  UNKNOWN = 0,
-  ENABLED_NOT_VERIFIED = 1,
-  ENABLED_VERIFIED = 2,
-  DISABLED = 3,
-  ENABLED_BLOCKED = 4,
-  ENABLED_PERM_BLOCKED = 5,
+  UNKNOWN,
+  ENABLED_NOT_VERIFIED,
+  ENABLED_VERIFIED,
+  DISABLED,
+  ENABLED_BLOCKED,
+  ENABLED_PERM_BLOCKED,
 }
diff --git a/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/SimLockMultiSimPolicy.aidl b/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/SimLockMultiSimPolicy.aidl
index 4ded3e9..d59fcab 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/SimLockMultiSimPolicy.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/SimLockMultiSimPolicy.aidl
@@ -34,6 +34,6 @@
 package android.hardware.radio.sim;
 @Backing(type="int") @JavaDerive(toString=true) @VintfStability
 enum SimLockMultiSimPolicy {
-  NO_MULTISIM_POLICY = 0,
-  ONE_VALID_SIM_MUST_BE_PRESENT = 1,
+  NO_MULTISIM_POLICY,
+  ONE_VALID_SIM_MUST_BE_PRESENT,
 }
diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/AudioQuality.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/AudioQuality.aidl
index 15669ac..1ab2902 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/AudioQuality.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/AudioQuality.aidl
@@ -34,14 +34,14 @@
 package android.hardware.radio.voice;
 @Backing(type="int") @JavaDerive(toString=true) @VintfStability
 enum AudioQuality {
-  UNSPECIFIED = 0,
-  AMR = 1,
-  AMR_WB = 2,
-  GSM_EFR = 3,
-  GSM_FR = 4,
-  GSM_HR = 5,
-  EVRC = 6,
-  EVRC_B = 7,
-  EVRC_WB = 8,
-  EVRC_NW = 9,
+  UNSPECIFIED,
+  AMR,
+  AMR_WB,
+  GSM_EFR,
+  GSM_FR,
+  GSM_HR,
+  EVRC,
+  EVRC_B,
+  EVRC_WB,
+  EVRC_NW,
 }
diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/CdmaOtaProvisionStatus.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/CdmaOtaProvisionStatus.aidl
index 7877fda..fad3841 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/CdmaOtaProvisionStatus.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/CdmaOtaProvisionStatus.aidl
@@ -34,16 +34,16 @@
 package android.hardware.radio.voice;
 @Backing(type="int") @JavaDerive(toString=true) @VintfStability
 enum CdmaOtaProvisionStatus {
-  SPL_UNLOCKED = 0,
-  SPC_RETRIES_EXCEEDED = 1,
-  A_KEY_EXCHANGED = 2,
-  SSD_UPDATED = 3,
-  NAM_DOWNLOADED = 4,
-  MDN_DOWNLOADED = 5,
-  IMSI_DOWNLOADED = 6,
-  PRL_DOWNLOADED = 7,
-  COMMITTED = 8,
-  OTAPA_STARTED = 9,
-  OTAPA_STOPPED = 10,
-  OTAPA_ABORTED = 11,
+  SPL_UNLOCKED,
+  SPC_RETRIES_EXCEEDED,
+  A_KEY_EXCHANGED,
+  SSD_UPDATED,
+  NAM_DOWNLOADED,
+  MDN_DOWNLOADED,
+  IMSI_DOWNLOADED,
+  PRL_DOWNLOADED,
+  COMMITTED,
+  OTAPA_STARTED,
+  OTAPA_STOPPED,
+  OTAPA_ABORTED,
 }
diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/ClipStatus.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/ClipStatus.aidl
index 3fbb0d8..a34149a 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/ClipStatus.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/ClipStatus.aidl
@@ -34,7 +34,7 @@
 package android.hardware.radio.voice;
 @Backing(type="int") @JavaDerive(toString=true) @VintfStability
 enum ClipStatus {
-  CLIP_PROVISIONED = 0,
-  CLIP_UNPROVISIONED = 1,
-  UNKNOWN = 2,
+  CLIP_PROVISIONED,
+  CLIP_UNPROVISIONED,
+  UNKNOWN,
 }
diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/EmergencyCallRouting.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/EmergencyCallRouting.aidl
index 07f011d..4e1dfc0 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/EmergencyCallRouting.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/EmergencyCallRouting.aidl
@@ -34,7 +34,7 @@
 package android.hardware.radio.voice;
 @Backing(type="int") @JavaDerive(toString=true) @VintfStability
 enum EmergencyCallRouting {
-  UNKNOWN = 0,
-  EMERGENCY = 1,
-  NORMAL = 2,
+  UNKNOWN,
+  EMERGENCY,
+  NORMAL,
 }
diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/EmergencyNumber.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/EmergencyNumber.aidl
index 98df8cd..ac3867e 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/EmergencyNumber.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/EmergencyNumber.aidl
@@ -40,8 +40,8 @@
   int categories;
   String[] urns;
   int sources;
-  const int SOURCE_NETWORK_SIGNALING = 1;
-  const int SOURCE_SIM = 2;
-  const int SOURCE_MODEM_CONFIG = 4;
-  const int SOURCE_DEFAULT = 8;
+  const int SOURCE_NETWORK_SIGNALING = (1 << 0);
+  const int SOURCE_SIM = (1 << 1);
+  const int SOURCE_MODEM_CONFIG = (1 << 2);
+  const int SOURCE_DEFAULT = (1 << 3);
 }
diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/EmergencyServiceCategory.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/EmergencyServiceCategory.aidl
index 042dd61..0a70d2d 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/EmergencyServiceCategory.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/EmergencyServiceCategory.aidl
@@ -35,11 +35,11 @@
 @Backing(type="int") @JavaDerive(toString=true) @VintfStability
 enum EmergencyServiceCategory {
   UNSPECIFIED = 0,
-  POLICE = 1,
-  AMBULANCE = 2,
-  FIRE_BRIGADE = 4,
-  MARINE_GUARD = 8,
-  MOUNTAIN_RESCUE = 16,
-  MIEC = 32,
-  AIEC = 64,
+  POLICE = (1 << 0),
+  AMBULANCE = (1 << 1),
+  FIRE_BRIGADE = (1 << 2),
+  MARINE_GUARD = (1 << 3),
+  MOUNTAIN_RESCUE = (1 << 4),
+  MIEC = (1 << 5),
+  AIEC = (1 << 6),
 }
diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/LastCallFailCause.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/LastCallFailCause.aidl
index 1740134..7d54623 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/LastCallFailCause.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/LastCallFailCause.aidl
@@ -114,20 +114,20 @@
   CDMA_PREEMPTED = 1007,
   CDMA_NOT_EMERGENCY = 1008,
   CDMA_ACCESS_BLOCKED = 1009,
-  OEM_CAUSE_1 = 61441,
-  OEM_CAUSE_2 = 61442,
-  OEM_CAUSE_3 = 61443,
-  OEM_CAUSE_4 = 61444,
-  OEM_CAUSE_5 = 61445,
-  OEM_CAUSE_6 = 61446,
-  OEM_CAUSE_7 = 61447,
-  OEM_CAUSE_8 = 61448,
-  OEM_CAUSE_9 = 61449,
-  OEM_CAUSE_10 = 61450,
-  OEM_CAUSE_11 = 61451,
-  OEM_CAUSE_12 = 61452,
-  OEM_CAUSE_13 = 61453,
-  OEM_CAUSE_14 = 61454,
-  OEM_CAUSE_15 = 61455,
-  ERROR_UNSPECIFIED = 65535,
+  OEM_CAUSE_1 = 0xf001,
+  OEM_CAUSE_2 = 0xf002,
+  OEM_CAUSE_3 = 0xf003,
+  OEM_CAUSE_4 = 0xf004,
+  OEM_CAUSE_5 = 0xf005,
+  OEM_CAUSE_6 = 0xf006,
+  OEM_CAUSE_7 = 0xf007,
+  OEM_CAUSE_8 = 0xf008,
+  OEM_CAUSE_9 = 0xf009,
+  OEM_CAUSE_10 = 0xf00a,
+  OEM_CAUSE_11 = 0xf00b,
+  OEM_CAUSE_12 = 0xf00c,
+  OEM_CAUSE_13 = 0xf00d,
+  OEM_CAUSE_14 = 0xf00e,
+  OEM_CAUSE_15 = 0xf00f,
+  ERROR_UNSPECIFIED = 0xffff,
 }
diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/SrvccState.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/SrvccState.aidl
index 864374b..4b5c216 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/SrvccState.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/SrvccState.aidl
@@ -34,8 +34,8 @@
 package android.hardware.radio.voice;
 @Backing(type="int") @JavaDerive(toString=true) @VintfStability
 enum SrvccState {
-  HANDOVER_STARTED = 0,
-  HANDOVER_COMPLETED = 1,
-  HANDOVER_FAILED = 2,
-  HANDOVER_CANCELED = 3,
+  HANDOVER_STARTED,
+  HANDOVER_COMPLETED,
+  HANDOVER_FAILED,
+  HANDOVER_CANCELED,
 }
diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/StkCcUnsolSsResult.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/StkCcUnsolSsResult.aidl
index 50bb1fd..75f3de5 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/StkCcUnsolSsResult.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/StkCcUnsolSsResult.aidl
@@ -72,13 +72,13 @@
   const int TELESERVICE_TYPE_SMS_SERVICES = 4;
   const int TELESERVICE_TYPE_ALL_TELESERVICES_EXCEPT_SMS = 5;
   const int SUPP_SERVICE_CLASS_NONE = 0;
-  const int SUPP_SERVICE_CLASS_VOICE = 1;
-  const int SUPP_SERVICE_CLASS_DATA = 2;
-  const int SUPP_SERVICE_CLASS_FAX = 4;
-  const int SUPP_SERVICE_CLASS_SMS = 8;
-  const int SUPP_SERVICE_CLASS_DATA_SYNC = 16;
-  const int SUPP_SERVICE_CLASS_DATA_ASYNC = 32;
-  const int SUPP_SERVICE_CLASS_PACKET = 64;
-  const int SUPP_SERVICE_CLASS_PAD = 128;
-  const int SUPP_SERVICE_CLASS_MAX = 128;
+  const int SUPP_SERVICE_CLASS_VOICE = (1 << 0);
+  const int SUPP_SERVICE_CLASS_DATA = (1 << 1);
+  const int SUPP_SERVICE_CLASS_FAX = (1 << 2);
+  const int SUPP_SERVICE_CLASS_SMS = (1 << 3);
+  const int SUPP_SERVICE_CLASS_DATA_SYNC = (1 << 4);
+  const int SUPP_SERVICE_CLASS_DATA_ASYNC = (1 << 5);
+  const int SUPP_SERVICE_CLASS_PACKET = (1 << 6);
+  const int SUPP_SERVICE_CLASS_PAD = (1 << 7);
+  const int SUPP_SERVICE_CLASS_MAX = (1 << 7);
 }
diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/TtyMode.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/TtyMode.aidl
index 77417e8..e432e65 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/TtyMode.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/TtyMode.aidl
@@ -34,8 +34,8 @@
 package android.hardware.radio.voice;
 @Backing(type="int") @JavaDerive(toString=true) @VintfStability
 enum TtyMode {
-  OFF = 0,
-  FULL = 1,
-  HCO = 2,
-  VCO = 3,
+  OFF,
+  FULL,
+  HCO,
+  VCO,
 }
diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/UssdModeType.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/UssdModeType.aidl
index ad243d2..424e73f 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/UssdModeType.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/UssdModeType.aidl
@@ -34,10 +34,10 @@
 package android.hardware.radio.voice;
 @Backing(type="int") @JavaDerive(toString=true) @VintfStability
 enum UssdModeType {
-  NOTIFY = 0,
-  REQUEST = 1,
-  NW_RELEASE = 2,
-  LOCAL_CLIENT = 3,
-  NOT_SUPPORTED = 4,
-  NW_TIMEOUT = 5,
+  NOTIFY,
+  REQUEST,
+  NW_RELEASE,
+  LOCAL_CLIENT,
+  NOT_SUPPORTED,
+  NW_TIMEOUT,
 }
diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/AccessNetwork.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/AccessNetwork.aidl
index 8ce689f..9641651 100644
--- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/AccessNetwork.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/AccessNetwork.aidl
@@ -34,11 +34,11 @@
 package android.hardware.radio;
 @Backing(type="int") @JavaDerive(toString=true) @VintfStability
 enum AccessNetwork {
-  UNKNOWN = 0,
-  GERAN = 1,
-  UTRAN = 2,
-  EUTRAN = 3,
-  CDMA2000 = 4,
-  IWLAN = 5,
-  NGRAN = 6,
+  UNKNOWN,
+  GERAN,
+  UTRAN,
+  EUTRAN,
+  CDMA2000,
+  IWLAN,
+  NGRAN,
 }
diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioAccessFamily.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioAccessFamily.aidl
index afc4f4e..aa55cd7 100644
--- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioAccessFamily.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioAccessFamily.aidl
@@ -34,28 +34,28 @@
 package android.hardware.radio;
 @Backing(type="int") @JavaDerive(toString=true) @VintfStability
 enum RadioAccessFamily {
-  UNKNOWN = 1,
-  GPRS = 2,
-  EDGE = 4,
-  UMTS = 8,
-  IS95A = 16,
-  IS95B = 32,
-  ONE_X_RTT = 64,
-  EVDO_0 = 128,
-  EVDO_A = 256,
-  HSDPA = 512,
-  HSUPA = 1024,
-  HSPA = 2048,
-  EVDO_B = 4096,
-  EHRPD = 8192,
-  LTE = 16384,
-  HSPAP = 32768,
-  GSM = 65536,
-  TD_SCDMA = 131072,
-  IWLAN = 262144,
+  UNKNOWN = (1 << android.hardware.radio.RadioTechnology.UNKNOWN),
+  GPRS = (1 << android.hardware.radio.RadioTechnology.GPRS),
+  EDGE = (1 << android.hardware.radio.RadioTechnology.EDGE),
+  UMTS = (1 << android.hardware.radio.RadioTechnology.UMTS),
+  IS95A = (1 << android.hardware.radio.RadioTechnology.IS95A),
+  IS95B = (1 << android.hardware.radio.RadioTechnology.IS95B),
+  ONE_X_RTT = (1 << android.hardware.radio.RadioTechnology.ONE_X_RTT),
+  EVDO_0 = (1 << android.hardware.radio.RadioTechnology.EVDO_0),
+  EVDO_A = (1 << android.hardware.radio.RadioTechnology.EVDO_A),
+  HSDPA = (1 << android.hardware.radio.RadioTechnology.HSDPA),
+  HSUPA = (1 << android.hardware.radio.RadioTechnology.HSUPA),
+  HSPA = (1 << android.hardware.radio.RadioTechnology.HSPA),
+  EVDO_B = (1 << android.hardware.radio.RadioTechnology.EVDO_B),
+  EHRPD = (1 << android.hardware.radio.RadioTechnology.EHRPD),
+  LTE = (1 << android.hardware.radio.RadioTechnology.LTE),
+  HSPAP = (1 << android.hardware.radio.RadioTechnology.HSPAP),
+  GSM = (1 << android.hardware.radio.RadioTechnology.GSM),
+  TD_SCDMA = (1 << android.hardware.radio.RadioTechnology.TD_SCDMA),
+  IWLAN = (1 << android.hardware.radio.RadioTechnology.IWLAN),
   /**
    * @deprecated use LTE instead.
    */
-  LTE_CA = 524288,
-  NR = 1048576,
+  LTE_CA = (1 << android.hardware.radio.RadioTechnology.LTE_CA),
+  NR = (1 << android.hardware.radio.RadioTechnology.NR),
 }
diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioConst.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioConst.aidl
index b91bf03..448c0bb 100644
--- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioConst.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioConst.aidl
@@ -37,5 +37,5 @@
   const int MAX_RILDS = 3;
   const int MAX_UUID_LENGTH = 64;
   const int CARD_MAX_APPS = 8;
-  const int P2_CONSTANT_NO_P2 = -1;
+  const int P2_CONSTANT_NO_P2 = (-1);
 }
diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioError.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioError.aidl
index 98606e5..b9db56c 100644
--- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioError.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioError.aidl
@@ -123,4 +123,15 @@
   BLOCKED_DUE_TO_CALL = 69,
   RF_HARDWARE_ISSUE = 70,
   NO_RF_CALIBRATION_INFO = 71,
+  ENCODING_NOT_SUPPORTED = 72,
+  FEATURE_NOT_SUPPORTED = 73,
+  INVALID_CONTACT = 74,
+  MODEM_INCOMPATIBLE = 75,
+  NETWORK_TIMEOUT = 76,
+  NO_SATELLITE_SIGNAL = 77,
+  NOT_SUFFICIENT_ACCOUNT_BALANCE = 78,
+  RADIO_TECHNOLOGY_NOT_SUPPORTED = 79,
+  SUBSCRIBER_NOT_AUTHORIZED = 80,
+  SWITCHED_FROM_SATELLITE_TO_TERRESTRIAL = 81,
+  UNIDENTIFIED_SUBSCRIBER = 82,
 }
diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioIndicationType.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioIndicationType.aidl
index 54ea3a4..58b35a5 100644
--- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioIndicationType.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioIndicationType.aidl
@@ -34,6 +34,6 @@
 package android.hardware.radio;
 @Backing(type="int") @JavaDerive(toString=true) @VintfStability
 enum RadioIndicationType {
-  UNSOLICITED = 0,
-  UNSOLICITED_ACK_EXP = 1,
+  UNSOLICITED,
+  UNSOLICITED_ACK_EXP,
 }
diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioResponseType.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioResponseType.aidl
index 5cd99c4..1ee62bd 100644
--- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioResponseType.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioResponseType.aidl
@@ -34,7 +34,7 @@
 package android.hardware.radio;
 @Backing(type="int") @JavaDerive(toString=true) @VintfStability
 enum RadioResponseType {
-  SOLICITED = 0,
-  SOLICITED_ACK = 1,
-  SOLICITED_ACK_EXP = 2,
+  SOLICITED,
+  SOLICITED_ACK,
+  SOLICITED_ACK_EXP,
 }
diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioTechnology.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioTechnology.aidl
index 7060469..b6af5aa 100644
--- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioTechnology.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioTechnology.aidl
@@ -34,28 +34,28 @@
 package android.hardware.radio;
 @Backing(type="int") @JavaDerive(toString=true) @VintfStability
 enum RadioTechnology {
-  UNKNOWN = 0,
-  GPRS = 1,
-  EDGE = 2,
-  UMTS = 3,
-  IS95A = 4,
-  IS95B = 5,
-  ONE_X_RTT = 6,
-  EVDO_0 = 7,
-  EVDO_A = 8,
-  HSDPA = 9,
-  HSUPA = 10,
-  HSPA = 11,
-  EVDO_B = 12,
-  EHRPD = 13,
-  LTE = 14,
-  HSPAP = 15,
-  GSM = 16,
-  TD_SCDMA = 17,
-  IWLAN = 18,
+  UNKNOWN,
+  GPRS,
+  EDGE,
+  UMTS,
+  IS95A,
+  IS95B,
+  ONE_X_RTT,
+  EVDO_0,
+  EVDO_A,
+  HSDPA,
+  HSUPA,
+  HSPA,
+  EVDO_B,
+  EHRPD,
+  LTE,
+  HSPAP,
+  GSM,
+  TD_SCDMA,
+  IWLAN,
   /**
    * @deprecated use LTE instead and indicate carrier aggregation through multiple physical channel configurations in IRadioNetwork::currentPhysicalChannelConfigs.
    */
-  LTE_CA = 19,
-  NR = 20,
+  LTE_CA,
+  NR,
 }
diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioTechnologyFamily.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioTechnologyFamily.aidl
index e6fdce2..2af7e53 100644
--- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioTechnologyFamily.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioTechnologyFamily.aidl
@@ -34,6 +34,6 @@
 package android.hardware.radio;
 @Backing(type="int") @JavaDerive(toString=true) @VintfStability
 enum RadioTechnologyFamily {
-  THREE_GPP = 0,
-  THREE_GPP2 = 1,
+  THREE_GPP,
+  THREE_GPP2,
 }
diff --git a/radio/aidl/android/hardware/radio/RadioError.aidl b/radio/aidl/android/hardware/radio/RadioError.aidl
index 61d5a77..4d44559 100644
--- a/radio/aidl/android/hardware/radio/RadioError.aidl
+++ b/radio/aidl/android/hardware/radio/RadioError.aidl
@@ -180,7 +180,8 @@
      */
     NO_SMS_TO_ACK = 48,
     /**
-     * Received error from network
+     * Received error from network. This generic error code should be used only when the error
+     * cannot be mapped to other specific network error codes.
      */
     NETWORK_ERR = 49,
     /**
@@ -300,4 +301,51 @@
      * Unlike RF_HARDWARE_ISSUE, this is a SW problem and no HW repair is needed.
      */
     NO_RF_CALIBRATION_INFO = 71,
+    /**
+     * The encoding scheme is not supported by either the network or the MS.
+     */
+    ENCODING_NOT_SUPPORTED = 72,
+    /**
+     * The requesting feature is not supported by the service provider/operator.
+     */
+    FEATURE_NOT_SUPPORTED = 73,
+    /**
+     * The contact to be added is either not existing or not valid.
+     */
+    INVALID_CONTACT = 74,
+    /**
+     * The modem of the MS is not compatible with the service provider/operator. This generic error
+     * should be used only when there are some mimatches in the capabilities between the MS and
+     * the operator and the error cannot be mapped properly to other specific network errors.
+     */
+    MODEM_INCOMPATIBLE = 75,
+    /**
+     * Modem timeout to receive ACK or response from network after sending a request to the network.
+     */
+    NETWORK_TIMEOUT = 76,
+    /**
+     * Modem fails to communicate with the satellite network since there is no satellite signal.
+     */
+    NO_SATELLITE_SIGNAL = 77,
+    /**
+     * The request cannot be performed since the subscriber's account balance is not sufficient.
+     */
+    NOT_SUFFICIENT_ACCOUNT_BALANCE = 78,
+    /**
+     * The radio technology is not supported by the service provider/operator.
+     */
+    RADIO_TECHNOLOGY_NOT_SUPPORTED = 79,
+    /**
+     * The subscription is not authorized to register with the service provider/operator.
+     */
+    SUBSCRIBER_NOT_AUTHORIZED = 80,
+    /**
+     * While processing a request from the Framework, the satellite modem detects terrestrial
+     * signal, aborts the request, and switches to the terrestrial network.
+     */
+    SWITCHED_FROM_SATELLITE_TO_TERRESTRIAL = 81,
+    /**
+     * The subscriber is not registered in the service provider.
+     */
+    UNIDENTIFIED_SUBSCRIBER = 82
 }
diff --git a/radio/aidl/android/hardware/radio/data/DataCallFailCause.aidl b/radio/aidl/android/hardware/radio/data/DataCallFailCause.aidl
index 29ece76..071ce55 100644
--- a/radio/aidl/android/hardware/radio/data/DataCallFailCause.aidl
+++ b/radio/aidl/android/hardware/radio/data/DataCallFailCause.aidl
@@ -911,10 +911,14 @@
      */
     PDP_MODIFY_COLLISION = 0x875,
     /**
-     * Maximum size of the L2 message was exceeded.
+     * @deprecated use MAXIMUM_SIZE_OF_L2_MESSAGE_EXCEEDED instead.
      */
     MAXINUM_SIZE_OF_L2_MESSAGE_EXCEEDED = 0x876,
     /**
+     * Maximum size of the L2 message was exceeded.
+     */
+    MAXIMUM_SIZE_OF_L2_MESSAGE_EXCEEDED = 0x876,
+    /**
      * Non-access stratum (NAS) request was rejected by the network.
      */
     NAS_REQUEST_REJECTED_BY_NETWORK = 0x877,
diff --git a/radio/aidl/android/hardware/radio/data/NrQos.aidl b/radio/aidl/android/hardware/radio/data/NrQos.aidl
index 28b4a7f..4078fdc 100644
--- a/radio/aidl/android/hardware/radio/data/NrQos.aidl
+++ b/radio/aidl/android/hardware/radio/data/NrQos.aidl
@@ -27,6 +27,8 @@
     const byte FLOW_ID_RANGE_MIN = 1;
     const byte FLOW_ID_RANGE_MAX = 63;
 
+    const int AVERAGING_WINDOW_UNKNOWN = -1;
+
     /**
      * 5G QOS Identifier (5QI), see 3GPP TS 24.501 and 23.501. The allowed values are standard
      * values (1-9, 65-68, 69-70, 75, 79-80, 82-85) defined in the spec and operator specific values
@@ -36,13 +38,16 @@
     QosBandwidth downlink;
     QosBandwidth uplink;
     /**
-     * @deprecated use qosFlowIdentifier.
-     */
-    byte qfi;
-    char averagingWindowMs;
-    /**
      * QOS flow identifier of the QOS flow description in the range
      * (FLOW_ID_RANGE_MIN, FLOW_ID_RANGE_MAX).
-     **/
-    int qosFlowIdentifier;
+     */
+    byte qfi;
+    /**
+     * @deprecated use averagingWindowMillis;
+     */
+    char averagingWindowMs;
+    /**
+     * The duration over which flow rates are calculated.
+     */
+    int averagingWindowMillis = AVERAGING_WINDOW_UNKNOWN;
 }
diff --git a/radio/aidl/android/hardware/radio/ims/IRadioImsResponse.aidl b/radio/aidl/android/hardware/radio/ims/IRadioImsResponse.aidl
index 241c342..ff516cc 100644
--- a/radio/aidl/android/hardware/radio/ims/IRadioImsResponse.aidl
+++ b/radio/aidl/android/hardware/radio/ims/IRadioImsResponse.aidl
@@ -58,8 +58,9 @@
     void updateImsRegistrationInfoResponse(in RadioResponseInfo info);
 
     /**
-     * @param info Response info struct containing response type, serial no. and error
-     * @param failureInfo Information about failure in detail
+     * @param info Response info struct containing response type, serial no. and error.
+     * @param failureInfo Information about failure in detail. If there is no error,
+     *        it should be {@code null}.
      *
      * Valid errors returned:
      *   RadioError:NONE
diff --git a/radio/aidl/android/hardware/radio/ims/media/AnbrBitrate.aidl b/radio/aidl/android/hardware/radio/ims/media/AnbrMode.aidl
similarity index 63%
copy from radio/aidl/android/hardware/radio/ims/media/AnbrBitrate.aidl
copy to radio/aidl/android/hardware/radio/ims/media/AnbrMode.aidl
index 61239d0..f758cd4 100644
--- a/radio/aidl/android/hardware/radio/ims/media/AnbrBitrate.aidl
+++ b/radio/aidl/android/hardware/radio/ims/media/AnbrMode.aidl
@@ -16,13 +16,19 @@
 
 package android.hardware.radio.ims.media;
 
-@VintfStability
-parcelable AnbrBitrate {
-    /** default value to represent NOT_SET */
-    const int INVALID_ANBR_BITRATE = -1;
+import android.hardware.radio.ims.media.CodecMode;
 
-    /** Received bitrate in seconds for Uplink from NW or peer UE for ANBR */
-    int uplinkBps;
-    /** Received bitrate in secondsfor Downlink from NW or peer UE for ANBR */
-    int downlinkBps;
+@VintfStability
+@JavaDerive(toString=true)
+parcelable AnbrMode {
+    /**
+     * Codec mode converted from bitrate received for uplink
+     * from network or peer UE for ANBR
+     */
+    CodecMode anbrUplinkMode;
+    /**
+     * Codec mode converted from bitrate received for downlink
+     * from network or peer UE for ANBR
+     */
+    CodecMode anbrDownlinkMode;
 }
diff --git a/radio/aidl/android/hardware/radio/ims/media/AnbrBitrate.aidl b/radio/aidl/android/hardware/radio/ims/media/CodecMode.aidl
similarity index 63%
copy from radio/aidl/android/hardware/radio/ims/media/AnbrBitrate.aidl
copy to radio/aidl/android/hardware/radio/ims/media/CodecMode.aidl
index 61239d0..aa1b3a4 100644
--- a/radio/aidl/android/hardware/radio/ims/media/AnbrBitrate.aidl
+++ b/radio/aidl/android/hardware/radio/ims/media/CodecMode.aidl
@@ -16,13 +16,16 @@
 
 package android.hardware.radio.ims.media;
 
-@VintfStability
-parcelable AnbrBitrate {
-    /** default value to represent NOT_SET */
-    const int INVALID_ANBR_BITRATE = -1;
+import android.hardware.radio.ims.media.AmrMode;
+import android.hardware.radio.ims.media.EvsMode;
 
-    /** Received bitrate in seconds for Uplink from NW or peer UE for ANBR */
-    int uplinkBps;
-    /** Received bitrate in secondsfor Downlink from NW or peer UE for ANBR */
-    int downlinkBps;
+@VintfStability
+@JavaDerive(toString=true)
+union CodecMode {
+    /** Default value */
+    boolean noinit;
+    /** AMR codec mode to represent the bit rate. See 3ggp Specs 26.976 & 26.071 */
+    AmrMode amr;
+    /** EVS codec mode to represent the bit rate. See 3ggp Spec 26.952 Table 5.1 */
+    EvsMode evs;
 }
diff --git a/radio/aidl/android/hardware/radio/ims/media/IImsMediaSession.aidl b/radio/aidl/android/hardware/radio/ims/media/IImsMediaSession.aidl
index a8d2161..ec2fa2b 100644
--- a/radio/aidl/android/hardware/radio/ims/media/IImsMediaSession.aidl
+++ b/radio/aidl/android/hardware/radio/ims/media/IImsMediaSession.aidl
@@ -17,7 +17,6 @@
 package android.hardware.radio.ims.media;
 
 import android.hardware.radio.ims.media.IImsMediaSessionListener;
-import android.hardware.radio.ims.media.MediaProtocolType;
 import android.hardware.radio.ims.media.MediaQualityThreshold;
 import android.hardware.radio.ims.media.RtpConfig;
 import android.hardware.radio.ims.media.RtpError;
diff --git a/radio/aidl/android/hardware/radio/ims/media/IImsMediaSessionListener.aidl b/radio/aidl/android/hardware/radio/ims/media/IImsMediaSessionListener.aidl
index d40da64..8341da2 100644
--- a/radio/aidl/android/hardware/radio/ims/media/IImsMediaSessionListener.aidl
+++ b/radio/aidl/android/hardware/radio/ims/media/IImsMediaSessionListener.aidl
@@ -17,7 +17,7 @@
 package android.hardware.radio.ims.media;
 
 import android.hardware.radio.ims.media.CallQuality;
-import android.hardware.radio.ims.media.MediaProtocolType;
+import android.hardware.radio.ims.media.MediaQualityStatus;
 import android.hardware.radio.ims.media.RtpConfig;
 import android.hardware.radio.ims.media.RtpError;
 import android.hardware.radio.ims.media.RtpHeaderExtension;
@@ -59,28 +59,12 @@
     void onHeaderExtensionReceived(in List<RtpHeaderExtension> extensions);
 
     /**
-     * Notifies media inactivity observed as per thresholds set by
-     * setMediaQualityThreshold() API
+     * Notifies when the measured media quality crosses at least one of
+     * {@link MediaQualityThreshold} set by {@link IImsMediaSession#setMediaQualityThreshold()}.
      *
-     * @param packetType either RTP or RTCP
+     * @param quality The object of MediaQualityStatus with the rtp and the rtcp statistics.
      */
-    void notifyMediaInactivity(MediaProtocolType packetType);
-
-    /**
-     * Notifies RTP packet loss observed as per thresholds set by
-     * setMediaQualityThreshold() API
-     *
-     * @param packetLossPercentage percentage of packet loss calculated over the duration
-     */
-    void notifyPacketLoss(int packetLossPercentage);
-
-    /**
-     * Notifies RTP jitter observed as per thresholds set by
-     * IImsMediaSession#setMediaQualityThreshold() API
-     *
-     * @param jitter jitter of the RTP packets in milliseconds calculated over the duration
-     */
-    void notifyJitter(int jitter);
+    void notifyMediaQualityStatus(in MediaQualityStatus quality);
 
     /**
      * The modem RTP stack fires this API to query whether the desired bitrate mentioned
@@ -95,8 +79,9 @@
      * Notifies the received DTMF digit from the other party
      *
      * @param dtmfDigit single char having one of 12 values: 0-9, *, #
+     * @param durationMs The duration to play the tone in milliseconds unit
      */
-    void onDtmfReceived(char dtmfDigit);
+    void onDtmfReceived(char dtmfDigit, int durationMs);
 
     /**
      * Notifies when a change to call quality has occurred
diff --git a/radio/aidl/android/hardware/radio/ims/media/MediaQualityStatus.aidl b/radio/aidl/android/hardware/radio/ims/media/MediaQualityStatus.aidl
new file mode 100644
index 0000000..b99e501
--- /dev/null
+++ b/radio/aidl/android/hardware/radio/ims/media/MediaQualityStatus.aidl
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.radio.ims.media;
+
+@VintfStability
+parcelable MediaQualityStatus {
+    /**
+     * Rtp inactivity observed as per threshold set by
+     * {@link IImsMediaSession#setMediaQualityThreshold()}
+     */
+    int rtpInactivityTimeMillis;
+    /**
+     * Rtcp inactivity observed as per threshold set by
+     * {@link IImsMediaSession#setMediaQualityThreshold()}
+     */
+    int rtcpInactivityTimeMillis;
+    /**
+     * Rtp packet loss rate observed as per threshold set by
+     * {@link IImsMediaSession#setMediaQualityThreshold()}
+     */
+    int rtpPacketLossRate;
+    /**
+     * Rtp jitter observed as per threshold set by
+     * {@link IImsMediaSession#setMediaQualityThreshold()}
+     */
+    int rtpJitterMillis;
+}
diff --git a/radio/aidl/android/hardware/radio/ims/media/MediaQualityThreshold.aidl b/radio/aidl/android/hardware/radio/ims/media/MediaQualityThreshold.aidl
index 946bd5c..bf98928 100644
--- a/radio/aidl/android/hardware/radio/ims/media/MediaQualityThreshold.aidl
+++ b/radio/aidl/android/hardware/radio/ims/media/MediaQualityThreshold.aidl
@@ -18,19 +18,36 @@
 
 @VintfStability
 parcelable MediaQualityThreshold {
-    /** Timer in milliseconds for monitoring RTP inactivity */
-    int rtpInactivityTimerMillis;
+    /** Array including threshold values in milliseconds for monitoring RTP inactivity */
+    int[] rtpInactivityTimerMillis;
     /** Timer in milliseconds for monitoring RTCP inactivity */
     int rtcpInactivityTimerMillis;
-    /** Duration in milliseconds for monitoring the RTP packet loss rate */
+    /**
+     * This value determines the size of the time window (in milliseconds)
+     * required to calculate the packet loss rate per second for the manner of
+     * smoothly monitoring changes in the packet loss rate value.
+     */
     int rtpPacketLossDurationMillis;
     /**
-     * Packet loss rate in percentage of (total number of packets lost) /
-     * (total number of packets expected) during rtpPacketLossDurationMs
+     * The threshold hysteresis time for packet loss and jitter. This has a goal to prevent
+     * frequent ping-pong notification. So whenever a notifier needs to report the cross of
+     * threshold in opposite direction, this hysteresis timer should be respected.
      */
-    int rtpPacketLossRate;
-    /** Duration in milliseconds for monitoring the jitter for RTP traffic */
-    int jitterDurationMillis;
-    /** RTP jitter threshold in milliseconds */
-    int rtpJitterMillis;
+    int rtpHysteresisTimeInMillis;
+    /**
+     * Array including threshold values of Packet loss rate in percentage of
+     * (total number of packets lost) / (total number of packets expected) calculated
+     * every one sec with the packet received in rtpPacketLossDurationMillis.
+     */
+    int[] rtpPacketLossRate;
+
+    /** Array including threshold values in milliseconds for RTP jitter */
+    int[] rtpJitterMillis;
+
+    /**
+     * A flag indicating whether the client needs to be notified the current media quality status
+     * right after the threshold is being set. True means the media stack should notify the client
+     * of the current status.
+     */
+    boolean notifyCurrentStatus;
 }
diff --git a/radio/aidl/android/hardware/radio/ims/media/RtpConfig.aidl b/radio/aidl/android/hardware/radio/ims/media/RtpConfig.aidl
index d0d849e..f6696f7 100644
--- a/radio/aidl/android/hardware/radio/ims/media/RtpConfig.aidl
+++ b/radio/aidl/android/hardware/radio/ims/media/RtpConfig.aidl
@@ -17,7 +17,7 @@
 package android.hardware.radio.ims.media;
 
 import android.hardware.radio.AccessNetwork;
-import android.hardware.radio.ims.media.AnbrBitrate;
+import android.hardware.radio.ims.media.AnbrMode;
 import android.hardware.radio.ims.media.MediaDirection;
 import android.hardware.radio.ims.media.RtcpConfig;
 import android.hardware.radio.ims.media.RtpAddress;
@@ -36,13 +36,14 @@
     /** RTCP configuration */
     RtcpConfig rtcpConfig;
     /**
-     * ANBR Bitrate parameters. This is set to valid only when its triggered,
+     * ANBR Mode parameters. This is set to valid only when its triggered,
      * otherwise it shall be set to NULL.
      *
      * This would be used in the following two cases
      * - IImsMediaSession#modifySession(RtpConfig) - When RAN wants to change the bit
-     *   rate via ANBR MAC layer signaling, ImsStack would set the values and direction
-     *   and pass it in the modifySession(). The underlying RTP stack shall adapt to
+     *   rate via ANBR MAC layer signaling, ImsStack converts the received bitrate
+     *   to the codec mode appropriately and passes the codec mode and direction
+     *   using modifySession(). The underlying RTP stack shall adapt to
      *   the changed bitrate.
      *
      * - IImsMediaSessionListener#triggerAnbrQuery(RtpConfig) - When the vendor RTP
@@ -50,5 +51,5 @@
      *   RTCP-APP or TMMBR, it triggers ANBRQ by setting the desired bitrate and the
      *   direction of the stream.
      */
-    AnbrBitrate anbrBitrateParams;
+    AnbrMode anbrModeParams;
 }
diff --git a/radio/aidl/android/hardware/radio/satellite/IRadioSatellite.aidl b/radio/aidl/android/hardware/radio/satellite/IRadioSatellite.aidl
new file mode 100644
index 0000000..87f13a6
--- /dev/null
+++ b/radio/aidl/android/hardware/radio/satellite/IRadioSatellite.aidl
@@ -0,0 +1,168 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.radio.satellite;
+
+import android.hardware.radio.satellite.IRadioSatelliteIndication;
+import android.hardware.radio.satellite.IRadioSatelliteResponse;
+import android.hardware.radio.satellite.IndicationFilter;
+import android.hardware.radio.satellite.SatelliteFeature;
+
+/**
+ * This interface is used by telephony to send commands to and query info from satellite modem.
+ * All the functions have minimum one parameter:
+ * serial: which corresponds to serial no. of request. Serial numbers must only be memorized for the
+ * duration of a method call. If clients provide colliding serials (including passing the same
+ * serial to different methods), multiple responses (one for each method call) must still be served.
+ */
+@VintfStability
+oneway interface IRadioSatellite {
+    /**
+     * Add contacts that are allowed to be used for satellite communication. This is applicable for
+     * incoming messages as well.
+     *
+     * @param serial Serial number of request.
+     * @param contacts List of allowed contacts to be added.
+     */
+    void addAllowedSatelliteContacts(in int serial, in String[] contacts);
+
+    /**
+     * Get feature capabilities supported by satellite.
+     *
+     * @param serial Serial number of request.
+     */
+    void getCapabilities(in int serial);
+
+    /**
+     * Get max number of characters per text message.
+     *
+     * @param serial Serial number of request.
+     */
+    void getMaxCharactersPerTextMessage(in int serial);
+
+    /**
+     * Get pending messages.
+     *
+     * @param serial Serial number of request.
+     */
+    void getPendingMessages(in int serial);
+
+    /**
+     * Get satellite modem state.
+     *
+     * @param serial Serial number of request.
+     */
+    void getPowerState(in int serial);
+
+    /**
+     * Get current satellite registration mode, which is defined in {@link #SatelliteMode}.
+     *
+     * @param serial Serial number of request.
+     */
+    void getSatelliteMode(in int serial);
+
+    /**
+     * Get time for next visibility of satellite.
+     *
+     * @param serial Serial number of request.
+     */
+    void getTimeForNextSatelliteVisibility(in int serial);
+
+    /**
+     * Provision the subscription with a satellite provider. This is needed to register the
+     * subscription if the provider allows dynamic registration.
+     *
+     * @param serial Serial number of request.
+     * @param imei IMEI of the SIM associated with the satellite modem.
+     * @param msisdn MSISDN of the SIM associated with the satellite modem.
+     * @param imsi IMSI of the SIM associated with the satellite modem.
+     * @param features List of features to be provisioned.
+     */
+    void provisionService(in int serial, in String imei, in String msisdn, in String imsi,
+            in SatelliteFeature[] features);
+
+    /**
+     * Remove contacts that are allowed to be used for satellite communication. This is applicable
+     * for incoming messages as well.
+     *
+     * @param serial Serial number of request.
+     * @param contacts List of allowed contacts to be removed.
+     */
+    void removeAllowedSatelliteContacts(in int serial, in String[] contacts);
+
+    /**
+     * When response type received from a radio indication or radio response is
+     * RadioIndicationType:UNSOLICITED_ACK_EXP or RadioResponseType:SOLICITED_ACK_EXP respectively,
+     * acknowledge the receipt of those messages by sending responseAcknowledgement().
+     */
+    void responseAcknowledgement();
+
+    /**
+     * Send text messages.
+     *
+     * @param serial Serial number of request.
+     * @param messages List of messages in text format to be sent.
+     * @param destination The recipient of the message.
+     * @param latitude The current latitude of the device.
+     * @param longitude The current longitude of the device. The location (i.e., latitude and
+     *        longitude) of the device will be filled for emergency messages.
+     */
+    void sendMessages(in int serial, in String[] messages, in String destination,
+            in double latitude, in double longitude);
+
+    /**
+     * Set the filter for what type of indication framework want to receive from modem.
+     *
+     * @param serial Serial number of request.
+     * @param filterBitmask The filter bitmask identifying what type of indication Telephony
+     *                      framework wants to receive from modem. This bitmask is the 'or'
+     *                      combination of the enum values defined in {@link #IndicationFilter}.
+     */
+    void setIndicationFilter(in int serial, in int filterBitmask);
+
+    /**
+     * Turn satellite modem on/off.
+     *
+     * @param serial Serial number of request.
+     * @param on True for turning on.
+     *           False for turning off.
+     */
+    void setPower(in int serial, in boolean on);
+
+    /**
+     * Set response functions for Satellite requests and indications.
+     *
+     * @param satelliteResponse Object containing response functions
+     * @param satelliteIndication Object containing radio indications
+     */
+    void setResponseFunctions(in IRadioSatelliteResponse satelliteResponse,
+            in IRadioSatelliteIndication satelliteIndication);
+
+    /**
+     * User started pointing to the satellite. Modem should continue to update the pointing input
+     * as user device/satellite moves.
+     *
+     * @param serial Serial number of request.
+     */
+    void startSendingSatellitePointingInfo(in int serial);
+
+    /**
+     * Stop sending satellite pointing info to the framework.
+     *
+     * @param serial Serial number of request.
+     */
+    void stopSendingSatellitePointingInfo(in int serial);
+}
diff --git a/radio/aidl/android/hardware/radio/satellite/IRadioSatelliteIndication.aidl b/radio/aidl/android/hardware/radio/satellite/IRadioSatelliteIndication.aidl
new file mode 100644
index 0000000..f1d9747
--- /dev/null
+++ b/radio/aidl/android/hardware/radio/satellite/IRadioSatelliteIndication.aidl
@@ -0,0 +1,90 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.radio.satellite;
+
+import android.hardware.radio.RadioIndicationType;
+import android.hardware.radio.satellite.NTRadioTechnology;
+import android.hardware.radio.satellite.PointingInfo;
+import android.hardware.radio.satellite.SatelliteFeature;
+import android.hardware.radio.satellite.SatelliteMode;
+
+/**
+ * Interface declaring unsolicited radio indications for satellite APIs.
+ */
+@VintfStability
+oneway interface IRadioSatelliteIndication {
+    /**
+     * Confirms that ongoing message transfer is complete.
+     *
+     * @param type Type of radio indication
+     * @param complete True mean the transfer is complete.
+     *                 False means the transfer is not complete.
+     */
+    void onMessagesTransferComplete(in RadioIndicationType type, in boolean complete);
+
+    /**
+     * Indicates new message received on device.
+     *
+     * @param type Type of radio indication
+     * @param messages List of new messages received.
+     */
+    void onNewMessages(in RadioIndicationType type, in String[] messages);
+
+    /**
+     * Indicates that satellite has pending messages for the device to be pulled.
+     *
+     * @param type Type of radio indication
+     * @param count Number of pending messages.
+     */
+    void onPendingMessageCount(in RadioIndicationType type, in int count);
+
+    /**
+     * Indicate that satellite provision state has changed.
+     *
+     * @param type Type of radio indication
+     * @param provisioned True means the service is provisioned.
+     *                    False means the service is not provisioned.
+     * @param features List of Feature whose provision state has changed.
+     */
+    void onProvisionStateChanged(
+            in RadioIndicationType type, boolean provisioned, in SatelliteFeature[] features);
+
+    /**
+     * Indicate that satellite mode has changed.
+     *
+     * @param type Type of radio indication
+     * @param mode The current mode of the satellite modem.
+     */
+    void onSatelliteModeChanged(in RadioIndicationType type, in SatelliteMode mode);
+
+    /**
+     * Indicate that satellite Pointing input has changed.
+     *
+     * @param type Type of radio indication
+     * @param pointingInfo The current pointing info.
+     */
+    void onSatellitePointingInfoChanged(in RadioIndicationType type, in PointingInfo pointingInfo);
+
+    /**
+     * Indicate that satellite radio technology has changed.
+     *
+     * @param type Type of radio indication
+     * @param technology The current technology of the satellite modem.
+     */
+    void onSatelliteRadioTechnologyChanged(
+            in RadioIndicationType type, in NTRadioTechnology technology);
+}
diff --git a/radio/aidl/android/hardware/radio/satellite/IRadioSatelliteResponse.aidl b/radio/aidl/android/hardware/radio/satellite/IRadioSatelliteResponse.aidl
new file mode 100644
index 0000000..e81edaa
--- /dev/null
+++ b/radio/aidl/android/hardware/radio/satellite/IRadioSatelliteResponse.aidl
@@ -0,0 +1,461 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.radio.satellite;
+
+import android.hardware.radio.RadioResponseInfo;
+import android.hardware.radio.satellite.NTRadioTechnology;
+import android.hardware.radio.satellite.SatelliteCapabilities;
+import android.hardware.radio.satellite.SatelliteMode;
+
+/**
+ * Interface declaring response functions to solicited radio requests for satellite APIs.
+ */
+@VintfStability
+oneway interface IRadioSatelliteResponse {
+    /**
+     * Acknowledge the receipt of radio request sent to the vendor. This must be sent only for
+     * radio request which take long time to respond. For more details, refer
+     * https://source.android.com/devices/tech/connect/ril.html
+     *
+     * @param serial Serial no. of the request whose acknowledgement is sent.
+     */
+    void acknowledgeRequest(in int serial);
+
+    /**
+     * Response of the request addAllowedSatelliteContacts.
+     *
+     * @param info Response info struct containing serial no. and error
+     *
+     * Valid errors returned:
+     *   RadioError:NONE
+     *   RadioError:ABORTED
+     *   RadioError:ACCESS_BARRED
+     *   RadioError:CANCELLED
+     *   RadioError:INTERNAL_ERR
+     *   RadioError:INVALID_ARGUMENTS
+     *   RadioError:INVALID_CONTACT
+     *   RadioError:INVALID_MODEM_STATE
+     *   RadioError:INVALID_SIM_STATE
+     *   RadioError:INVALID_STATE
+     *   RadioError:MODEM_ERR
+     *   RadioError:NETWORK_ERR
+     *   RadioError:NETWORK_NOT_READY
+     *   RadioError:NETWORK_REJECT
+     *   RadioError:NETWORK_TIMEOUT
+     *   RadioError:NO_MEMORY
+     *   RadioError:NO_NETWORK_FOUND
+     *   RadioError:NO_RESOURCES
+     *   RadioError:NO_SATELLITE_SIGNAL
+     *   RadioError:NO_SUBSCRIPTION
+     *   RadioError:NOT_SUFFICIENT_ACCOUNT_BALANCE
+     *   RadioError:OPERATION_NOT_ALLOWED
+     *   RadioError:RADIO_NOT_AVAILABLE
+     *   RadioError:REQUEST_NOT_SUPPORTED
+     *   RadioError:REQUEST_RATE_LIMITED
+     *   RadioError:SIM_ABSENT
+     *   RadioError:SIM_BUSY
+     *   RadioError:SIM_ERR
+     *   RadioError:SIM_FULL
+     *   RadioError:SYSTEM_ERR
+     *   RadioError:UNIDENTIFIED_SUBSCRIBER
+     */
+    void addAllowedSatelliteContactsResponse(in RadioResponseInfo info);
+
+    /**
+     * Response of the request getCapabilities.
+     *
+     * @param info Response info struct containing serial no. and error
+     * @param capabilities List of capabilities that the satellite modem supports.
+     *
+     * Valid errors returned:
+     *   RadioError:NONE
+     *   RadioError:INTERNAL_ERR
+     *   RadioError:INVALID_ARGUMENTS
+     *   RadioError:INVALID_MODEM_STATE
+     *   RadioError:INVALID_SIM_STATE
+     *   RadioError:INVALID_STATE
+     *   RadioError:MODEM_ERR
+     *   RadioError:NO_MEMORY
+     *   RadioError:NO_RESOURCES
+     *   RadioError:RADIO_NOT_AVAILABLE
+     *   RadioError:REQUEST_NOT_SUPPORTED
+     *   RadioError:REQUEST_RATE_LIMITED
+     *   RadioError:SYSTEM_ERR
+     */
+    void getCapabilitiesResponse(in RadioResponseInfo info, in SatelliteCapabilities capabilities);
+
+    /**
+     * Response of the request getMaxCharactersPerTextMessage.
+     *
+     * @param info Response info struct containing serial no. and error
+     * @param charLimit Maximum number of characters in a text message that can be sent.
+     *
+     * Valid errors returned:
+     *   RadioError:NONE
+     *   RadioError:INTERNAL_ERR
+     *   RadioError:INVALID_ARGUMENTS
+     *   RadioError:INVALID_MODEM_STATE
+     *   RadioError:INVALID_SIM_STATE
+     *   RadioError:INVALID_STATE
+     *   RadioError:MODEM_ERR
+     *   RadioError:NO_MEMORY
+     *   RadioError:NO_RESOURCES
+     *   RadioError:RADIO_NOT_AVAILABLE
+     *   RadioError:REQUEST_NOT_SUPPORTED
+     *   RadioError:REQUEST_RATE_LIMITED
+     *   RadioError:SYSTEM_ERR
+     */
+    void getMaxCharactersPerTextMessageResponse(in RadioResponseInfo info, in int charLimit);
+
+    /**
+     * Response of the request getPendingMessages.
+     *
+     * @param info Response info struct containing serial no. and error
+     * @param messages List of pending messages received.
+     *
+     * Valid errors returned:
+     *   RadioError:NONE
+     *   RadioError:ABORTED
+     *   RadioError:ACCESS_BARRED
+     *   RadioError:BLOCKED_DUE_TO_CALL
+     *   RadioError:CANCELLED
+     *   RadioError:ENCODING_ERR
+     *   RadioError:ENCODING_NOT_SUPPORTED
+     *   RadioError:INTERNAL_ERR
+     *   RadioError:INVALID_ARGUMENTS
+     *   RadioError:INVALID_MODEM_STATE
+     *   RadioError:INVALID_SIM_STATE
+     *   RadioError:INVALID_SMS_FORMAT
+     *   RadioError:INVALID_STATE
+     *   RadioError:MODEM_ERR
+     *   RadioError:NETWORK_ERR
+     *   RadioError:NETWORK_NOT_READY
+     *   RadioError:NETWORK_REJECT
+     *   RadioError:NETWORK_TIMEOUT
+     *   RadioError:NO_MEMORY
+     *   RadioError:NO_NETWORK_FOUND
+     *   RadioError:NO_RESOURCES
+     *   RadioError:NO_SMS_TO_ACK
+     *   RadioError:NO_SATELLITE_SIGNAL
+     *   RadioError:NO_SUBSCRIPTION
+     *   RadioError:NOT_SUFFICIENT_ACCOUNT_BALANCE
+     *   RadioError:OPERATION_NOT_ALLOWED
+     *   RadioError:RADIO_NOT_AVAILABLE
+     *   RadioError:REQUEST_NOT_SUPPORTED
+     *   RadioError:REQUEST_RATE_LIMITED
+     *   RadioError:SIM_ABSENT
+     *   RadioError:SIM_BUSY
+     *   RadioError:SIM_ERR
+     *   RadioError:SIM_FULL
+     *   RadioError:SIMULTANEOUS_SMS_AND_CALL_NOT_ALLOWED
+     *   RadioError:SYSTEM_ERR
+     *   RadioError:SWITCHED_FROM_SATELLITE_TO_TERRESTRIAL
+     */
+    void getPendingMessagesResponse(in RadioResponseInfo info, in String[] messages);
+
+    /**
+     * Response of the request getPowerSate.
+     *
+     * @param info Response info struct containing serial no. and error
+     * @param on True means the modem is ON.
+     *           False means the modem is OFF.
+     *
+     * Valid errors returned:
+     *   RadioError:NONE
+     *   RadioError:INTERNAL_ERR
+     *   RadioError:INVALID_ARGUMENTS
+     *   RadioError:INVALID_MODEM_STATE
+     *   RadioError:INVALID_SIM_STATE
+     *   RadioError:INVALID_STATE
+     *   RadioError:MODEM_ERR
+     *   RadioError:NO_MEMORY
+     *   RadioError:NO_RESOURCES
+     *   RadioError:RADIO_NOT_AVAILABLE
+     *   RadioError:REQUEST_NOT_SUPPORTED
+     *   RadioError:REQUEST_RATE_LIMITED
+     *   RadioError:SYSTEM_ERR
+     */
+    void getPowerStateResponse(in RadioResponseInfo info, in boolean on);
+
+    /**
+     * Response of the request getSatelliteMode.
+     *
+     * @param info Response info struct containing serial no. and error
+     * @param mode Current Mode of the satellite modem.
+     * @param technology The current technology of the satellite modem.
+     *
+     * Valid errors returned:
+     *   RadioError:NONE
+     *   RadioError:INTERNAL_ERR
+     *   RadioError:INVALID_ARGUMENTS
+     *   RadioError:INVALID_MODEM_STATE
+     *   RadioError:INVALID_SIM_STATE
+     *   RadioError:INVALID_STATE
+     *   RadioError:MODEM_ERR
+     *   RadioError:NO_MEMORY
+     *   RadioError:NO_RESOURCES
+     *   RadioError:RADIO_NOT_AVAILABLE
+     *   RadioError:REQUEST_NOT_SUPPORTED
+     *   RadioError:REQUEST_RATE_LIMITED
+     *   RadioError:SYSTEM_ERR
+     */
+    void getSatelliteModeResponse(
+            in RadioResponseInfo info, in SatelliteMode mode, in NTRadioTechnology technology);
+
+    /**
+     * Response of the request getTimeForNextSatelliteVisibility.
+     *
+     * @param info Response info struct containing serial no. and error
+     * @param timeInSeconds The duration in seconds after which the satellite will be visible.
+     *
+     * Valid errors returned:
+     *   RadioError:NONE
+     *   RadioError:INTERNAL_ERR
+     *   RadioError:INVALID_ARGUMENTS
+     *   RadioError:INVALID_MODEM_STATE
+     *   RadioError:INVALID_SIM_STATE
+     *   RadioError:INVALID_STATE
+     *   RadioError:MODEM_ERR
+     *   RadioError:NO_MEMORY
+     *   RadioError:NO_RESOURCES
+     *   RadioError:RADIO_NOT_AVAILABLE
+     *   RadioError:REQUEST_NOT_SUPPORTED
+     *   RadioError:REQUEST_RATE_LIMITED
+     *   RadioError:SYSTEM_ERR
+     */
+    void getTimeForNextSatelliteVisibilityResponse(in RadioResponseInfo info, in int timeInSeconds);
+
+    /**
+     * Response of the request provisionService.
+     *
+     * @param info Response info struct containing serial no. and error
+     * @param provisioned True means the service is provisioned.
+     *                    False means the service is not provisioned.
+     *
+     * Valid errors returned:
+     *   RadioError:NONE
+     *   RadioError:ABORTED
+     *   RadioError:ACCESS_BARRED
+     *   RadioError:CANCELLED
+     *   RadioError:FEATURE_NOT_SUPPORTED
+     *   RadioError:INTERNAL_ERR
+     *   RadioError:INVALID_ARGUMENTS
+     *   RadioError:INVALID_MODEM_STATE
+     *   RadioError:INVALID_SIM_STATE
+     *   RadioError:INVALID_STATE
+     *   RadioError:MODEM_ERR
+     *   RadioError:MODEM_INCOMPATIBLE
+     *   RadioError:NETWORK_ERR
+     *   RadioError:NETWORK_NOT_READY
+     *   RadioError:NETWORK_REJECT
+     *   RadioError:NETWORK_TIMEOUT
+     *   RadioError:NO_MEMORY
+     *   RadioError:NO_NETWORK_FOUND
+     *   RadioError:NO_RESOURCES
+     *   RadioError:NO_SATELLITE_SIGNAL
+     *   RadioError:NO_SUBSCRIPTION
+     *   RadioError:OPERATION_NOT_ALLOWED
+     *   RadioError:RADIO_NOT_AVAILABLE
+     *   RadioError:RADIO_TECHNOLOGY_NOT_SUPPORTED
+     *   RadioError:REQUEST_NOT_SUPPORTED
+     *   RadioError:REQUEST_RATE_LIMITED
+     *   RadioError:SIM_ABSENT
+     *   RadioError:SIM_BUSY
+     *   RadioError:SIM_ERR
+     *   RadioError:SIM_FULL
+     *   RadioError:SUBSCRIBER_NOT_AUTHORIZED
+     *   RadioError:SYSTEM_ERR
+     */
+    void provisionServiceResponse(in RadioResponseInfo info, in boolean provisioned);
+
+    /**
+     * Response of the request removeAllowedSatelliteContacts.
+     *
+     * @param info Response info struct containing serial no. and error
+     *
+     * Valid errors returned:
+     *   RadioError:NONE
+     *   RadioError:ABORTED
+     *   RadioError:ACCESS_BARRED
+     *   RadioError:CANCELLED
+     *   RadioError:INTERNAL_ERR
+     *   RadioError:INVALID_ARGUMENTS
+     *   RadioError:INVALID_CONTACT
+     *   RadioError:INVALID_MODEM_STATE
+     *   RadioError:INVALID_SIM_STATE
+     *   RadioError:INVALID_STATE
+     *   RadioError:MODEM_ERR
+     *   RadioError:NETWORK_ERR
+     *   RadioError:NETWORK_NOT_READY
+     *   RadioError:NETWORK_REJECT
+     *   RadioError:NETWORK_TIMEOUT
+     *   RadioError:NO_MEMORY
+     *   RadioError:NO_NETWORK_FOUND
+     *   RadioError:NO_RESOURCES
+     *   RadioError:NO_SATELLITE_SIGNAL
+     *   RadioError:NO_SUBSCRIPTION
+     *   RadioError:NOT_SUFFICIENT_ACCOUNT_BALANCE
+     *   RadioError:OPERATION_NOT_ALLOWED
+     *   RadioError:RADIO_NOT_AVAILABLE
+     *   RadioError:REQUEST_NOT_SUPPORTED
+     *   RadioError:REQUEST_RATE_LIMITED
+     *   RadioError:SIM_ABSENT
+     *   RadioError:SIM_BUSY
+     *   RadioError:SIM_ERR
+     *   RadioError:SIM_FULL
+     *   RadioError:SYSTEM_ERR
+     *   RadioError:UNIDENTIFIED_SUBSCRIBER
+     */
+    void removeAllowedSatelliteContactsResponse(in RadioResponseInfo info);
+
+    /**
+     * Response of the request sendMessages.
+     *
+     * @param info Response info struct containing serial no. and error
+     *
+     * Valid errors returned:
+     *   RadioError:NONE
+     *   RadioError:ABORTED
+     *   RadioError:ACCESS_BARRED
+     *   RadioError:BLOCKED_DUE_TO_CALL
+     *   RadioError:CANCELLED
+     *   RadioError:ENCODING_ERR
+     *   RadioError:ENCODING_NOT_SUPPORTED
+     *   RadioError:INTERNAL_ERR
+     *   RadioError:INVALID_ARGUMENTS
+     *   RadioError:INVALID_MODEM_STATE
+     *   RadioError:INVALID_SIM_STATE
+     *   RadioError:INVALID_SMS_FORMAT
+     *   RadioError:INVALID_STATE
+     *   RadioError:MODEM_ERR
+     *   RadioError:NETWORK_ERR
+     *   RadioError:NETWORK_NOT_READY
+     *   RadioError:NETWORK_REJECT
+     *   RadioError:NETWORK_TIMEOUT
+     *   RadioError:NO_MEMORY
+     *   RadioError:NO_NETWORK_FOUND
+     *   RadioError:NO_RESOURCES
+     *   RadioError:NO_SMS_TO_ACK
+     *   RadioError:NO_SATELLITE_SIGNAL
+     *   RadioError:NO_SUBSCRIPTION
+     *   RadioError:NOT_SUFFICIENT_ACCOUNT_BALANCE
+     *   RadioError:OPERATION_NOT_ALLOWED
+     *   RadioError:RADIO_NOT_AVAILABLE
+     *   RadioError:REQUEST_NOT_SUPPORTED
+     *   RadioError:REQUEST_RATE_LIMITED
+     *   RadioError:SIM_ABSENT
+     *   RadioError:SIM_BUSY
+     *   RadioError:SIM_ERR
+     *   RadioError:SIM_FULL
+     *   RadioError:SIMULTANEOUS_SMS_AND_CALL_NOT_ALLOWED
+     *   RadioError:SMS_SEND_FAIL_RETRY
+     *   RadioError:SYSTEM_ERR
+     *   RadioError:SWITCHED_FROM_SATELLITE_TO_TERRESTRIAL
+     *   RadioError:UNIDENTIFIED_SUBSCRIBER
+     */
+    void sendMessagesResponse(in RadioResponseInfo info);
+
+    /**
+     * Response of the request setIndicationFilter.
+     *
+     * @param info Response info struct containing serial no. and error
+     *
+     * Valid errors returned:
+     *   RadioError:NONE
+     *   RadioError:INTERNAL_ERR
+     *   RadioError:INVALID_ARGUMENTS
+     *   RadioError:INVALID_MODEM_STATE
+     *   RadioError:INVALID_SIM_STATE
+     *   RadioError:INVALID_STATE
+     *   RadioError:MODEM_ERR
+     *   RadioError:NO_MEMORY
+     *   RadioError:NO_RESOURCES
+     *   RadioError:RADIO_NOT_AVAILABLE
+     *   RadioError:REQUEST_NOT_SUPPORTED
+     *   RadioError:REQUEST_RATE_LIMITED
+     *   RadioError:SYSTEM_ERR
+     */
+    void setIndicationFilterResponse(in RadioResponseInfo info);
+
+    /**
+     * Response of the request setPower.
+     *
+     * @param info Response info struct containing serial no. and error
+     *
+     * Valid errors returned:
+     *   RadioError:NONE
+     *   RadioError:INTERNAL_ERR
+     *   RadioError:INVALID_ARGUMENTS
+     *   RadioError:INVALID_MODEM_STATE
+     *   RadioError:INVALID_SIM_STATE
+     *   RadioError:INVALID_STATE
+     *   RadioError:MODEM_ERR
+     *   RadioError:NO_MEMORY
+     *   RadioError:NO_RESOURCES
+     *   RadioError:NO_RF_CALIBRATION_INFO
+     *   RadioError:RADIO_NOT_AVAILABLE
+     *   RadioError:REQUEST_NOT_SUPPORTED
+     *   RadioError:REQUEST_RATE_LIMITED
+     *   RadioError:RF_HARDWARE_ISSUE
+     *   RadioError:SYSTEM_ERR
+     */
+    void setPowerResponse(in RadioResponseInfo info);
+
+    /**
+     * Response of the request startSendingSatellitePointingInfo.
+     *
+     * @param info Response info struct containing serial no. and error
+     *
+     * Valid errors returned:
+     *   RadioError:NONE
+     *   RadioError:INTERNAL_ERR
+     *   RadioError:INVALID_ARGUMENTS
+     *   RadioError:INVALID_MODEM_STATE
+     *   RadioError:INVALID_SIM_STATE
+     *   RadioError:INVALID_STATE
+     *   RadioError:MODEM_ERR
+     *   RadioError:NO_MEMORY
+     *   RadioError:NO_RESOURCES
+     *   RadioError:RADIO_NOT_AVAILABLE
+     *   RadioError:REQUEST_NOT_SUPPORTED
+     *   RadioError:REQUEST_RATE_LIMITED
+     *   RadioError:SYSTEM_ERR
+     */
+    void startSendingSatellitePointingInfoResponse(in RadioResponseInfo info);
+
+    /**
+     * Response of the request stopSendingSatellitePointingInfo.
+     *
+     * @param info Response info struct containing serial no. and error
+     *
+     * Valid errors returned:
+     *   RadioError:NONE
+     *   RadioError:INTERNAL_ERR
+     *   RadioError:INVALID_ARGUMENTS
+     *   RadioError:INVALID_MODEM_STATE
+     *   RadioError:INVALID_SIM_STATE
+     *   RadioError:INVALID_STATE
+     *   RadioError:MODEM_ERR
+     *   RadioError:NO_MEMORY
+     *   RadioError:NO_RESOURCES
+     *   RadioError:RADIO_NOT_AVAILABLE
+     *   RadioError:REQUEST_NOT_SUPPORTED
+     *   RadioError:REQUEST_RATE_LIMITED
+     *   RadioError:SYSTEM_ERR
+     */
+    void stopSendingSatellitePointingInfoResponse(in RadioResponseInfo info);
+}
diff --git a/radio/aidl/android/hardware/radio/ims/media/MediaProtocolType.aidl b/radio/aidl/android/hardware/radio/satellite/IndicationFilter.aidl
similarity index 71%
copy from radio/aidl/android/hardware/radio/ims/media/MediaProtocolType.aidl
copy to radio/aidl/android/hardware/radio/satellite/IndicationFilter.aidl
index 325c6fa..1a65bee 100644
--- a/radio/aidl/android/hardware/radio/ims/media/MediaProtocolType.aidl
+++ b/radio/aidl/android/hardware/radio/satellite/IndicationFilter.aidl
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright (C) 2022 The Android Open Source Project
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -14,13 +14,12 @@
  * limitations under the License.
  */
 
-package android.hardware.radio.ims.media;
+package android.hardware.radio.satellite;
 
 @VintfStability
 @Backing(type="int")
-enum MediaProtocolType {
-   /** Real Time Protocol, see RFC 3550 */
-   RTP = 0,
-   /** Real Time Control Protocol, see RFC 3550 */
-   RTCP = 1,
+@JavaDerive(toString=true)
+enum IndicationFilter {
+    NONE = 0,
+    SATELLITE_MODE = 1
 }
diff --git a/radio/aidl/android/hardware/radio/satellite/NTRadioTechnology.aidl b/radio/aidl/android/hardware/radio/satellite/NTRadioTechnology.aidl
new file mode 100644
index 0000000..39b2b00
--- /dev/null
+++ b/radio/aidl/android/hardware/radio/satellite/NTRadioTechnology.aidl
@@ -0,0 +1,31 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.radio.satellite;
+
+@VintfStability
+@Backing(type="int")
+@JavaDerive(toString=true)
+enum NTRadioTechnology {
+    /* 3GPP NB-IoT (Narrowband Internet of Things) over Non-Terrestrial-Networks technology */
+    NB_IOT_NTN = 0,
+    /* 3GPP 5G NR over Non-Terrestrial-Networks technology */
+    NR_NTN = 1,
+    /* 3GPP eMTC (enhanced Machine-Type Communication) over Non-Terrestrial-Networks technology */
+    EMTC_NTN = 2,
+    /* Proprietary technology like Iridium or Bullitt */
+    PROPRIETARY = 3
+}
diff --git a/radio/aidl/android/hardware/radio/satellite/PointingInfo.aidl b/radio/aidl/android/hardware/radio/satellite/PointingInfo.aidl
new file mode 100644
index 0000000..8496a59
--- /dev/null
+++ b/radio/aidl/android/hardware/radio/satellite/PointingInfo.aidl
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.radio.satellite;
+
+@VintfStability
+@JavaDerive(toString=true)
+parcelable PointingInfo {
+    /* Satellite azimuth in degrees */
+    float satelliteAzimuthDegrees;
+
+    /* Satellite elevation in degrees */
+    float satelliteElevationDegrees;
+
+    /* Antenna azimuth in degrees */
+    float antennaAzimuthDegrees;
+
+    /**
+     * Angle of rotation about the x axis. This value represents the angle between a plane
+     * parallel to the device's screen and a plane parallel to the ground.
+     */
+    float antennaPitchDegrees;
+
+    /**
+     * Angle of rotation about the y axis. This value represents the angle between a plane
+     * perpendicular to the device's screen and a plane parallel to the ground.
+     */
+    float antennaRollDegrees;
+}
diff --git a/radio/aidl/android/hardware/radio/satellite/SatelliteCapabilities.aidl b/radio/aidl/android/hardware/radio/satellite/SatelliteCapabilities.aidl
new file mode 100644
index 0000000..01e64aa
--- /dev/null
+++ b/radio/aidl/android/hardware/radio/satellite/SatelliteCapabilities.aidl
@@ -0,0 +1,50 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.radio.satellite;
+
+import android.hardware.radio.satellite.NTRadioTechnology;
+import android.hardware.radio.satellite.SatelliteFeature;
+
+@VintfStability
+@JavaDerive(toString=true)
+parcelable SatelliteCapabilities {
+    /**
+     * List of technologies supported by the satellite modem.
+     */
+    NTRadioTechnology[] supportedRadioTechnologies;
+
+    /**
+     * Whether satellite mode is always on (this indicates the power impact of keeping it on is
+     * very minimal).
+     */
+    boolean isAlwaysOn;
+
+    /**
+     * Whether UE needs to point to a satellite to send and receive data.
+     */
+    boolean needsPointingToSatellite;
+
+    /**
+     * List of features supported by the satellite modem.
+     */
+    SatelliteFeature[] supportedFeatures;
+
+    /**
+     * Whether UE needs a separate SIM profile to communicate with satellite network.
+     */
+    boolean needsSeparateSimProfile;
+}
diff --git a/radio/aidl/android/hardware/radio/satellite/SatelliteFeature.aidl b/radio/aidl/android/hardware/radio/satellite/SatelliteFeature.aidl
new file mode 100644
index 0000000..0e33998
--- /dev/null
+++ b/radio/aidl/android/hardware/radio/satellite/SatelliteFeature.aidl
@@ -0,0 +1,31 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.radio.satellite;
+
+@VintfStability
+@Backing(type="int")
+@JavaDerive(toString=true)
+enum SatelliteFeature {
+    /* Able to send and receive SMS messages to/from SOS numbers like call/service centers */
+    SOS_SMS = 0,
+    /* Able to send and receive SMS messages to/from emergency numbers like 911 */
+    EMERGENCY_SMS = 1,
+    /* Able to send and receive SMS messages to/from any allowed contacts */
+    SMS = 2,
+    /* Able to send device location to allowed contacts */
+    LOCATION_SHARING = 3
+}
diff --git a/radio/aidl/android/hardware/radio/satellite/SatelliteMode.aidl b/radio/aidl/android/hardware/radio/satellite/SatelliteMode.aidl
new file mode 100644
index 0000000..349fd9e
--- /dev/null
+++ b/radio/aidl/android/hardware/radio/satellite/SatelliteMode.aidl
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.radio.satellite;
+
+@VintfStability
+@Backing(type="int")
+@JavaDerive(toString=true)
+enum SatelliteMode {
+    /* Satellite modem is powered off */
+    POWERED_OFF = 0,
+    /* Satellite modem is in out of service state and not searching for satellite signal */
+    OUT_OF_SERVICE_NOT_SEARCHING = 1,
+    /* Satellite modem is in out of service state and searching for satellite signal */
+    OUT_OF_SERVICE_SEARCHING = 2,
+    /* Satellite modem has found satellite signal and gets connected to the satellite network */
+    ACQUIRED = 3,
+    /* Satellite modem is sending and/or receiving messages */
+    MESSAGE_TRANSFERRING = 4
+}
diff --git a/radio/aidl/android/hardware/radio/sim/CarrierRestrictions.aidl b/radio/aidl/android/hardware/radio/sim/CarrierRestrictions.aidl
index 5a79f0f..edbec2c 100644
--- a/radio/aidl/android/hardware/radio/sim/CarrierRestrictions.aidl
+++ b/radio/aidl/android/hardware/radio/sim/CarrierRestrictions.aidl
@@ -58,9 +58,4 @@
     boolean allowedCarriersPrioritized;
     /** Current restriction status as defined in CarrierRestrictionStatus enum */
     CarrierRestrictionStatus status;
-    /**
-    * Android carrier ID of the locked carrier.
-    * see https://source.android.com/docs/core/connect/carrierid
-    */
-    int carrierId;
 }
diff --git a/radio/aidl/compat/libradiocompat/Android.bp b/radio/aidl/compat/libradiocompat/Android.bp
index 95953ac..6bbc9fe 100644
--- a/radio/aidl/compat/libradiocompat/Android.bp
+++ b/radio/aidl/compat/libradiocompat/Android.bp
@@ -42,6 +42,7 @@
         "android.hardware.radio.modem-V2-ndk",
         "android.hardware.radio.network-V2-ndk",
         "android.hardware.radio.sap-V1-ndk",
+        "android.hardware.radio.satellite-V1-ndk",
         "android.hardware.radio.sim-V2-ndk",
         "android.hardware.radio.voice-V2-ndk",
         "android.hardware.radio@1.0",
@@ -90,6 +91,9 @@
         "sap/Sap.cpp",
         "sap/SapCallback.cpp",
         "sap/structs.cpp",
+        "satellite/RadioIndication-satellite.cpp",
+        "satellite/RadioResponse-satellite.cpp",
+        "satellite/RadioSatellite.cpp",
         "sim/RadioIndication-sim.cpp",
         "sim/RadioResponse-sim.cpp",
         "sim/RadioSim.cpp",
diff --git a/radio/aidl/compat/libradiocompat/data/structs.cpp b/radio/aidl/compat/libradiocompat/data/structs.cpp
index 22cde6b..47f1f86 100644
--- a/radio/aidl/compat/libradiocompat/data/structs.cpp
+++ b/radio/aidl/compat/libradiocompat/data/structs.cpp
@@ -136,8 +136,8 @@
             .fiveQi = qos.fiveQi,
             .downlink = toAidl(qos.downlink),
             .uplink = toAidl(qos.uplink),
-            .qosFlowIdentifier = static_cast<int8_t>(qos.qfi),
-            .averagingWindowMs = qos.averagingWindowMs,
+            .qfi = static_cast<int8_t>(qos.qfi),
+            .averagingWindowMillis = qos.averagingWindowMs,
     };
 }
 
diff --git a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioIndication.h b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioIndication.h
index f042456..ad9127e 100644
--- a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioIndication.h
+++ b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioIndication.h
@@ -23,6 +23,7 @@
 #include <aidl/android/hardware/radio/messaging/IRadioMessagingIndication.h>
 #include <aidl/android/hardware/radio/modem/IRadioModemIndication.h>
 #include <aidl/android/hardware/radio/network/IRadioNetworkIndication.h>
+#include <aidl/android/hardware/radio/satellite/IRadioSatelliteIndication.h>
 #include <aidl/android/hardware/radio/sim/IRadioSimIndication.h>
 #include <aidl/android/hardware/radio/voice/IRadioVoiceIndication.h>
 #include <android/hardware/radio/1.6/IRadioIndication.h>
@@ -60,6 +61,10 @@
             ::aidl::android::hardware::radio::ims::IRadioImsIndication,
             ::aidl::android::hardware::radio::ims::IRadioImsIndicationDefault, true>
             mImsCb;
+    GuaranteedCallback<  //
+            ::aidl::android::hardware::radio::satellite::IRadioSatelliteIndication,
+            ::aidl::android::hardware::radio::satellite::IRadioSatelliteIndicationDefault, true>
+            mSatelliteCb;
 
     // IRadioIndication @ 1.0
     Return<void> radioStateChanged(V1_0::RadioIndicationType type,
@@ -227,6 +232,9 @@
             std::shared_ptr<::aidl::android::hardware::radio::voice::IRadioVoiceIndication> voicCb);
     void setResponseFunction(
             std::shared_ptr<::aidl::android::hardware::radio::ims::IRadioImsIndication> imsCb);
+    void setResponseFunction(
+            std::shared_ptr<::aidl::android::hardware::radio::satellite::IRadioSatelliteIndication>
+                    satelliteCb);
 
     std::shared_ptr<::aidl::android::hardware::radio::data::IRadioDataIndication> dataCb();
     std::shared_ptr<::aidl::android::hardware::radio::messaging::IRadioMessagingIndication>
@@ -236,6 +244,8 @@
     std::shared_ptr<::aidl::android::hardware::radio::sim::IRadioSimIndication> simCb();
     std::shared_ptr<::aidl::android::hardware::radio::voice::IRadioVoiceIndication> voiceCb();
     std::shared_ptr<::aidl::android::hardware::radio::ims::IRadioImsIndication> imsCb();
+    std::shared_ptr<::aidl::android::hardware::radio::satellite::IRadioSatelliteIndication>
+    satelliteCb();
 };
 
 }  // namespace android::hardware::radio::compat
diff --git a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioResponse.h b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioResponse.h
index 22451ae..636c1a4 100644
--- a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioResponse.h
+++ b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioResponse.h
@@ -23,6 +23,7 @@
 #include <aidl/android/hardware/radio/messaging/IRadioMessagingResponse.h>
 #include <aidl/android/hardware/radio/modem/IRadioModemResponse.h>
 #include <aidl/android/hardware/radio/network/IRadioNetworkResponse.h>
+#include <aidl/android/hardware/radio/satellite/IRadioSatelliteResponse.h>
 #include <aidl/android/hardware/radio/sim/IRadioSimResponse.h>
 #include <aidl/android/hardware/radio/voice/IRadioVoiceResponse.h>
 #include <android/hardware/radio/1.6/IRadioResponse.h>
@@ -53,6 +54,9 @@
     GuaranteedCallback<::aidl::android::hardware::radio::ims::IRadioImsResponse,
                        ::aidl::android::hardware::radio::ims::IRadioImsResponseDefault>
             mImsCb;
+    GuaranteedCallback<::aidl::android::hardware::radio::satellite::IRadioSatelliteResponse,
+                       ::aidl::android::hardware::radio::satellite::IRadioSatelliteResponseDefault>
+            mSatelliteCb;
 
     // IRadioResponse @ 1.0
     Return<void> getIccCardStatusResponse(const V1_0::RadioResponseInfo& info,
@@ -446,6 +450,9 @@
             std::shared_ptr<::aidl::android::hardware::radio::voice::IRadioVoiceResponse> voiceCb);
     void setResponseFunction(
             std::shared_ptr<::aidl::android::hardware::radio::ims::IRadioImsResponse> imsCb);
+    void setResponseFunction(
+            std::shared_ptr<::aidl::android::hardware::radio::satellite::IRadioSatelliteResponse>
+                    satelliteCb);
 
     std::shared_ptr<::aidl::android::hardware::radio::data::IRadioDataResponse> dataCb();
     std::shared_ptr<::aidl::android::hardware::radio::messaging::IRadioMessagingResponse>
@@ -455,6 +462,8 @@
     std::shared_ptr<::aidl::android::hardware::radio::sim::IRadioSimResponse> simCb();
     std::shared_ptr<::aidl::android::hardware::radio::voice::IRadioVoiceResponse> voiceCb();
     std::shared_ptr<::aidl::android::hardware::radio::ims::IRadioImsResponse> imsCb();
+    std::shared_ptr<::aidl::android::hardware::radio::satellite::IRadioSatelliteResponse>
+    satelliteCb();
 };
 
 }  // namespace android::hardware::radio::compat
diff --git a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioSatellite.h b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioSatellite.h
new file mode 100644
index 0000000..3ee6db2
--- /dev/null
+++ b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioSatellite.h
@@ -0,0 +1,65 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#pragma once
+
+#include "RadioCompatBase.h"
+
+#include <aidl/android/hardware/radio/satellite/BnRadioSatellite.h>
+
+namespace android::hardware::radio::compat {
+
+class RadioSatellite : public RadioCompatBase,
+                       public aidl::android::hardware::radio::satellite::BnRadioSatellite {
+    ::ndk::ScopedAStatus responseAcknowledgement() override;
+    ::ndk::ScopedAStatus getCapabilities(int32_t serial) override;
+    ::ndk::ScopedAStatus setPower(int32_t serial, bool on) override;
+    ::ndk::ScopedAStatus getPowerState(int32_t serial) override;
+    ::ndk::ScopedAStatus provisionService(
+            int32_t serial, const std::string& imei, const std::string& msisdn,
+            const std::string& imsi,
+            const std::vector<::aidl::android::hardware::radio::satellite::SatelliteFeature>&
+                    features) override;
+    ::ndk::ScopedAStatus addAllowedSatelliteContacts(
+            int32_t serial, const std::vector<std::string>& contacts) override;
+    ::ndk::ScopedAStatus removeAllowedSatelliteContacts(
+            int32_t serial, const std::vector<std::string>& contacts) override;
+    ::ndk::ScopedAStatus sendMessages(int32_t serial, const std::vector<std::string>& messages,
+                                      const std::string& destination, double latitude,
+                                      double longitude) override;
+    ::ndk::ScopedAStatus getPendingMessages(int32_t serial) override;
+    ::ndk::ScopedAStatus getSatelliteMode(int32_t serial) override;
+    ::ndk::ScopedAStatus setIndicationFilter(int32_t serial, int32_t filterBitmask) override;
+    ::ndk::ScopedAStatus startSendingSatellitePointingInfo(int32_t serial) override;
+    ::ndk::ScopedAStatus stopSendingSatellitePointingInfo(int32_t serial) override;
+    ::ndk::ScopedAStatus getMaxCharactersPerTextMessage(int32_t serial) override;
+    ::ndk::ScopedAStatus getTimeForNextSatelliteVisibility(int32_t serial) override;
+
+    ::ndk::ScopedAStatus setResponseFunctions(
+            const std::shared_ptr<
+                    ::aidl::android::hardware::radio::satellite::IRadioSatelliteResponse>&
+                    radioSatelliteResponse,
+            const std::shared_ptr<
+                    ::aidl::android::hardware::radio::satellite::IRadioSatelliteIndication>&
+                    radioSatelliteIndication) override;
+
+  protected:
+    std::shared_ptr<::aidl::android::hardware::radio::satellite::IRadioSatelliteResponse> respond();
+
+  public:
+    using RadioCompatBase::RadioCompatBase;
+};
+
+}  // namespace android::hardware::radio::compat
diff --git a/radio/aidl/compat/libradiocompat/satellite/RadioIndication-satellite.cpp b/radio/aidl/compat/libradiocompat/satellite/RadioIndication-satellite.cpp
new file mode 100644
index 0000000..39da43d
--- /dev/null
+++ b/radio/aidl/compat/libradiocompat/satellite/RadioIndication-satellite.cpp
@@ -0,0 +1,39 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <libradiocompat/RadioIndication.h>
+
+#include "commonStructs.h"
+#include "debug.h"
+
+#include "collections.h"
+
+#define RADIO_MODULE "RadioSatelliteIndication"
+
+namespace android::hardware::radio::compat {
+
+namespace aidl = ::aidl::android::hardware::radio::satellite;
+
+void RadioIndication::setResponseFunction(
+        std::shared_ptr<aidl::IRadioSatelliteIndication> satelliteCb) {
+    mSatelliteCb = satelliteCb;
+}
+
+std::shared_ptr<aidl::IRadioSatelliteIndication> RadioIndication::satelliteCb() {
+    return mSatelliteCb.get();
+}
+
+}  // namespace android::hardware::radio::compat
diff --git a/radio/aidl/compat/libradiocompat/satellite/RadioResponse-satellite.cpp b/radio/aidl/compat/libradiocompat/satellite/RadioResponse-satellite.cpp
new file mode 100644
index 0000000..2209c93
--- /dev/null
+++ b/radio/aidl/compat/libradiocompat/satellite/RadioResponse-satellite.cpp
@@ -0,0 +1,39 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <libradiocompat/RadioResponse.h>
+
+#include "commonStructs.h"
+#include "debug.h"
+
+#include "collections.h"
+
+#define RADIO_MODULE "RadioSatelliteResponse"
+
+namespace android::hardware::radio::compat {
+
+namespace aidl = ::aidl::android::hardware::radio::satellite;
+
+void RadioResponse::setResponseFunction(
+        std::shared_ptr<aidl::IRadioSatelliteResponse> satelliteCb) {
+    mSatelliteCb = satelliteCb;
+}
+
+std::shared_ptr<aidl::IRadioSatelliteResponse> RadioResponse::satelliteCb() {
+    return mSatelliteCb.get();
+}
+
+}  // namespace android::hardware::radio::compat
diff --git a/radio/aidl/compat/libradiocompat/satellite/RadioSatellite.cpp b/radio/aidl/compat/libradiocompat/satellite/RadioSatellite.cpp
new file mode 100644
index 0000000..16a3167
--- /dev/null
+++ b/radio/aidl/compat/libradiocompat/satellite/RadioSatellite.cpp
@@ -0,0 +1,128 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <libradiocompat/RadioSatellite.h>
+
+#include "commonStructs.h"
+#include "debug.h"
+
+#include "collections.h"
+
+#define RADIO_MODULE "RadioSatellite"
+
+namespace android::hardware::radio::compat {
+
+using ::ndk::ScopedAStatus;
+namespace aidl = ::aidl::android::hardware::radio::satellite;
+constexpr auto ok = &ScopedAStatus::ok;
+
+std::shared_ptr<aidl::IRadioSatelliteResponse> RadioSatellite::respond() {
+    return mCallbackManager->response().satelliteCb();
+}
+
+ScopedAStatus RadioSatellite::responseAcknowledgement() {
+    LOG(ERROR) << " responseAcknowledgement is unsupported by HIDL HALs";
+    return ok();
+}
+ScopedAStatus RadioSatellite::getCapabilities(int32_t serial) {
+    LOG_CALL << serial;
+    LOG(ERROR) << " getCapabilities is unsupported by HIDL HALs";
+    return ok();
+}
+ScopedAStatus RadioSatellite::setPower(int32_t serial, bool /*on*/) {
+    LOG_CALL << serial;
+    LOG(ERROR) << " setPower is unsupported by HIDL HALs";
+    return ok();
+}
+ScopedAStatus RadioSatellite::getPowerState(int32_t serial) {
+    LOG_CALL << serial;
+    LOG(ERROR) << " getPowerSate is unsupported by HIDL HALs";
+    return ok();
+}
+ScopedAStatus RadioSatellite::provisionService(
+        int32_t serial, const std::string& /*imei*/, const std::string& /*msisdn*/,
+        const std::string& /*imsi*/,
+        const std::vector<
+                ::aidl::android::hardware::radio::satellite::SatelliteFeature>& /*features*/) {
+    LOG_CALL << serial;
+    LOG(ERROR) << " provisionService is unsupported by HIDL HALs";
+    return ok();
+}
+ScopedAStatus RadioSatellite::addAllowedSatelliteContacts(
+        int32_t serial, const std::vector<std::string>& /*contacts*/) {
+    LOG_CALL << serial;
+    LOG(ERROR) << " addAllowedSatelliteContacts is unsupported by HIDL HALs";
+    return ok();
+}
+ScopedAStatus RadioSatellite::removeAllowedSatelliteContacts(
+        int32_t serial, const std::vector<std::string>& /*contacts*/) {
+    LOG_CALL << serial;
+    LOG(ERROR) << " removeAllowedSatelliteContacts is unsupported by HIDL HALs";
+    return ok();
+}
+ScopedAStatus RadioSatellite::sendMessages(int32_t serial,
+                                           const std::vector<std::string>& /*messages*/,
+                                           const std::string& /*destination*/, double /*latitude*/,
+                                           double /*longitude*/) {
+    LOG_CALL << serial;
+    LOG(ERROR) << " sendMessage is unsupported by HIDL HALs";
+    return ok();
+}
+ScopedAStatus RadioSatellite::getPendingMessages(int32_t serial) {
+    LOG_CALL << serial;
+    LOG(ERROR) << " getPendingMessages is unsupported by HIDL HALs";
+    return ok();
+}
+ScopedAStatus RadioSatellite::getSatelliteMode(int32_t serial) {
+    LOG_CALL << serial;
+    LOG(ERROR) << " getSatelliteMode is unsupported by HIDL HALs";
+    return ok();
+}
+ScopedAStatus RadioSatellite::setIndicationFilter(int32_t serial, int32_t /*filterBitmask*/) {
+    LOG_CALL << serial;
+    LOG(ERROR) << " setIndicationFilter is unsupported by HIDL HALs";
+    return ok();
+}
+ScopedAStatus RadioSatellite::startSendingSatellitePointingInfo(int32_t serial) {
+    LOG_CALL << serial;
+    LOG(ERROR) << " startSendingSatellitePointingInfo is unsupported by HIDL HALs";
+    return ok();
+}
+ScopedAStatus RadioSatellite::stopSendingSatellitePointingInfo(int32_t serial) {
+    LOG_CALL << serial;
+    LOG(ERROR) << " stopSendingSatellitePointingInfo is unsupported by HIDL HALs";
+    return ok();
+}
+ScopedAStatus RadioSatellite::getMaxCharactersPerTextMessage(int32_t serial) {
+    LOG_CALL << serial;
+    LOG(ERROR) << " getMaxCharactersPerTextMessage is unsupported by HIDL HALs";
+    return ok();
+}
+ScopedAStatus RadioSatellite::getTimeForNextSatelliteVisibility(int32_t serial) {
+    LOG_CALL << serial;
+    LOG(ERROR) << " getTimeForNextSatelliteVisibility is unsupported by HIDL HALs";
+    return ok();
+}
+
+ScopedAStatus RadioSatellite::setResponseFunctions(
+        const std::shared_ptr<aidl::IRadioSatelliteResponse>& response,
+        const std::shared_ptr<aidl::IRadioSatelliteIndication>& indication) {
+    LOG_CALL << response << ' ' << indication;
+    mCallbackManager->setResponseFunctions(response, indication);
+    return ok();
+}
+
+}  // namespace android::hardware::radio::compat
diff --git a/radio/aidl/compat/service/Android.bp b/radio/aidl/compat/service/Android.bp
index 56674c1..a3717b4 100644
--- a/radio/aidl/compat/service/Android.bp
+++ b/radio/aidl/compat/service/Android.bp
@@ -45,6 +45,7 @@
         "android.hardware.radio.modem-V2-ndk",
         "android.hardware.radio.network-V2-ndk",
         "android.hardware.radio.sap-V1-ndk",
+        "android.hardware.radio.satellite-V1-ndk",
         "android.hardware.radio.sim-V2-ndk",
         "android.hardware.radio.voice-V2-ndk",
         "android.hardware.radio@1.0",
diff --git a/radio/aidl/vts/Android.bp b/radio/aidl/vts/Android.bp
index 99c3d71..518dfd4 100644
--- a/radio/aidl/vts/Android.bp
+++ b/radio/aidl/vts/Android.bp
@@ -55,6 +55,9 @@
         "radio_network_test.cpp",
         "radio_sap_callback.cpp",
         "radio_sap_test.cpp",
+        "radio_satellite_indication.cpp",
+        "radio_satellite_response.cpp",
+        "radio_satellite_test.cpp",
         "radio_sim_indication.cpp",
         "radio_sim_response.cpp",
         "radio_sim_test.cpp",
@@ -76,6 +79,7 @@
         "android.hardware.radio.modem-V2-ndk",
         "android.hardware.radio.network-V2-ndk",
         "android.hardware.radio.sap-V1-ndk",
+        "android.hardware.radio.satellite-V1-ndk",
         "android.hardware.radio.sim-V2-ndk",
         "android.hardware.radio.voice-V2-ndk",
     ],
diff --git a/radio/aidl/vts/VtsHalRadioTargetTest.cpp b/radio/aidl/vts/VtsHalRadioTargetTest.cpp
index 33a0d7d..f718e57 100644
--- a/radio/aidl/vts/VtsHalRadioTargetTest.cpp
+++ b/radio/aidl/vts/VtsHalRadioTargetTest.cpp
@@ -23,6 +23,7 @@
 #include "radio_modem_utils.h"
 #include "radio_network_utils.h"
 #include "radio_sap_utils.h"
+#include "radio_satellite_utils.h"
 #include "radio_sim_utils.h"
 #include "radio_voice_utils.h"
 
@@ -78,6 +79,12 @@
         testing::ValuesIn(android::getAidlHalInstanceNames(IRadioIms::descriptor)),
         android::PrintInstanceNameToString);
 
+GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(RadioSatelliteTest);
+INSTANTIATE_TEST_SUITE_P(
+        PerInstance, RadioSatelliteTest,
+        testing::ValuesIn(android::getAidlHalInstanceNames(IRadioSatellite::descriptor)),
+        android::PrintInstanceNameToString);
+
 int main(int argc, char** argv) {
     ::testing::InitGoogleTest(&argc, argv);
     ABinderProcess_setThreadPoolMaxThreadCount(1);
diff --git a/radio/aidl/vts/radio_aidl_hal_utils.h b/radio/aidl/vts/radio_aidl_hal_utils.h
index d515e1a..2e6c49c 100644
--- a/radio/aidl/vts/radio_aidl_hal_utils.h
+++ b/radio/aidl/vts/radio_aidl_hal_utils.h
@@ -69,6 +69,8 @@
 
 static constexpr const char* FEATURE_TELEPHONY_IMS = "android.hardware.telephony.ims";
 
+static constexpr const char* FEATURE_TELEPHONY_SATELLITE = "android.hardware.telephony.satellite";
+
 #define MODEM_EMERGENCY_CALL_ESTABLISH_TIME 3
 #define MODEM_EMERGENCY_CALL_DISCONNECT_TIME 3
 #define MODEM_SET_SIM_POWER_DELAY_IN_SECONDS 2
diff --git a/radio/aidl/vts/radio_data_test.cpp b/radio/aidl/vts/radio_data_test.cpp
index f38a958..1cc6a36 100644
--- a/radio/aidl/vts/radio_data_test.cpp
+++ b/radio/aidl/vts/radio_data_test.cpp
@@ -143,9 +143,20 @@
 
     TrafficDescriptor trafficDescriptor;
     OsAppId osAppId;
-    std::string osAppIdString("osAppId");
-    std::vector<unsigned char> osAppIdVec(osAppIdString.begin(), osAppIdString.end());
-    osAppId.osAppId = osAppIdVec;
+    osAppId.osAppId = {static_cast<unsigned char>(-105), static_cast<unsigned char>(-92),
+                       static_cast<unsigned char>(-104), static_cast<unsigned char>(-29),
+                       static_cast<unsigned char>(-4),   static_cast<unsigned char>(-110),
+                       static_cast<unsigned char>(92),   static_cast<unsigned char>(-108),
+                       static_cast<unsigned char>(-119), static_cast<unsigned char>(-122),
+                       static_cast<unsigned char>(3),    static_cast<unsigned char>(51),
+                       static_cast<unsigned char>(-48),  static_cast<unsigned char>(110),
+                       static_cast<unsigned char>(78),   static_cast<unsigned char>(71),
+                       static_cast<unsigned char>(10),   static_cast<unsigned char>(69),
+                       static_cast<unsigned char>(78),   static_cast<unsigned char>(84),
+                       static_cast<unsigned char>(69),   static_cast<unsigned char>(82),
+                       static_cast<unsigned char>(80),   static_cast<unsigned char>(82),
+                       static_cast<unsigned char>(73),   static_cast<unsigned char>(83),
+                       static_cast<unsigned char>(69)};
     trafficDescriptor.osAppId = osAppId;
 
     DataProfileInfo dataProfileInfo;
diff --git a/radio/aidl/vts/radio_satellite_indication.cpp b/radio/aidl/vts/radio_satellite_indication.cpp
new file mode 100644
index 0000000..13e4453
--- /dev/null
+++ b/radio/aidl/vts/radio_satellite_indication.cpp
@@ -0,0 +1,56 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "radio_satellite_utils.h"
+
+RadioSatelliteIndication::RadioSatelliteIndication(RadioServiceTest& parent)
+    : parent_satellite(parent) {}
+
+ndk::ScopedAStatus RadioSatelliteIndication::onPendingMessageCount(RadioIndicationType /*type*/,
+                                                                   int32_t /*count*/) {
+    return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioSatelliteIndication::onNewMessages(
+        RadioIndicationType /*type*/, const std::vector<std::string>& /*messages*/) {
+    return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioSatelliteIndication::onMessagesTransferComplete(
+        RadioIndicationType /*type*/, bool /*complete*/) {
+    return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioSatelliteIndication::onSatellitePointingInfoChanged(
+        RadioIndicationType /*type*/, const PointingInfo& /*pointingInfo*/) {
+    return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioSatelliteIndication::onSatelliteModeChanged(RadioIndicationType /*type*/,
+                                                                    SatelliteMode /*mode*/) {
+    return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioSatelliteIndication::onSatelliteRadioTechnologyChanged(
+        RadioIndicationType /*type*/, NTRadioTechnology /*technology*/) {
+    return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioSatelliteIndication::onProvisionStateChanged(
+        RadioIndicationType /*type*/, bool /*provisioned*/,
+        const std::vector<SatelliteFeature>& /*features*/) {
+    return ndk::ScopedAStatus::ok();
+}
diff --git a/radio/aidl/vts/radio_satellite_response.cpp b/radio/aidl/vts/radio_satellite_response.cpp
new file mode 100644
index 0000000..84d57b2
--- /dev/null
+++ b/radio/aidl/vts/radio_satellite_response.cpp
@@ -0,0 +1,120 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "radio_satellite_utils.h"
+
+RadioSatelliteResponse::RadioSatelliteResponse(RadioServiceTest& parent)
+    : parent_satellite(parent) {}
+
+ndk::ScopedAStatus RadioSatelliteResponse::acknowledgeRequest(int32_t /*serial*/) {
+    return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioSatelliteResponse::getCapabilitiesResponse(
+        const RadioResponseInfo& info, const SatelliteCapabilities& /*capabilities*/) {
+    rspInfo = info;
+    parent_satellite.notify(info.serial);
+    return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioSatelliteResponse::setPowerResponse(const RadioResponseInfo& info) {
+    rspInfo = info;
+    parent_satellite.notify(info.serial);
+    return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioSatelliteResponse::getPowerStateResponse(const RadioResponseInfo& info,
+                                                                 bool /*on*/) {
+    rspInfo = info;
+    parent_satellite.notify(info.serial);
+    return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioSatelliteResponse::provisionServiceResponse(const RadioResponseInfo& info,
+                                                                    bool /*provisioned*/) {
+    rspInfo = info;
+    parent_satellite.notify(info.serial);
+    return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioSatelliteResponse::addAllowedSatelliteContactsResponse(
+        const RadioResponseInfo& info) {
+    rspInfo = info;
+    parent_satellite.notify(info.serial);
+    return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioSatelliteResponse::removeAllowedSatelliteContactsResponse(
+        const RadioResponseInfo& info) {
+    rspInfo = info;
+    parent_satellite.notify(info.serial);
+    return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioSatelliteResponse::sendMessagesResponse(const RadioResponseInfo& info) {
+    rspInfo = info;
+    parent_satellite.notify(info.serial);
+    return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioSatelliteResponse::getPendingMessagesResponse(
+        const RadioResponseInfo& info, const std::vector<std::string>& /*messages*/) {
+    rspInfo = info;
+    parent_satellite.notify(info.serial);
+    return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioSatelliteResponse::getSatelliteModeResponse(
+        const RadioResponseInfo& info, SatelliteMode /*mode*/, NTRadioTechnology /*technology*/) {
+    rspInfo = info;
+    parent_satellite.notify(info.serial);
+    return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioSatelliteResponse::setIndicationFilterResponse(
+        const RadioResponseInfo& info) {
+    rspInfo = info;
+    parent_satellite.notify(info.serial);
+    return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioSatelliteResponse::startSendingSatellitePointingInfoResponse(
+        const RadioResponseInfo& info) {
+    rspInfo = info;
+    parent_satellite.notify(info.serial);
+    return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioSatelliteResponse::stopSendingSatellitePointingInfoResponse(
+        const RadioResponseInfo& info) {
+    rspInfo = info;
+    parent_satellite.notify(info.serial);
+    return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioSatelliteResponse::getMaxCharactersPerTextMessageResponse(
+        const RadioResponseInfo& info, int32_t /*charLimit*/) {
+    rspInfo = info;
+    parent_satellite.notify(info.serial);
+    return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioSatelliteResponse::getTimeForNextSatelliteVisibilityResponse(
+        const RadioResponseInfo& info, int32_t /*timeInSeconds*/) {
+    rspInfo = info;
+    parent_satellite.notify(info.serial);
+    return ndk::ScopedAStatus::ok();
+}
\ No newline at end of file
diff --git a/radio/aidl/vts/radio_satellite_test.cpp b/radio/aidl/vts/radio_satellite_test.cpp
new file mode 100644
index 0000000..b0358b3
--- /dev/null
+++ b/radio/aidl/vts/radio_satellite_test.cpp
@@ -0,0 +1,626 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <aidl/android/hardware/radio/config/IRadioConfig.h>
+#include <android-base/logging.h>
+#include <android/binder_manager.h>
+
+#include "radio_satellite_utils.h"
+
+#define ASSERT_OK(ret) ASSERT_TRUE(((ret).isOk()))
+
+void RadioSatelliteTest::SetUp() {
+    std::string serviceName = GetParam();
+
+    if (!isServiceValidForDeviceConfiguration(serviceName)) {
+        ALOGI("Skipped the radio satellite tests due to device configuration.");
+        GTEST_SKIP();
+    }
+
+    satellite = IRadioSatellite::fromBinder(
+            ndk::SpAIBinder(AServiceManager_waitForService(GetParam().c_str())));
+    ASSERT_NE(nullptr, satellite.get());
+
+    rsp_satellite = ndk::SharedRefBase::make<RadioSatelliteResponse>(*this);
+    ASSERT_NE(nullptr, rsp_satellite.get());
+
+    count_ = 0;
+
+    ind_satellite = ndk::SharedRefBase::make<RadioSatelliteIndication>(*this);
+    ASSERT_NE(nullptr, ind_satellite.get());
+
+    satellite->setResponseFunctions(rsp_satellite, ind_satellite);
+
+    // Assert IRadioConfig exists before testing
+    radio_config = config::IRadioConfig::fromBinder(ndk::SpAIBinder(
+            AServiceManager_waitForService("android.hardware.radio.config.IRadioConfig/default")));
+    ASSERT_NE(nullptr, radio_config.get());
+}
+
+/*
+ * Test IRadioSatellite.getCapabilities() for the response returned.
+ */
+TEST_P(RadioSatelliteTest, getCapabilities) {
+    if (!deviceSupportsFeature(FEATURE_TELEPHONY_SATELLITE)) {
+        ALOGI("Skipping getCapabilities because satellite is not supported in device");
+        return;
+    } else {
+        ALOGI("Running getCapabilities because satellite is supported in device");
+    }
+
+    serial = GetRandomSerialNumber();
+    ndk::ScopedAStatus res = satellite->getCapabilities(serial);
+    ASSERT_OK(res);
+    EXPECT_EQ(std::cv_status::no_timeout, wait());
+    EXPECT_EQ(RadioResponseType::SOLICITED, rsp_satellite->rspInfo.type);
+    EXPECT_EQ(serial, rsp_satellite->rspInfo.serial);
+
+    ALOGI("getCapabilities, rspInfo.error = %s\n", toString(rsp_satellite->rspInfo.error).c_str());
+
+    ASSERT_TRUE(CheckAnyOfErrors(
+            rsp_satellite->rspInfo.error,
+            {RadioError::NONE, RadioError::INTERNAL_ERR, RadioError::INVALID_ARGUMENTS,
+             RadioError::INVALID_MODEM_STATE, RadioError::INVALID_SIM_STATE,
+             RadioError::INVALID_STATE, RadioError::MODEM_ERR, RadioError::NO_MEMORY,
+             RadioError::NO_RESOURCES, RadioError::RADIO_NOT_AVAILABLE,
+             RadioError::REQUEST_NOT_SUPPORTED, RadioError::REQUEST_RATE_LIMITED,
+             RadioError::SYSTEM_ERR}));
+}
+
+/*
+ * Test IRadioSatellite.setPower() for the response returned.
+ */
+TEST_P(RadioSatelliteTest, setPower) {
+    if (!deviceSupportsFeature(FEATURE_TELEPHONY_SATELLITE)) {
+        ALOGI("Skipping setPower because satellite is not supported in device");
+        return;
+    } else {
+        ALOGI("Running setPower because satellite is supported in device");
+    }
+
+    serial = GetRandomSerialNumber();
+    ndk::ScopedAStatus res = satellite->setPower(serial, true);
+    ASSERT_OK(res);
+    EXPECT_EQ(std::cv_status::no_timeout, wait());
+    EXPECT_EQ(RadioResponseType::SOLICITED, rsp_satellite->rspInfo.type);
+    EXPECT_EQ(serial, rsp_satellite->rspInfo.serial);
+
+    ALOGI("setPower, rspInfo.error = %s\n", toString(rsp_satellite->rspInfo.error).c_str());
+
+    ASSERT_TRUE(CheckAnyOfErrors(
+            rsp_satellite->rspInfo.error,
+            {RadioError::NONE, RadioError::INTERNAL_ERR, RadioError::INVALID_ARGUMENTS,
+             RadioError::INVALID_MODEM_STATE, RadioError::INVALID_SIM_STATE,
+             RadioError::INVALID_STATE, RadioError::MODEM_ERR, RadioError::NO_MEMORY,
+             RadioError::NO_RESOURCES, RadioError::RADIO_NOT_AVAILABLE,
+             RadioError::REQUEST_NOT_SUPPORTED, RadioError::REQUEST_RATE_LIMITED,
+             RadioError::SYSTEM_ERR}));
+}
+
+/*
+ * Test IRadioSatellite.getPowerSate() for the response returned.
+ */
+TEST_P(RadioSatelliteTest, getPowerSate) {
+    if (!deviceSupportsFeature(FEATURE_TELEPHONY_SATELLITE)) {
+        ALOGI("Skipping getPowerSate because satellite is not supported in device");
+        return;
+    } else {
+        ALOGI("Running getPowerSate because satellite is supported in device");
+    }
+
+    serial = GetRandomSerialNumber();
+    ndk::ScopedAStatus res = satellite->getPowerState(serial);
+    ASSERT_OK(res);
+    EXPECT_EQ(std::cv_status::no_timeout, wait());
+    EXPECT_EQ(RadioResponseType::SOLICITED, rsp_satellite->rspInfo.type);
+    EXPECT_EQ(serial, rsp_satellite->rspInfo.serial);
+
+    ALOGI("getPowerSate, rspInfo.error = %s\n", toString(rsp_satellite->rspInfo.error).c_str());
+
+    ASSERT_TRUE(CheckAnyOfErrors(
+            rsp_satellite->rspInfo.error,
+            {RadioError::NONE, RadioError::INTERNAL_ERR, RadioError::INVALID_ARGUMENTS,
+             RadioError::INVALID_MODEM_STATE, RadioError::INVALID_SIM_STATE,
+             RadioError::INVALID_STATE, RadioError::MODEM_ERR, RadioError::NO_MEMORY,
+             RadioError::NO_RESOURCES, RadioError::RADIO_NOT_AVAILABLE,
+             RadioError::REQUEST_NOT_SUPPORTED, RadioError::REQUEST_RATE_LIMITED,
+             RadioError::SYSTEM_ERR}));
+}
+
+/*
+ * Test IRadioSatellite.provisionService() for the response returned.
+ */
+TEST_P(RadioSatelliteTest, provisionService) {
+    if (!deviceSupportsFeature(FEATURE_TELEPHONY_SATELLITE)) {
+        ALOGI("Skipping provisionService because satellite is not supported in device");
+        return;
+    } else {
+        ALOGI("Running provisionService because satellite is supported in device");
+    }
+
+    serial = GetRandomSerialNumber();
+    std::string imei = "imei";
+    std::string msisdn = "msisdn";
+    std::string imsi = "imsi";
+    const std::vector<SatelliteFeature> features{
+            SatelliteFeature::SOS_SMS, SatelliteFeature::EMERGENCY_SMS, SatelliteFeature::SMS};
+    ndk::ScopedAStatus res = satellite->provisionService(serial, imei, msisdn, imsi, features);
+    ASSERT_OK(res);
+    EXPECT_EQ(std::cv_status::no_timeout, wait());
+    EXPECT_EQ(RadioResponseType::SOLICITED, rsp_satellite->rspInfo.type);
+    EXPECT_EQ(serial, rsp_satellite->rspInfo.serial);
+
+    ALOGI("provisionService, rspInfo.error = %s\n", toString(rsp_satellite->rspInfo.error).c_str());
+
+    ASSERT_TRUE(CheckAnyOfErrors(rsp_satellite->rspInfo.error,
+                                 {RadioError::NONE,
+                                  RadioError::ABORTED,
+                                  RadioError::ACCESS_BARRED,
+                                  RadioError::CANCELLED,
+                                  RadioError::FEATURE_NOT_SUPPORTED,
+                                  RadioError::INTERNAL_ERR,
+                                  RadioError::INVALID_ARGUMENTS,
+                                  RadioError::INVALID_MODEM_STATE,
+                                  RadioError::INVALID_SIM_STATE,
+                                  RadioError::INVALID_STATE,
+                                  RadioError::MODEM_ERR,
+                                  RadioError::MODEM_INCOMPATIBLE,
+                                  RadioError::NETWORK_ERR,
+                                  RadioError::NETWORK_NOT_READY,
+                                  RadioError::NETWORK_REJECT,
+                                  RadioError::NETWORK_TIMEOUT,
+                                  RadioError::NO_MEMORY,
+                                  RadioError::NO_NETWORK_FOUND,
+                                  RadioError::NO_RESOURCES,
+                                  RadioError::NO_SATELLITE_SIGNAL,
+                                  RadioError::NO_SUBSCRIPTION,
+                                  RadioError::OPERATION_NOT_ALLOWED,
+                                  RadioError::RADIO_NOT_AVAILABLE,
+                                  RadioError::RADIO_TECHNOLOGY_NOT_SUPPORTED,
+                                  RadioError::REQUEST_NOT_SUPPORTED,
+                                  RadioError::REQUEST_RATE_LIMITED,
+                                  RadioError::SIM_ABSENT,
+                                  RadioError::SIM_BUSY,
+                                  RadioError::SIM_ERR,
+                                  RadioError::SIM_FULL,
+                                  RadioError::SUBSCRIBER_NOT_AUTHORIZED,
+                                  RadioError::SYSTEM_ERR}));
+}
+
+/*
+ * Test IRadioSatellite.addAllowedSatelliteContacts() for the response returned.
+ */
+TEST_P(RadioSatelliteTest, addAllowedSatelliteContacts) {
+    if (!deviceSupportsFeature(FEATURE_TELEPHONY_SATELLITE)) {
+        ALOGI("Skipping addAllowedSatelliteContacts because satellite is not supported in device");
+        return;
+    } else {
+        ALOGI("Running addAllowedSatelliteContacts because satellite is supported in device");
+    }
+
+    serial = GetRandomSerialNumber();
+    const std::vector<std::string> contacts = {"contact 1", "contact 2"};
+    ndk::ScopedAStatus res = satellite->addAllowedSatelliteContacts(serial, contacts);
+    ASSERT_OK(res);
+    EXPECT_EQ(std::cv_status::no_timeout, wait());
+    EXPECT_EQ(RadioResponseType::SOLICITED, rsp_satellite->rspInfo.type);
+    EXPECT_EQ(serial, rsp_satellite->rspInfo.serial);
+
+    ALOGI("addAllowedSatelliteContacts, rspInfo.error = %s\n",
+          toString(rsp_satellite->rspInfo.error).c_str());
+
+    ASSERT_TRUE(CheckAnyOfErrors(rsp_satellite->rspInfo.error,
+                                 {RadioError::NONE,
+                                  RadioError::ABORTED,
+                                  RadioError::ACCESS_BARRED,
+                                  RadioError::CANCELLED,
+                                  RadioError::INTERNAL_ERR,
+                                  RadioError::INVALID_ARGUMENTS,
+                                  RadioError::INVALID_CONTACT,
+                                  RadioError::INVALID_MODEM_STATE,
+                                  RadioError::INVALID_SIM_STATE,
+                                  RadioError::INVALID_STATE,
+                                  RadioError::MODEM_ERR,
+                                  RadioError::NETWORK_ERR,
+                                  RadioError::NETWORK_NOT_READY,
+                                  RadioError::NETWORK_REJECT,
+                                  RadioError::NETWORK_TIMEOUT,
+                                  RadioError::NO_MEMORY,
+                                  RadioError::NO_NETWORK_FOUND,
+                                  RadioError::NO_RESOURCES,
+                                  RadioError::NO_SATELLITE_SIGNAL,
+                                  RadioError::NO_SUBSCRIPTION,
+                                  RadioError::NOT_SUFFICIENT_ACCOUNT_BALANCE,
+                                  RadioError::OPERATION_NOT_ALLOWED,
+                                  RadioError::RADIO_NOT_AVAILABLE,
+                                  RadioError::REQUEST_NOT_SUPPORTED,
+                                  RadioError::REQUEST_RATE_LIMITED,
+                                  RadioError::SIM_ABSENT,
+                                  RadioError::SIM_BUSY,
+                                  RadioError::SIM_ERR,
+                                  RadioError::SIM_FULL,
+                                  RadioError::SYSTEM_ERR,
+                                  RadioError::UNIDENTIFIED_SUBSCRIBER}));
+}
+
+/*
+ * Test IRadioSatellite.removeAllowedSatelliteContacts() for the response returned.
+ */
+TEST_P(RadioSatelliteTest, removeAllowedSatelliteContacts) {
+    if (!deviceSupportsFeature(FEATURE_TELEPHONY_SATELLITE)) {
+        ALOGI("Skipping removeAllowedSatelliteContacts because satellite is not supported in "
+              "device");
+        return;
+    } else {
+        ALOGI("Running removeAllowedSatelliteContacts because satellite is supported in device");
+    }
+
+    serial = GetRandomSerialNumber();
+    const std::vector<std::string> contacts = {"contact 1", "contact 2"};
+    ndk::ScopedAStatus res = satellite->removeAllowedSatelliteContacts(serial, contacts);
+    ASSERT_OK(res);
+    EXPECT_EQ(std::cv_status::no_timeout, wait());
+    EXPECT_EQ(RadioResponseType::SOLICITED, rsp_satellite->rspInfo.type);
+    EXPECT_EQ(serial, rsp_satellite->rspInfo.serial);
+
+    ALOGI("removeAllowedSatelliteContacts, rspInfo.error = %s\n",
+          toString(rsp_satellite->rspInfo.error).c_str());
+
+    ASSERT_TRUE(CheckAnyOfErrors(rsp_satellite->rspInfo.error,
+                                 {RadioError::NONE,
+                                  RadioError::ABORTED,
+                                  RadioError::ACCESS_BARRED,
+                                  RadioError::CANCELLED,
+                                  RadioError::INTERNAL_ERR,
+                                  RadioError::INVALID_ARGUMENTS,
+                                  RadioError::INVALID_CONTACT,
+                                  RadioError::INVALID_MODEM_STATE,
+                                  RadioError::INVALID_SIM_STATE,
+                                  RadioError::INVALID_STATE,
+                                  RadioError::MODEM_ERR,
+                                  RadioError::NETWORK_ERR,
+                                  RadioError::NETWORK_NOT_READY,
+                                  RadioError::NETWORK_REJECT,
+                                  RadioError::NETWORK_TIMEOUT,
+                                  RadioError::NO_MEMORY,
+                                  RadioError::NO_NETWORK_FOUND,
+                                  RadioError::NO_RESOURCES,
+                                  RadioError::NO_SATELLITE_SIGNAL,
+                                  RadioError::NO_SUBSCRIPTION,
+                                  RadioError::NOT_SUFFICIENT_ACCOUNT_BALANCE,
+                                  RadioError::OPERATION_NOT_ALLOWED,
+                                  RadioError::RADIO_NOT_AVAILABLE,
+                                  RadioError::REQUEST_NOT_SUPPORTED,
+                                  RadioError::REQUEST_RATE_LIMITED,
+                                  RadioError::SIM_ABSENT,
+                                  RadioError::SIM_BUSY,
+                                  RadioError::SIM_ERR,
+                                  RadioError::SIM_FULL,
+                                  RadioError::SYSTEM_ERR,
+                                  RadioError::UNIDENTIFIED_SUBSCRIBER}));
+}
+
+/*
+ * Test IRadioSatellite.sendMessages() for the response returned.
+ */
+TEST_P(RadioSatelliteTest, sendMessages) {
+    if (!deviceSupportsFeature(FEATURE_TELEPHONY_SATELLITE)) {
+        ALOGI("Skipping sendMessages because satellite is not supported in device");
+        return;
+    } else {
+        ALOGI("Running sendMessages because satellite is supported in device");
+    }
+
+    serial = GetRandomSerialNumber();
+    const std::vector<std::string> messages = {"message 1", "message 2"};
+    std::string destination = "0123456789";
+    ndk::ScopedAStatus res = satellite->sendMessages(serial, messages, destination, 1.0, 2.0);
+    ASSERT_OK(res);
+    EXPECT_EQ(std::cv_status::no_timeout, wait());
+    EXPECT_EQ(RadioResponseType::SOLICITED, rsp_satellite->rspInfo.type);
+    EXPECT_EQ(serial, rsp_satellite->rspInfo.serial);
+
+    ALOGI("sendMessages, rspInfo.error = %s\n", toString(rsp_satellite->rspInfo.error).c_str());
+
+    ASSERT_TRUE(CheckAnyOfErrors(rsp_satellite->rspInfo.error,
+                                 {RadioError::NONE,
+                                  RadioError::ABORTED,
+                                  RadioError::ACCESS_BARRED,
+                                  RadioError::BLOCKED_DUE_TO_CALL,
+                                  RadioError::CANCELLED,
+                                  RadioError::ENCODING_ERR,
+                                  RadioError::ENCODING_NOT_SUPPORTED,
+                                  RadioError::INTERNAL_ERR,
+                                  RadioError::INVALID_ARGUMENTS,
+                                  RadioError::INVALID_MODEM_STATE,
+                                  RadioError::INVALID_SIM_STATE,
+                                  RadioError::INVALID_SMS_FORMAT,
+                                  RadioError::INVALID_STATE,
+                                  RadioError::MODEM_ERR,
+                                  RadioError::NETWORK_ERR,
+                                  RadioError::NETWORK_NOT_READY,
+                                  RadioError::NETWORK_REJECT,
+                                  RadioError::NETWORK_TIMEOUT,
+                                  RadioError::NO_MEMORY,
+                                  RadioError::NO_NETWORK_FOUND,
+                                  RadioError::NO_RESOURCES,
+                                  RadioError::NO_SMS_TO_ACK,
+                                  RadioError::NO_SATELLITE_SIGNAL,
+                                  RadioError::NO_SUBSCRIPTION,
+                                  RadioError::NOT_SUFFICIENT_ACCOUNT_BALANCE,
+                                  RadioError::OPERATION_NOT_ALLOWED,
+                                  RadioError::RADIO_NOT_AVAILABLE,
+                                  RadioError::REQUEST_NOT_SUPPORTED,
+                                  RadioError::REQUEST_RATE_LIMITED,
+                                  RadioError::SIM_ABSENT,
+                                  RadioError::SIM_BUSY,
+                                  RadioError::SIM_ERR,
+                                  RadioError::SIM_FULL,
+                                  RadioError::SIMULTANEOUS_SMS_AND_CALL_NOT_ALLOWED,
+                                  RadioError::SMS_SEND_FAIL_RETRY,
+                                  RadioError::SYSTEM_ERR,
+                                  RadioError::SWITCHED_FROM_SATELLITE_TO_TERRESTRIAL,
+                                  RadioError::UNIDENTIFIED_SUBSCRIBER}));
+}
+
+/*
+ * Test IRadioSatellite.getPendingMessages() for the response returned.
+ */
+TEST_P(RadioSatelliteTest, getPendingMessages) {
+    if (!deviceSupportsFeature(FEATURE_TELEPHONY_SATELLITE)) {
+        ALOGI("Skipping getPendingMessages because satellite is not supported in device");
+        return;
+    } else {
+        ALOGI("Running getPendingMessages because satellite is supported in device");
+    }
+
+    serial = GetRandomSerialNumber();
+    ndk::ScopedAStatus res = satellite->getPendingMessages(serial);
+    ASSERT_OK(res);
+    EXPECT_EQ(std::cv_status::no_timeout, wait());
+    EXPECT_EQ(RadioResponseType::SOLICITED, rsp_satellite->rspInfo.type);
+    EXPECT_EQ(serial, rsp_satellite->rspInfo.serial);
+
+    ALOGI("getPendingMessages, rspInfo.error = %s\n",
+          toString(rsp_satellite->rspInfo.error).c_str());
+
+    ASSERT_TRUE(CheckAnyOfErrors(rsp_satellite->rspInfo.error,
+                                 {RadioError::NONE,
+                                  RadioError::ABORTED,
+                                  RadioError::ACCESS_BARRED,
+                                  RadioError::BLOCKED_DUE_TO_CALL,
+                                  RadioError::CANCELLED,
+                                  RadioError::ENCODING_ERR,
+                                  RadioError::ENCODING_NOT_SUPPORTED,
+                                  RadioError::INTERNAL_ERR,
+                                  RadioError::INVALID_ARGUMENTS,
+                                  RadioError::INVALID_MODEM_STATE,
+                                  RadioError::INVALID_SIM_STATE,
+                                  RadioError::INVALID_SMS_FORMAT,
+                                  RadioError::INVALID_STATE,
+                                  RadioError::MODEM_ERR,
+                                  RadioError::NETWORK_ERR,
+                                  RadioError::NETWORK_NOT_READY,
+                                  RadioError::NETWORK_REJECT,
+                                  RadioError::NETWORK_TIMEOUT,
+                                  RadioError::NO_MEMORY,
+                                  RadioError::NO_NETWORK_FOUND,
+                                  RadioError::NO_RESOURCES,
+                                  RadioError::NO_SMS_TO_ACK,
+                                  RadioError::NO_SATELLITE_SIGNAL,
+                                  RadioError::NO_SUBSCRIPTION,
+                                  RadioError::NOT_SUFFICIENT_ACCOUNT_BALANCE,
+                                  RadioError::OPERATION_NOT_ALLOWED,
+                                  RadioError::RADIO_NOT_AVAILABLE,
+                                  RadioError::REQUEST_NOT_SUPPORTED,
+                                  RadioError::REQUEST_RATE_LIMITED,
+                                  RadioError::SIM_ABSENT,
+                                  RadioError::SIM_BUSY,
+                                  RadioError::SIM_ERR,
+                                  RadioError::SIM_FULL,
+                                  RadioError::SIMULTANEOUS_SMS_AND_CALL_NOT_ALLOWED,
+                                  RadioError::SYSTEM_ERR,
+                                  RadioError::SWITCHED_FROM_SATELLITE_TO_TERRESTRIAL}));
+}
+
+/*
+ * Test IRadioSatellite.getSatelliteMode() for the response returned.
+ */
+TEST_P(RadioSatelliteTest, getSatelliteMode) {
+    if (!deviceSupportsFeature(FEATURE_TELEPHONY_SATELLITE)) {
+        ALOGI("Skipping getSatelliteMode because satellite is not supported in device");
+        return;
+    } else {
+        ALOGI("Running getSatelliteMode because satellite is supported in device");
+    }
+
+    serial = GetRandomSerialNumber();
+    ndk::ScopedAStatus res = satellite->getSatelliteMode(serial);
+    ASSERT_OK(res);
+    EXPECT_EQ(std::cv_status::no_timeout, wait());
+    EXPECT_EQ(RadioResponseType::SOLICITED, rsp_satellite->rspInfo.type);
+    EXPECT_EQ(serial, rsp_satellite->rspInfo.serial);
+
+    ALOGI("getSatelliteMode, rspInfo.error = %s\n", toString(rsp_satellite->rspInfo.error).c_str());
+
+    ASSERT_TRUE(CheckAnyOfErrors(
+            rsp_satellite->rspInfo.error,
+            {RadioError::NONE, RadioError::INTERNAL_ERR, RadioError::INVALID_ARGUMENTS,
+             RadioError::INVALID_MODEM_STATE, RadioError::INVALID_SIM_STATE,
+             RadioError::INVALID_STATE, RadioError::MODEM_ERR, RadioError::NO_MEMORY,
+             RadioError::NO_RESOURCES, RadioError::RADIO_NOT_AVAILABLE,
+             RadioError::REQUEST_NOT_SUPPORTED, RadioError::REQUEST_RATE_LIMITED,
+             RadioError::SYSTEM_ERR}));
+}
+
+/*
+ * Test IRadioSatellite.setIndicationFilter() for the response returned.
+ */
+TEST_P(RadioSatelliteTest, setIndicationFilter) {
+    if (!deviceSupportsFeature(FEATURE_TELEPHONY_SATELLITE)) {
+        ALOGI("Skipping setIndicationFilter because satellite is not supported in device");
+        return;
+    } else {
+        ALOGI("Running setIndicationFilter because satellite is supported in device");
+    }
+
+    serial = GetRandomSerialNumber();
+    ndk::ScopedAStatus res = satellite->setIndicationFilter(serial, 0);
+    ASSERT_OK(res);
+    EXPECT_EQ(std::cv_status::no_timeout, wait());
+    EXPECT_EQ(RadioResponseType::SOLICITED, rsp_satellite->rspInfo.type);
+    EXPECT_EQ(serial, rsp_satellite->rspInfo.serial);
+
+    ALOGI("setIndicationFilter, rspInfo.error = %s\n",
+          toString(rsp_satellite->rspInfo.error).c_str());
+
+    ASSERT_TRUE(CheckAnyOfErrors(
+            rsp_satellite->rspInfo.error,
+            {RadioError::NONE, RadioError::INTERNAL_ERR, RadioError::INVALID_ARGUMENTS,
+             RadioError::INVALID_MODEM_STATE, RadioError::INVALID_SIM_STATE,
+             RadioError::INVALID_STATE, RadioError::MODEM_ERR, RadioError::NO_MEMORY,
+             RadioError::NO_RESOURCES, RadioError::RADIO_NOT_AVAILABLE,
+             RadioError::REQUEST_NOT_SUPPORTED, RadioError::REQUEST_RATE_LIMITED,
+             RadioError::SYSTEM_ERR}));
+}
+
+/*
+ * Test IRadioSatellite.startSendingSatellitePointingInfo() for the response returned.
+ */
+TEST_P(RadioSatelliteTest, startSendingSatellitePointingInfo) {
+    if (!deviceSupportsFeature(FEATURE_TELEPHONY_SATELLITE)) {
+        ALOGI("Skipping startSendingSatellitePointingInfo because satellite is not supported in "
+              "device");
+        return;
+    } else {
+        ALOGI("Running startSendingSatellitePointingInfo because satellite is supported in device");
+    }
+
+    serial = GetRandomSerialNumber();
+    ndk::ScopedAStatus res = satellite->startSendingSatellitePointingInfo(serial);
+    ASSERT_OK(res);
+    EXPECT_EQ(std::cv_status::no_timeout, wait());
+    EXPECT_EQ(RadioResponseType::SOLICITED, rsp_satellite->rspInfo.type);
+    EXPECT_EQ(serial, rsp_satellite->rspInfo.serial);
+
+    ALOGI("startSendingSatellitePointingInfo, rspInfo.error = %s\n",
+          toString(rsp_satellite->rspInfo.error).c_str());
+
+    ASSERT_TRUE(CheckAnyOfErrors(
+            rsp_satellite->rspInfo.error,
+            {RadioError::NONE, RadioError::INTERNAL_ERR, RadioError::INVALID_ARGUMENTS,
+             RadioError::INVALID_MODEM_STATE, RadioError::INVALID_SIM_STATE,
+             RadioError::INVALID_STATE, RadioError::MODEM_ERR, RadioError::NO_MEMORY,
+             RadioError::NO_RESOURCES, RadioError::RADIO_NOT_AVAILABLE,
+             RadioError::REQUEST_NOT_SUPPORTED, RadioError::REQUEST_RATE_LIMITED,
+             RadioError::SYSTEM_ERR}));
+}
+
+/*
+ * Test IRadioSatellite.stopSatelliteLocationUpdate() for the response returned.
+ */
+TEST_P(RadioSatelliteTest, stopSatelliteLocationUpdate) {
+    if (!deviceSupportsFeature(FEATURE_TELEPHONY_SATELLITE)) {
+        ALOGI("Skipping stopSendingSatellitePointingInfo because satellite is not supported in "
+              "device");
+        return;
+    } else {
+        ALOGI("Running stopSendingSatellitePointingInfo because satellite is supported in device");
+    }
+
+    serial = GetRandomSerialNumber();
+    ndk::ScopedAStatus res = satellite->stopSendingSatellitePointingInfo(serial);
+    ASSERT_OK(res);
+    EXPECT_EQ(std::cv_status::no_timeout, wait());
+    EXPECT_EQ(RadioResponseType::SOLICITED, rsp_satellite->rspInfo.type);
+    EXPECT_EQ(serial, rsp_satellite->rspInfo.serial);
+
+    ALOGI("stopSendingSatellitePointingInfo, rspInfo.error = %s\n",
+          toString(rsp_satellite->rspInfo.error).c_str());
+
+    ASSERT_TRUE(CheckAnyOfErrors(
+            rsp_satellite->rspInfo.error,
+            {RadioError::NONE, RadioError::INTERNAL_ERR, RadioError::INVALID_ARGUMENTS,
+             RadioError::INVALID_MODEM_STATE, RadioError::INVALID_SIM_STATE,
+             RadioError::INVALID_STATE, RadioError::MODEM_ERR, RadioError::NO_MEMORY,
+             RadioError::NO_RESOURCES, RadioError::RADIO_NOT_AVAILABLE,
+             RadioError::REQUEST_NOT_SUPPORTED, RadioError::REQUEST_RATE_LIMITED,
+             RadioError::SYSTEM_ERR}));
+}
+
+/*
+ * Test IRadioSatellite.getMaxCharactersPerTextMessage() for the response returned.
+ */
+TEST_P(RadioSatelliteTest, getMaxCharactersPerTextMessage) {
+    if (!deviceSupportsFeature(FEATURE_TELEPHONY_SATELLITE)) {
+        ALOGI("Skipping getMaxCharactersPerTextMessage because satellite is not supported in "
+              "device");
+        return;
+    } else {
+        ALOGI("Running getMaxCharactersPerTextMessage because satellite is supported in device");
+    }
+
+    serial = GetRandomSerialNumber();
+    ndk::ScopedAStatus res = satellite->getMaxCharactersPerTextMessage(serial);
+    ASSERT_OK(res);
+    EXPECT_EQ(std::cv_status::no_timeout, wait());
+    EXPECT_EQ(RadioResponseType::SOLICITED, rsp_satellite->rspInfo.type);
+    EXPECT_EQ(serial, rsp_satellite->rspInfo.serial);
+
+    ALOGI("getMaxCharactersPerTextMessage, rspInfo.error = %s\n",
+          toString(rsp_satellite->rspInfo.error).c_str());
+
+    ASSERT_TRUE(CheckAnyOfErrors(
+            rsp_satellite->rspInfo.error,
+            {RadioError::NONE, RadioError::INTERNAL_ERR, RadioError::INVALID_ARGUMENTS,
+             RadioError::INVALID_MODEM_STATE, RadioError::INVALID_SIM_STATE,
+             RadioError::INVALID_STATE, RadioError::MODEM_ERR, RadioError::NO_MEMORY,
+             RadioError::NO_RESOURCES, RadioError::RADIO_NOT_AVAILABLE,
+             RadioError::REQUEST_NOT_SUPPORTED, RadioError::REQUEST_RATE_LIMITED,
+             RadioError::SYSTEM_ERR}));
+}
+
+/*
+ * Test IRadioSatellite.getTimeForNextSatelliteVisibility() for the response returned.
+ */
+TEST_P(RadioSatelliteTest, getTimeForNextSatelliteVisibility) {
+    if (!deviceSupportsFeature(FEATURE_TELEPHONY_SATELLITE)) {
+        ALOGI("Skipping getTimeForNextSatelliteVisibility because satellite is not supported in "
+              "device");
+        return;
+    } else {
+        ALOGI("Running getTimeForNextSatelliteVisibility because satellite is supported in device");
+    }
+
+    serial = GetRandomSerialNumber();
+    ndk::ScopedAStatus res = satellite->getTimeForNextSatelliteVisibility(serial);
+    ASSERT_OK(res);
+    EXPECT_EQ(std::cv_status::no_timeout, wait());
+    EXPECT_EQ(RadioResponseType::SOLICITED, rsp_satellite->rspInfo.type);
+    EXPECT_EQ(serial, rsp_satellite->rspInfo.serial);
+
+    ALOGI("getTimeForNextSatelliteVisibility, rspInfo.error = %s\n",
+          toString(rsp_satellite->rspInfo.error).c_str());
+
+    ASSERT_TRUE(CheckAnyOfErrors(
+            rsp_satellite->rspInfo.error,
+            {RadioError::NONE, RadioError::INTERNAL_ERR, RadioError::INVALID_ARGUMENTS,
+             RadioError::INVALID_MODEM_STATE, RadioError::INVALID_SIM_STATE,
+             RadioError::INVALID_STATE, RadioError::MODEM_ERR, RadioError::NO_MEMORY,
+             RadioError::NO_RESOURCES, RadioError::RADIO_NOT_AVAILABLE,
+             RadioError::REQUEST_NOT_SUPPORTED, RadioError::REQUEST_RATE_LIMITED,
+             RadioError::SYSTEM_ERR}));
+}
\ No newline at end of file
diff --git a/radio/aidl/vts/radio_satellite_utils.h b/radio/aidl/vts/radio_satellite_utils.h
new file mode 100644
index 0000000..2b07ec5
--- /dev/null
+++ b/radio/aidl/vts/radio_satellite_utils.h
@@ -0,0 +1,126 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+#include <aidl/android/hardware/radio/satellite/BnRadioSatelliteIndication.h>
+#include <aidl/android/hardware/radio/satellite/BnRadioSatelliteResponse.h>
+#include <aidl/android/hardware/radio/satellite/IRadioSatellite.h>
+
+#include "radio_aidl_hal_utils.h"
+
+using namespace aidl::android::hardware::radio::satellite;
+
+class RadioSatelliteTest;
+
+/* Callback class for Satellite response */
+class RadioSatelliteResponse : public BnRadioSatelliteResponse {
+  protected:
+    RadioServiceTest& parent_satellite;
+
+  public:
+    RadioSatelliteResponse(RadioServiceTest& parent_satellite);
+    virtual ~RadioSatelliteResponse() = default;
+
+    RadioResponseInfo rspInfo;
+
+    virtual ndk::ScopedAStatus acknowledgeRequest(int32_t serial) override;
+
+    virtual ndk::ScopedAStatus getCapabilitiesResponse(
+            const RadioResponseInfo& info, const SatelliteCapabilities& capabilities) override;
+
+    virtual ndk::ScopedAStatus setPowerResponse(const RadioResponseInfo& info) override;
+
+    virtual ndk::ScopedAStatus getPowerStateResponse(const RadioResponseInfo& info,
+                                                     bool on) override;
+
+    virtual ndk::ScopedAStatus provisionServiceResponse(const RadioResponseInfo& info,
+                                                        bool provisioned) override;
+
+    virtual ndk::ScopedAStatus addAllowedSatelliteContactsResponse(
+            const RadioResponseInfo& info) override;
+
+    virtual ndk::ScopedAStatus removeAllowedSatelliteContactsResponse(
+            const RadioResponseInfo& info) override;
+
+    virtual ndk::ScopedAStatus sendMessagesResponse(const RadioResponseInfo& info) override;
+
+    virtual ndk::ScopedAStatus getPendingMessagesResponse(
+            const RadioResponseInfo& info, const std::vector<std::string>& /*messages*/) override;
+
+    virtual ndk::ScopedAStatus getSatelliteModeResponse(
+            const RadioResponseInfo& info, SatelliteMode mode,
+            satellite::NTRadioTechnology technology) override;
+
+    virtual ndk::ScopedAStatus setIndicationFilterResponse(const RadioResponseInfo& info) override;
+
+    virtual ndk::ScopedAStatus startSendingSatellitePointingInfoResponse(
+            const RadioResponseInfo& info) override;
+
+    virtual ndk::ScopedAStatus stopSendingSatellitePointingInfoResponse(
+            const RadioResponseInfo& info) override;
+
+    virtual ndk::ScopedAStatus getMaxCharactersPerTextMessageResponse(const RadioResponseInfo& info,
+                                                                      int32_t charLimit) override;
+
+    virtual ndk::ScopedAStatus getTimeForNextSatelliteVisibilityResponse(
+            const RadioResponseInfo& info, int32_t timeInSeconds) override;
+};
+
+/* Callback class for Satellite indication */
+class RadioSatelliteIndication : public BnRadioSatelliteIndication {
+  protected:
+    RadioServiceTest& parent_satellite;
+
+  public:
+    RadioSatelliteIndication(RadioServiceTest& parent_satellite);
+    virtual ~RadioSatelliteIndication() = default;
+
+    virtual ndk::ScopedAStatus onPendingMessageCount(RadioIndicationType type,
+                                                     int32_t count) override;
+
+    virtual ndk::ScopedAStatus onNewMessages(RadioIndicationType type,
+                                             const std::vector<std::string>& messages) override;
+
+    virtual ndk::ScopedAStatus onMessagesTransferComplete(RadioIndicationType type,
+                                                          bool complete) override;
+
+    virtual ndk::ScopedAStatus onSatellitePointingInfoChanged(
+            RadioIndicationType type, const PointingInfo& pointingInfo) override;
+
+    virtual ndk::ScopedAStatus onSatelliteModeChanged(RadioIndicationType type,
+                                                      SatelliteMode mode) override;
+
+    virtual ndk::ScopedAStatus onSatelliteRadioTechnologyChanged(
+            RadioIndicationType type, satellite::NTRadioTechnology technology) override;
+
+    virtual ndk::ScopedAStatus onProvisionStateChanged(
+            RadioIndicationType type, bool provisioned,
+            const std::vector<SatelliteFeature>& features) override;
+};
+
+// The main test class for AIDL Satellite.
+class RadioSatelliteTest : public ::testing::TestWithParam<std::string>, public RadioServiceTest {
+  public:
+    virtual void SetUp() override;
+
+    /* Radio Satellite service handle */
+    std::shared_ptr<IRadioSatellite> satellite;
+    /* Radio Satellite response handle */
+    std::shared_ptr<RadioSatelliteResponse> rsp_satellite;
+    /* Radio Satellite indication handle */
+    std::shared_ptr<RadioSatelliteIndication> ind_satellite;
+};
diff --git a/scripts/anapic_hidl2aidl_review.sh b/scripts/anapic_hidl2aidl_review.sh
new file mode 100755
index 0000000..330ae32
--- /dev/null
+++ b/scripts/anapic_hidl2aidl_review.sh
@@ -0,0 +1,27 @@
+#!/bin/bash
+
+if [[ $# -ne 1 ]]; then
+    echo "Usage: $0 INTERFACE_NAME"
+    echo "- INTERFACE_NAME fully qualified HIDL interface name with version"
+    echo "example of creating the diffs for android.hardware.boot@1.2"
+    echo "$ ./anapic_hidl2aidl_review.sh android.hardware.boot@1.2"
+    exit 1
+fi
+
+# for pathmod
+source ${ANDROID_BUILD_TOP}/build/make/envsetup.sh
+
+set -ex
+type hidl2aidl 2>/dev/null || m hidl2aidl
+
+INTERFACE_NAME_NO_VER=${1%@*}
+pushd $(pathmod $INTERFACE_NAME_NO_VER)
+rm -rf android
+hidl2aidl -o . "$1"
+rm -rf conversion.log translate include
+git add -A
+git commit -am "convert $1" --no-edit
+git revert HEAD --no-edit
+git commit --amend --no-edit
+repo upload . --no-verify
+popd
diff --git a/secure_element/aidl/android/hardware/secure_element/ISecureElement.aidl b/secure_element/aidl/android/hardware/secure_element/ISecureElement.aidl
index 7c5a704..b9ce9d1 100644
--- a/secure_element/aidl/android/hardware/secure_element/ISecureElement.aidl
+++ b/secure_element/aidl/android/hardware/secure_element/ISecureElement.aidl
@@ -113,7 +113,8 @@
      * Reset the Secure Element.
      *
      * HAL should trigger reset to the secure element. It could hardware power cycle or
-     * a soft reset depends on the hardware design.
+     * a soft reset depends on the hardware design. All channels opened are
+     * closed by this operation.
      * HAL service must send onStateChange() with connected equal to true
      * after resetting and all the re-initialization has been successfully completed.
      */
diff --git a/secure_element/aidl/default/main.cpp b/secure_element/aidl/default/main.cpp
index 9b5a8fc..6149eae 100644
--- a/secure_element/aidl/default/main.cpp
+++ b/secure_element/aidl/default/main.cpp
@@ -418,29 +418,37 @@
                                      test_applet});
     }
 
-    ScopedAStatus init(const std::shared_ptr<ISecureElementCallback>& clientCallback) override {
-        LOG(INFO) << __func__ << " callback: " << clientCallback.get();
-        if (!clientCallback) {
+    ScopedAStatus init(const std::shared_ptr<ISecureElementCallback>& client_callback) override {
+        LOG(INFO) << __func__ << " callback: " << client_callback.get();
+        if (client_callback == nullptr) {
             return ScopedAStatus::fromExceptionCode(EX_NULL_POINTER);
         }
-        client_callback_ = clientCallback;
+        for (auto& channel : channels_) {
+            channel = Channel();
+        }
+        client_callback_ = client_callback;
         client_callback_->onStateChange(true, "init");
         return ScopedAStatus::ok();
     }
 
     ScopedAStatus getAtr(std::vector<uint8_t>* aidl_return) override {
         LOG(INFO) << __func__;
+        if (client_callback_ == nullptr) {
+            return ScopedAStatus::fromExceptionCode(EX_ILLEGAL_STATE);
+        }
         *aidl_return = atr_;
         return ScopedAStatus::ok();
     }
 
     ScopedAStatus reset() override {
         LOG(INFO) << __func__;
-        CHECK(client_callback_ != nullptr) << " init not invoked";
+        if (client_callback_ == nullptr) {
+            return ScopedAStatus::fromExceptionCode(EX_ILLEGAL_STATE);
+        }
         client_callback_->onStateChange(false, "reset");
         client_callback_->onStateChange(true, "reset");
         // All channels are closed after reset.
-        for (auto channel : channels_) {
+        for (auto& channel : channels_) {
             channel = Channel();
         }
         return ScopedAStatus::ok();
@@ -448,6 +456,9 @@
 
     ScopedAStatus isCardPresent(bool* aidl_return) override {
         LOG(INFO) << __func__;
+        if (client_callback_ == nullptr) {
+            return ScopedAStatus::fromExceptionCode(EX_ILLEGAL_STATE);
+        }
         *aidl_return = true;
         return ScopedAStatus::ok();
     }
@@ -456,6 +467,9 @@
                                    std::vector<uint8_t>* aidl_return) override {
         LOG(INFO) << __func__ << " aid: " << HexString(aid.data(), aid.size()) << " (" << aid.size()
                   << ") p2 " << p2;
+        if (client_callback_ == nullptr) {
+            return ScopedAStatus::fromExceptionCode(EX_ILLEGAL_STATE);
+        }
 
         std::vector<uint8_t> select_response;
         std::shared_ptr<se::Applet> applet = nullptr;
@@ -508,6 +522,10 @@
         LOG(INFO) << __func__ << " aid: " << HexString(aid.data(), aid.size()) << " (" << aid.size()
                   << ") p2 " << p2;
 
+        if (client_callback_ == nullptr) {
+            return ScopedAStatus::fromExceptionCode(EX_ILLEGAL_STATE);
+        }
+
         size_t channel_number = 1;
         std::vector<uint8_t> select_response;
         std::shared_ptr<se::Applet> applet = nullptr;
@@ -562,6 +580,10 @@
 
     ScopedAStatus closeChannel(int8_t channel_number) override {
         LOG(INFO) << __func__ << " channel number: " << static_cast<int>(channel_number);
+        if (client_callback_ == nullptr) {
+            return ScopedAStatus::fromExceptionCode(EX_ILLEGAL_STATE);
+        }
+
         // The selected basic or logical channel is not opened.
         if (channel_number >= channels_.size() || !channels_[channel_number].opened) {
             return ScopedAStatus::ok();
@@ -580,6 +602,9 @@
                            std::vector<uint8_t>* aidl_return) override {
         LOG(INFO) << __func__ << " data: " << HexString(data.data(), data.size()) << " ("
                   << data.size() << ")";
+        if (client_callback_ == nullptr) {
+            return ScopedAStatus::fromExceptionCode(EX_ILLEGAL_STATE);
+        }
 
         se::Apdu apdu(data);
         uint8_t channel_number = apdu.get_channel_number();
@@ -648,7 +673,7 @@
 
     // Channel 0 is the basic channel, channels 1-19 are the logical channels.
     std::array<Channel, 20> channels_{};
-    std::shared_ptr<ISecureElementCallback> client_callback_;
+    std::shared_ptr<ISecureElementCallback> client_callback_{nullptr};
 
     // Secure element abstraction.
 
diff --git a/secure_element/aidl/vts/VtsHalSecureElementTargetTest.cpp b/secure_element/aidl/vts/VtsHalSecureElementTargetTest.cpp
index a85a8bc..c265579 100644
--- a/secure_element/aidl/vts/VtsHalSecureElementTargetTest.cpp
+++ b/secure_element/aidl/vts/VtsHalSecureElementTargetTest.cpp
@@ -18,6 +18,7 @@
 #include <aidl/Vintf.h>
 #include <aidl/android/hardware/secure_element/BnSecureElementCallback.h>
 #include <aidl/android/hardware/secure_element/ISecureElement.h>
+#include <android-base/logging.h>
 #include <android/binder_manager.h>
 #include <android/binder_process.h>
 #include <gmock/gmock.h>
@@ -44,10 +45,29 @@
         EXPECT_TRUE(status_impl.isOk()) << status_impl.getDescription(); \
     } while (false)
 
-static const std::vector<uint8_t> kDataApdu = {0x00, 0x08, 0x00, 0x00, 0x00};
-static const std::vector<uint8_t> kAndroidTestAid = {0xA0, 0x00, 0x00, 0x04, 0x76, 0x41,
-                                                     0x6E, 0x64, 0x72, 0x6F, 0x69, 0x64,
-                                                     0x43, 0x54, 0x53, 0x31};
+#define EXPECT_ERR(status)                                                \
+    do {                                                                  \
+        auto status_impl = (status);                                      \
+        EXPECT_FALSE(status_impl.isOk()) << status_impl.getDescription(); \
+    } while (false)
+
+// APDU defined in CTS tests.
+// The applet selected with kSelectableAid will return 256 bytes of data
+// in response.
+static const std::vector<uint8_t> kDataApdu = {
+        0x00, 0x08, 0x00, 0x00, 0x00,
+};
+
+// Selectable test AID defined in CTS tests.
+static const std::vector<uint8_t> kSelectableAid = {
+        0xA0, 0x00, 0x00, 0x04, 0x76, 0x41, 0x6E, 0x64,
+        0x72, 0x6F, 0x69, 0x64, 0x43, 0x54, 0x53, 0x31,
+};
+// Non-selectable test AID defined in CTS tests.
+static const std::vector<uint8_t> kNonSelectableAid = {
+        0xA0, 0x00, 0x00, 0x04, 0x76, 0x41, 0x6E, 0x64,
+        0x72, 0x6F, 0x69, 0x64, 0x43, 0x54, 0x53, 0xFF,
+};
 
 class MySecureElementCallback : public BnSecureElementCallback {
   public:
@@ -75,91 +95,173 @@
 
 class SecureElementAidl : public ::testing::TestWithParam<std::string> {
   public:
-    virtual void SetUp() override {
+    void SetUp() override {
         SpAIBinder binder = SpAIBinder(AServiceManager_waitForService(GetParam().c_str()));
-        se = ISecureElement::fromBinder(binder);
-        ASSERT_NE(se, nullptr);
 
-        cb = SharedRefBase::make<MySecureElementCallback>();
-        EXPECT_OK(se->init(cb));
+        secure_element_ = ISecureElement::fromBinder(binder);
+        ASSERT_NE(secure_element_, nullptr);
 
-        cb->expectCallbackHistory({true});
+        secure_element_callback_ = SharedRefBase::make<MySecureElementCallback>();
+        ASSERT_NE(secure_element_callback_, nullptr);
+
+        EXPECT_OK(secure_element_->init(secure_element_callback_));
+        secure_element_callback_->expectCallbackHistory({true});
     }
 
-    std::shared_ptr<ISecureElement> se;
-    std::shared_ptr<MySecureElementCallback> cb;
+    void TearDown() override {
+        secure_element_ = nullptr;
+        secure_element_callback_ = nullptr;
+    }
+
+    // Call transmit with kDataApdu and the selected channel number.
+    // Return the response sstatus code.
+    uint16_t transmit(uint8_t channel_number) {
+        std::vector<uint8_t> apdu = kDataApdu;
+        std::vector<uint8_t> response;
+
+        // Edit the channel number into the CLA header byte.
+        if (channel_number < 4) {
+            apdu[0] |= channel_number;
+        } else {
+            apdu[0] |= (channel_number - 4) | 0x40;
+        }
+
+        EXPECT_OK(secure_element_->transmit(apdu, &response));
+        EXPECT_GE(response.size(), 2u);
+        uint16_t status =
+                (response[response.size() - 2] << 8) | (response[response.size() - 1] << 0);
+
+        // When the command is successful the response
+        // must contain 256 bytes of data.
+        if (status == 0x9000) {
+            EXPECT_EQ(response.size(), 258);
+        }
+
+        return status;
+    }
+
+    std::shared_ptr<ISecureElement> secure_element_;
+    std::shared_ptr<MySecureElementCallback> secure_element_callback_;
 };
 
+TEST_P(SecureElementAidl, init) {
+    // init(nullptr) shall fail.
+    EXPECT_ERR(secure_element_->init(nullptr));
+
+    // init with a valid callback pointer shall succeed.
+    EXPECT_OK(secure_element_->init(secure_element_callback_));
+    secure_element_callback_->expectCallbackHistory({true, true});
+}
+
+TEST_P(SecureElementAidl, reset) {
+    std::vector<uint8_t> basic_channel_response;
+    LogicalChannelResponse logical_channel_response;
+
+    // reset called after init shall succeed.
+    EXPECT_OK(secure_element_->openBasicChannel(kSelectableAid, 0x00, &basic_channel_response));
+    EXPECT_OK(secure_element_->openLogicalChannel(kSelectableAid, 0x00, &logical_channel_response));
+
+    EXPECT_OK(secure_element_->reset());
+    secure_element_callback_->expectCallbackHistory({true, false, true});
+
+    // All opened channels must be closed.
+    EXPECT_NE(transmit(0), 0x9000);
+    EXPECT_NE(transmit(logical_channel_response.channelNumber), 0x9000);
+}
+
 TEST_P(SecureElementAidl, isCardPresent) {
     bool res = false;
-    EXPECT_OK(se->isCardPresent(&res));
+
+    // isCardPresent called after init shall succeed.
+    EXPECT_OK(secure_element_->isCardPresent(&res));
     EXPECT_TRUE(res);
 }
 
-TEST_P(SecureElementAidl, transmit) {
-    LogicalChannelResponse response;
-    EXPECT_OK(se->openLogicalChannel(kAndroidTestAid, 0x00, &response));
-
-    EXPECT_GE(response.selectResponse.size(), 2u);
-    EXPECT_GE(response.channelNumber, 1);
-
-    std::vector<uint8_t> command = kDataApdu;
-    command[0] |= response.channelNumber;
-
-    std::vector<uint8_t> transmitResponse;
-    EXPECT_OK(se->transmit(command, &transmitResponse));
-
-    EXPECT_LE(transmitResponse.size(), 3);
-    EXPECT_GE(transmitResponse.size(), 2);
-    EXPECT_EQ(transmitResponse[transmitResponse.size() - 1], 0x00);
-    EXPECT_EQ(transmitResponse[transmitResponse.size() - 2], 0x90);
-
-    EXPECT_OK(se->closeChannel(response.channelNumber));
-}
-
-TEST_P(SecureElementAidl, openBasicChannel) {
-    std::vector<uint8_t> response;
-    auto status = se->openBasicChannel(kAndroidTestAid, 0x00, &response);
-
-    if (!status.isOk()) {
-        EXPECT_EQ(status.getServiceSpecificError(), ISecureElement::CHANNEL_NOT_AVAILABLE)
-                << status.getDescription();
-        return;
-    }
-
-    EXPECT_GE(response.size(), 2u);
-    EXPECT_OK(se->closeChannel(0));
-}
-
 TEST_P(SecureElementAidl, getAtr) {
     std::vector<uint8_t> atr;
-    EXPECT_OK(se->getAtr(&atr));
-    if (atr.size() == 0) {
-        return;
-    }
+
+    // getAtr called after init shall succeed.
+    // The ATR has size between 0 and 32 bytes.
+    EXPECT_OK(secure_element_->getAtr(&atr));
     EXPECT_LE(atr.size(), 32u);
-    EXPECT_GE(atr.size(), 1u);
 }
 
-TEST_P(SecureElementAidl, openCloseLogicalChannel) {
+TEST_P(SecureElementAidl, openBasicChannel) {
+    std::vector<uint8_t> response;
+
+    // openBasicChannel called with an invalid AID shall fail.
+    EXPECT_ERR(secure_element_->openBasicChannel(kNonSelectableAid, 0x00, &response));
+
+    // openBasicChannel called after init shall succeed.
+    // The response size must be larger than 2 bytes as it includes the
+    // status code.
+    EXPECT_OK(secure_element_->openBasicChannel(kSelectableAid, 0x00, &response));
+    EXPECT_GE(response.size(), 2u);
+
+    // tramsmit called on the basic channel should succeed.
+    EXPECT_EQ(transmit(0), 0x9000);
+
+    // openBasicChannel called a second time shall fail.
+    // The basic channel can only be opened once.
+    EXPECT_ERR(secure_element_->openBasicChannel(kSelectableAid, 0x00, &response));
+
+    // openBasicChannel called after closing the basic channel shall succeed.
+    EXPECT_OK(secure_element_->closeChannel(0));
+    EXPECT_OK(secure_element_->openBasicChannel(kSelectableAid, 0x00, &response));
+}
+
+TEST_P(SecureElementAidl, openLogicalChannel) {
     LogicalChannelResponse response;
-    EXPECT_OK(se->openLogicalChannel(kAndroidTestAid, 0x00, &response));
+
+    // openLogicalChannel called with an invalid AID shall fail.
+    EXPECT_ERR(secure_element_->openLogicalChannel(kNonSelectableAid, 0x00, &response));
+
+    // openLogicalChannel called after init shall succeed.
+    // The response size must be larger than 2 bytes as it includes the
+    // status code. The channel number must be in the range 1-19.
+    EXPECT_OK(secure_element_->openLogicalChannel(kSelectableAid, 0x00, &response));
     EXPECT_GE(response.selectResponse.size(), 2u);
-    EXPECT_GE(response.channelNumber, 1);
-    EXPECT_OK(se->closeChannel(response.channelNumber));
+    EXPECT_GE(response.channelNumber, 1u);
+    EXPECT_LE(response.channelNumber, 19u);
+
+    // tramsmit called on the logical channel should succeed.
+    EXPECT_EQ(transmit(response.channelNumber), 0x9000);
 }
 
-TEST_P(SecureElementAidl, openInvalidAid) {
-    LogicalChannelResponse response;
-    auto status = se->openLogicalChannel({0x42}, 0x00, &response);
-    EXPECT_EQ(status.getServiceSpecificError(), ISecureElement::NO_SUCH_ELEMENT_ERROR)
-            << status.getDescription();
+TEST_P(SecureElementAidl, closeChannel) {
+    std::vector<uint8_t> basic_channel_response;
+    LogicalChannelResponse logical_channel_response;
+
+    // closeChannel called on non-existing basic or logical channel is a no-op
+    // and shall succeed.
+    EXPECT_OK(secure_element_->closeChannel(0));
+    EXPECT_OK(secure_element_->closeChannel(1));
+
+    // closeChannel called on basic channel closes the basic channel.
+    EXPECT_OK(secure_element_->openBasicChannel(kSelectableAid, 0x00, &basic_channel_response));
+    EXPECT_OK(secure_element_->closeChannel(0));
+
+    // tramsmit called on the basic channel should fail.
+    EXPECT_NE(transmit(0), 0x9000);
+
+    // closeChannel called on logical channel closes the logical channel.
+    EXPECT_OK(secure_element_->openLogicalChannel(kSelectableAid, 0x00, &logical_channel_response));
+    EXPECT_OK(secure_element_->closeChannel(logical_channel_response.channelNumber));
+
+    // tramsmit called on the basic channel should fail.
+    EXPECT_NE(transmit(logical_channel_response.channelNumber), 0x9000);
 }
 
-TEST_P(SecureElementAidl, Reset) {
-    cb->expectCallbackHistory({true});
-    EXPECT_OK(se->reset());
-    cb->expectCallbackHistory({true, false, true});
+TEST_P(SecureElementAidl, transmit) {
+    std::vector<uint8_t> response;
+
+    // transmit called after init shall succeed.
+    // Note: no channel is opened for this test and the transmit
+    // response will have the status SW_LOGICAL_CHANNEL_NOT_SUPPORTED.
+    // The transmit response shall be larger than 2 bytes as it includes the
+    // status code.
+    EXPECT_OK(secure_element_->transmit(kDataApdu, &response));
+    EXPECT_GE(response.size(), 2u);
 }
 
 GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(SecureElementAidl);
diff --git a/security/OWNERS b/security/OWNERS
index fbaf854..619139b 100644
--- a/security/OWNERS
+++ b/security/OWNERS
@@ -6,9 +6,11 @@
 #
 # This will get them auto-assigned to the on-call triage engineer, ensuring quickest response.
 
+ascull@google.com
 drysdale@google.com
 eranm@google.com
 hasinitg@google.com
 jbires@google.com
+sethmo@google.com
 swillden@google.com
 zeuthen@google.com
diff --git a/security/keymint/aidl/android/hardware/security/keymint/Tag.aidl b/security/keymint/aidl/android/hardware/security/keymint/Tag.aidl
index 837fc81..d401247 100644
--- a/security/keymint/aidl/android/hardware/security/keymint/Tag.aidl
+++ b/security/keymint/aidl/android/hardware/security/keymint/Tag.aidl
@@ -885,9 +885,9 @@
 
     /**
      * Tag::ATTESTATION_ID_SECOND_IMEI provides an additional IMEI of one of the radios on the
-     * device to attested key generation/import operations. This field MUST be accompanied by
-     * the Tag::ATTESTATION_ID_IMEI tag. It would only be used to convery a second IMEI the device
-     * has, after Tag::ATTESTATION_ID_SECOND_IMEI has been used to convery the first IMEI.
+     * device to attested key generation/import operations. It should be used to convey an
+     * IMEI different to the one conveyed by the Tag::ATTESTATION_ID_IMEI tag. Like all other
+     * ID attestation flags, it may be included independently of other tags.
      *
      * If the device does not support ID attestation (or destroyAttestationIds() was previously
      * called and the device can no longer attest its IDs), any key attestation request that
diff --git a/security/keymint/aidl/vts/functional/Android.bp b/security/keymint/aidl/vts/functional/Android.bp
index 88badc7..26e91bd 100644
--- a/security/keymint/aidl/vts/functional/Android.bp
+++ b/security/keymint/aidl/vts/functional/Android.bp
@@ -31,8 +31,11 @@
         "VtsHalTargetTestDefaults",
     ],
     shared_libs: [
+        "libbinder",
         "libbinder_ndk",
         "libcrypto",
+        "libbase",
+        "packagemanager_aidl-cpp",
     ],
     static_libs: [
         "android.hardware.security.rkp-V3-ndk",
diff --git a/security/keymint/aidl/vts/functional/AttestKeyTest.cpp b/security/keymint/aidl/vts/functional/AttestKeyTest.cpp
index ea4ba18..99d2510 100644
--- a/security/keymint/aidl/vts/functional/AttestKeyTest.cpp
+++ b/security/keymint/aidl/vts/functional/AttestKeyTest.cpp
@@ -15,6 +15,8 @@
  */
 
 #define LOG_TAG "keymint_1_attest_key_test"
+#include <android-base/logging.h>
+#include <android-base/strings.h>
 #include <cutils/log.h>
 #include <cutils/properties.h>
 
@@ -26,12 +28,61 @@
 namespace aidl::android::hardware::security::keymint::test {
 
 namespace {
+string TELEPHONY_CMD_GET_IMEI = "cmd phone get-imei ";
 
 bool IsSelfSigned(const vector<Certificate>& chain) {
     if (chain.size() != 1) return false;
     return ChainSignaturesAreValid(chain);
 }
 
+/*
+ * Run a shell command and collect the output of it. If any error, set an empty string as the
+ * output.
+ */
+string exec_command(string command) {
+    char buffer[128];
+    string result = "";
+
+    FILE* pipe = popen(command.c_str(), "r");
+    if (!pipe) {
+        LOG(ERROR) << "popen failed.";
+        return result;
+    }
+
+    // read till end of process:
+    while (!feof(pipe)) {
+        if (fgets(buffer, 128, pipe) != NULL) {
+            result += buffer;
+        }
+    }
+
+    pclose(pipe);
+    return result;
+}
+
+/*
+ * Get IMEI using Telephony service shell command. If any error while executing the command
+ * then empty string will be returned as output.
+ */
+string get_imei(int slot) {
+    string cmd = TELEPHONY_CMD_GET_IMEI + std::to_string(slot);
+    string output = exec_command(cmd);
+
+    if (output.empty()) {
+        LOG(ERROR) << "Command failed. Cmd: " << cmd;
+        return "";
+    }
+
+    vector<string> out = ::android::base::Tokenize(::android::base::Trim(output), "Device IMEI:");
+
+    if (out.size() != 1) {
+        LOG(ERROR) << "Error in parsing the command output. Cmd: " << cmd;
+        return "";
+    }
+
+    return ::android::base::Trim(out[0]);
+}
+
 }  // namespace
 
 class AttestKeyTest : public KeyMintAidlTestBase {
@@ -795,13 +846,44 @@
 
     // Collection of valid attestation ID tags.
     auto attestation_id_tags = AuthorizationSetBuilder();
-    add_tag_from_prop(&attestation_id_tags, TAG_ATTESTATION_ID_BRAND, "ro.product.brand");
+    // Use ro.product.brand_for_attestation property for attestation if it is present else fallback
+    // to ro.product.brand
+    std::string prop_value =
+            ::android::base::GetProperty("ro.product.brand_for_attestation", /* default= */ "");
+    if (!prop_value.empty()) {
+        add_tag_from_prop(&attestation_id_tags, TAG_ATTESTATION_ID_BRAND,
+                          "ro.product.brand_for_attestation");
+    } else {
+        add_tag_from_prop(&attestation_id_tags, TAG_ATTESTATION_ID_BRAND, "ro.product.brand");
+    }
     add_tag_from_prop(&attestation_id_tags, TAG_ATTESTATION_ID_DEVICE, "ro.product.device");
-    add_tag_from_prop(&attestation_id_tags, TAG_ATTESTATION_ID_PRODUCT, "ro.product.name");
+    // Use ro.product.name_for_attestation property for attestation if it is present else fallback
+    // to ro.product.name
+    prop_value = ::android::base::GetProperty("ro.product.name_for_attestation", /* default= */ "");
+    if (!prop_value.empty()) {
+        add_tag_from_prop(&attestation_id_tags, TAG_ATTESTATION_ID_PRODUCT,
+                          "ro.product.name_for_attestation");
+    } else {
+        add_tag_from_prop(&attestation_id_tags, TAG_ATTESTATION_ID_PRODUCT, "ro.product.name");
+    }
     add_tag_from_prop(&attestation_id_tags, TAG_ATTESTATION_ID_SERIAL, "ro.serialno");
     add_tag_from_prop(&attestation_id_tags, TAG_ATTESTATION_ID_MANUFACTURER,
                       "ro.product.manufacturer");
-    add_tag_from_prop(&attestation_id_tags, TAG_ATTESTATION_ID_MODEL, "ro.product.model");
+    // Use ro.product.model_for_attestation property for attestation if it is present else fallback
+    // to ro.product.model
+    prop_value =
+            ::android::base::GetProperty("ro.product.model_for_attestation", /* default= */ "");
+    if (!prop_value.empty()) {
+        add_tag_from_prop(&attestation_id_tags, TAG_ATTESTATION_ID_MODEL,
+                          "ro.product.model_for_attestation");
+    } else {
+        add_tag_from_prop(&attestation_id_tags, TAG_ATTESTATION_ID_MODEL, "ro.product.model");
+    }
+
+    string imei = get_imei(0);
+    if (!imei.empty()) {
+        attestation_id_tags.Authorization(TAG_ATTESTATION_ID_IMEI, imei.data(), imei.size());
+    }
 
     for (const KeyParameter& tag : attestation_id_tags) {
         SCOPED_TRACE(testing::Message() << "+tag-" << tag);
diff --git a/security/keymint/aidl/vts/functional/DeviceUniqueAttestationTest.cpp b/security/keymint/aidl/vts/functional/DeviceUniqueAttestationTest.cpp
index 26dc3f5..55bb5b4 100644
--- a/security/keymint/aidl/vts/functional/DeviceUniqueAttestationTest.cpp
+++ b/security/keymint/aidl/vts/functional/DeviceUniqueAttestationTest.cpp
@@ -249,13 +249,39 @@
 
     // Collection of valid attestation ID tags.
     auto attestation_id_tags = AuthorizationSetBuilder();
-    add_tag_from_prop(&attestation_id_tags, TAG_ATTESTATION_ID_BRAND, "ro.product.brand");
+    // Use ro.product.brand_for_attestation property for attestation if it is present else fallback
+    // to ro.product.brand
+    std::string prop_value =
+            ::android::base::GetProperty("ro.product.brand_for_attestation", /* default= */ "");
+    if (!prop_value.empty()) {
+        add_tag_from_prop(&attestation_id_tags, TAG_ATTESTATION_ID_BRAND,
+                          "ro.product.brand_for_attestation");
+    } else {
+        add_tag_from_prop(&attestation_id_tags, TAG_ATTESTATION_ID_BRAND, "ro.product.brand");
+    }
     add_tag_from_prop(&attestation_id_tags, TAG_ATTESTATION_ID_DEVICE, "ro.product.device");
-    add_tag_from_prop(&attestation_id_tags, TAG_ATTESTATION_ID_PRODUCT, "ro.product.name");
+    // Use ro.product.name_for_attestation property for attestation if it is present else fallback
+    // to ro.product.name
+    prop_value = ::android::base::GetProperty("ro.product.name_for_attestation", /* default= */ "");
+    if (!prop_value.empty()) {
+        add_tag_from_prop(&attestation_id_tags, TAG_ATTESTATION_ID_PRODUCT,
+                          "ro.product.name_for_attestation");
+    } else {
+        add_tag_from_prop(&attestation_id_tags, TAG_ATTESTATION_ID_PRODUCT, "ro.product.name");
+    }
     add_tag_from_prop(&attestation_id_tags, TAG_ATTESTATION_ID_SERIAL, "ro.serialno");
     add_tag_from_prop(&attestation_id_tags, TAG_ATTESTATION_ID_MANUFACTURER,
                       "ro.product.manufacturer");
-    add_tag_from_prop(&attestation_id_tags, TAG_ATTESTATION_ID_MODEL, "ro.product.model");
+    // Use ro.product.model_for_attestation property for attestation if it is present else fallback
+    // to ro.product.model
+    prop_value =
+            ::android::base::GetProperty("ro.product.model_for_attestation", /* default= */ "");
+    if (!prop_value.empty()) {
+        add_tag_from_prop(&attestation_id_tags, TAG_ATTESTATION_ID_MODEL,
+                          "ro.product.model_for_attestation");
+    } else {
+        add_tag_from_prop(&attestation_id_tags, TAG_ATTESTATION_ID_MODEL, "ro.product.model");
+    }
     vector<uint8_t> key_blob;
     vector<KeyCharacteristics> key_characteristics;
 
diff --git a/security/keymint/aidl/vts/functional/KeyBlobUpgradeTest.cpp b/security/keymint/aidl/vts/functional/KeyBlobUpgradeTest.cpp
index c952012..574366e 100644
--- a/security/keymint/aidl/vts/functional/KeyBlobUpgradeTest.cpp
+++ b/security/keymint/aidl/vts/functional/KeyBlobUpgradeTest.cpp
@@ -76,18 +76,14 @@
         "rsa-key",        "p256-key",        "ed25519-key",       "x25519-key",
         "rsa-attest-key", "p256-attest-key", "ed25519-attest-key"};
 
+std::vector<std::string> keyblob_names_tee_no_25519 = {
+        "aes-key", "aes-key-rr", "des-key",        "hmac-key",
+        "rsa-key", "p256-key",   "rsa-attest-key", "p256-attest-key"};
+
 std::vector<std::string> keyblob_names_sb = {"aes-key",        "aes-key-rr",     "des-key",
                                              "hmac-key",       "rsa-key",        "p256-key",
                                              "rsa-attest-key", "p256-attest-key"};
 
-const std::vector<std::string>& keyblob_names(SecurityLevel sec_level) {
-    if (sec_level == SecurityLevel::STRONGBOX) {
-        return keyblob_names_sb;
-    } else {
-        return keyblob_names_tee;
-    }
-}
-
 bool requires_rr(const std::string& name) {
     return name.find("-rr") != std::string::npos;
 }
@@ -194,13 +190,23 @@
 
 class KeyBlobUpgradeTest : public KeyMintAidlTestBase {
   protected:
+    const std::vector<std::string>& keyblob_names() {
+        if (SecLevel() == SecurityLevel::STRONGBOX) {
+            return keyblob_names_sb;
+        } else if (!Curve25519Supported()) {
+            return keyblob_names_tee_no_25519;
+        } else {
+            return keyblob_names_tee;
+        }
+    }
+
     void UpgradeKeyBlobs(bool expectUpgrade) {
         std::string subdir = keyblob_subdir(keyblob_dir, GetParam(), /* create? */ false);
         if (subdir.empty()) {
             GTEST_SKIP() << "No keyblob directory provided";
         }
 
-        for (std::string name : keyblob_names(SecLevel())) {
+        for (std::string name : keyblob_names()) {
             for (bool with_hidden : {false, true}) {
                 std::string app_id;
                 std::string app_data;
@@ -348,7 +354,7 @@
                             .SetDefaultValidity(),
             }};
 
-    for (std::string name : keyblob_names(SecLevel())) {
+    for (std::string name : keyblob_names()) {
         auto entry = keys_info.find(name);
         ASSERT_NE(entry, keys_info.end()) << "no builder for " << name;
         auto builder = entry->second;
@@ -425,7 +431,7 @@
                         "/data/local/tmp/keymint-blobs";
     }
 
-    for (std::string name : keyblob_names(SecLevel())) {
+    for (std::string name : keyblob_names()) {
         for (bool with_hidden : {false, true}) {
             auto builder = AuthorizationSetBuilder();
             if (with_hidden) {
@@ -562,7 +568,7 @@
                         "/data/local/tmp/keymint-blobs";
     }
 
-    for (std::string name : keyblob_names(SecLevel())) {
+    for (std::string name : keyblob_names()) {
         for (bool with_hidden : {false, true}) {
             auto builder = AuthorizationSetBuilder();
             if (with_hidden) {
@@ -588,7 +594,7 @@
             ASSERT_EQ(ErrorCode::OK, DeleteKey(&keyblob));
 
             // Remove all files relating to the deleted key.
-            std::cerr << "Deleting files for deleted key '" << name << ";";
+            std::cerr << "Deleting files for deleted key '" << name << "';\n";
             delete_keyblob(subdir, name);
 
             // Attempting to use the keyblob after deletion should fail.
diff --git a/security/keymint/aidl/vts/functional/KeyMintAidlTestBase.cpp b/security/keymint/aidl/vts/functional/KeyMintAidlTestBase.cpp
index 6c012fa..e9cbe10 100644
--- a/security/keymint/aidl/vts/functional/KeyMintAidlTestBase.cpp
+++ b/security/keymint/aidl/vts/functional/KeyMintAidlTestBase.cpp
@@ -23,6 +23,7 @@
 
 #include <android-base/logging.h>
 #include <android/binder_manager.h>
+#include <android/content/pm/IPackageManagerNative.h>
 #include <cppbor_parse.h>
 #include <cutils/properties.h>
 #include <gmock/gmock.h>
@@ -2048,6 +2049,29 @@
     }
 }
 
+// Check whether the given named feature is available.
+bool check_feature(const std::string& name) {
+    ::android::sp<::android::IServiceManager> sm(::android::defaultServiceManager());
+    ::android::sp<::android::IBinder> binder(sm->getService(::android::String16("package_native")));
+    if (binder == nullptr) {
+        GTEST_LOG_(ERROR) << "getService package_native failed";
+        return false;
+    }
+    ::android::sp<::android::content::pm::IPackageManagerNative> packageMgr =
+            ::android::interface_cast<::android::content::pm::IPackageManagerNative>(binder);
+    if (packageMgr == nullptr) {
+        GTEST_LOG_(ERROR) << "Cannot find package manager";
+        return false;
+    }
+    bool hasFeature = false;
+    auto status = packageMgr->hasSystemFeature(::android::String16(name.c_str()), 0, &hasFeature);
+    if (!status.isOk()) {
+        GTEST_LOG_(ERROR) << "hasSystemFeature('" << name << "') failed: " << status;
+        return false;
+    }
+    return hasFeature;
+}
+
 }  // namespace test
 
 }  // namespace aidl::android::hardware::security::keymint
diff --git a/security/keymint/aidl/vts/functional/KeyMintAidlTestBase.h b/security/keymint/aidl/vts/functional/KeyMintAidlTestBase.h
index 908eeab..fae9459 100644
--- a/security/keymint/aidl/vts/functional/KeyMintAidlTestBase.h
+++ b/security/keymint/aidl/vts/functional/KeyMintAidlTestBase.h
@@ -402,6 +402,7 @@
                         vector<uint8_t>* payload_value);
 void p256_pub_key(const vector<uint8_t>& coseKeyData, EVP_PKEY_Ptr* signingKey);
 void device_id_attestation_vsr_check(const ErrorCode& result);
+bool check_feature(const std::string& name);
 
 AuthorizationSet HwEnforcedAuthorizations(const vector<KeyCharacteristics>& key_characteristics);
 AuthorizationSet SwEnforcedAuthorizations(const vector<KeyCharacteristics>& key_characteristics);
diff --git a/security/keymint/aidl/vts/functional/KeyMintTest.cpp b/security/keymint/aidl/vts/functional/KeyMintTest.cpp
index 2440977..1b9e758 100644
--- a/security/keymint/aidl/vts/functional/KeyMintTest.cpp
+++ b/security/keymint/aidl/vts/functional/KeyMintTest.cpp
@@ -2080,12 +2080,38 @@
 
     // Various ATTESTATION_ID_* tags that map to fields in the attestation extension ASN.1 schema.
     auto extra_tags = AuthorizationSetBuilder();
-    add_tag_from_prop(&extra_tags, TAG_ATTESTATION_ID_BRAND, "ro.product.brand");
+    // Use ro.product.brand_for_attestation property for attestation if it is present else fallback
+    // to ro.product.brand
+    std::string prop_value =
+            ::android::base::GetProperty("ro.product.brand_for_attestation", /* default= */ "");
+    if (!prop_value.empty()) {
+        add_tag_from_prop(&extra_tags, TAG_ATTESTATION_ID_BRAND,
+                          "ro.product.brand_for_attestation");
+    } else {
+        add_tag_from_prop(&extra_tags, TAG_ATTESTATION_ID_BRAND, "ro.product.brand");
+    }
     add_tag_from_prop(&extra_tags, TAG_ATTESTATION_ID_DEVICE, "ro.product.device");
-    add_tag_from_prop(&extra_tags, TAG_ATTESTATION_ID_PRODUCT, "ro.product.name");
+    // Use ro.product.name_for_attestation property for attestation if it is present else fallback
+    // to ro.product.name
+    prop_value = ::android::base::GetProperty("ro.product.name_for_attestation", /* default= */ "");
+    if (!prop_value.empty()) {
+        add_tag_from_prop(&extra_tags, TAG_ATTESTATION_ID_PRODUCT,
+                          "ro.product.name_for_attestation");
+    } else {
+        add_tag_from_prop(&extra_tags, TAG_ATTESTATION_ID_PRODUCT, "ro.product.name");
+    }
     add_tag_from_prop(&extra_tags, TAG_ATTESTATION_ID_SERIAL, "ro.serialno");
     add_tag_from_prop(&extra_tags, TAG_ATTESTATION_ID_MANUFACTURER, "ro.product.manufacturer");
-    add_tag_from_prop(&extra_tags, TAG_ATTESTATION_ID_MODEL, "ro.product.model");
+    // Use ro.product.model_for_attestation property for attestation if it is present else fallback
+    // to ro.product.model
+    prop_value =
+            ::android::base::GetProperty("ro.product.model_for_attestation", /* default= */ "");
+    if (!prop_value.empty()) {
+        add_tag_from_prop(&extra_tags, TAG_ATTESTATION_ID_MODEL,
+                          "ro.product.model_for_attestation");
+    } else {
+        add_tag_from_prop(&extra_tags, TAG_ATTESTATION_ID_MODEL, "ro.product.model");
+    }
 
     for (const KeyParameter& tag : extra_tags) {
         SCOPED_TRACE(testing::Message() << "tag-" << tag);
diff --git a/security/keymint/support/Android.bp b/security/keymint/support/Android.bp
index efd6fc7..1a8695b 100644
--- a/security/keymint/support/Android.bp
+++ b/security/keymint/support/Android.bp
@@ -66,6 +66,9 @@
     static_libs: [
         "android.hardware.security.rkp-V3-ndk",
     ],
+    whole_static_libs: [
+        "libhwtrust_cxx",
+    ],
     shared_libs: [
         "libbase",
         "libbinder_ndk",
@@ -84,6 +87,7 @@
         "android.hardware.security.rkp-V3-ndk",
         "libgmock",
         "libgtest_main",
+        "libkeymint_remote_prov_support",
     ],
     defaults: [
         "keymint_use_latest_hal_aidl_ndk_shared",
@@ -95,6 +99,5 @@
         "libcrypto",
         "libjsoncpp",
         "libkeymaster_portable",
-        "libkeymint_remote_prov_support",
     ],
 }
diff --git a/security/keymint/support/include/remote_prov/remote_prov_utils.h b/security/keymint/support/include/remote_prov/remote_prov_utils.h
index 1b94c62..79189a1 100644
--- a/security/keymint/support/include/remote_prov/remote_prov_utils.h
+++ b/security/keymint/support/include/remote_prov/remote_prov_utils.h
@@ -108,15 +108,6 @@
     bytevec pubKey;
 };
 
-/**
- * Validates the provided CBOR-encoded BCC, returning a vector of BccEntryData
- * structs containing the BCC entry contents.  If an entry contains no firmware
- * digest, the corresponding BccEntryData.firmwareDigest will have length zero
- * (there's no way to distinguish between an empty and missing firmware digest,
- * which seems fine).
- */
-ErrMsgOr<std::vector<BccEntryData>> validateBcc(const cppbor::Array* bcc);
-
 struct JsonOutput {
     static JsonOutput Ok(std::string json) { return {std::move(json), ""}; }
     static JsonOutput Error(std::string error) { return {"", std::move(error)}; }
diff --git a/security/keymint/support/remote_prov_utils.cpp b/security/keymint/support/remote_prov_utils.cpp
index 7e164fd..9620b6a 100644
--- a/security/keymint/support/remote_prov_utils.cpp
+++ b/security/keymint/support/remote_prov_utils.cpp
@@ -24,6 +24,7 @@
 #include <aidl/android/hardware/security/keymint/RpcHardwareInfo.h>
 #include <android-base/properties.h>
 #include <cppbor.h>
+#include <hwtrust/hwtrust.h>
 #include <json/json.h>
 #include <keymaster/km_openssl/ec_key.h>
 #include <keymaster/km_openssl/ecdsa_operation.h>
@@ -289,134 +290,22 @@
     return chain.encode();
 }
 
-ErrMsgOr<bytevec> validatePayloadAndFetchPubKey(const cppbor::Map* payload) {
-    const auto& issuer = payload->get(kBccPayloadIssuer);
-    if (!issuer || !issuer->asTstr()) return "Issuer is not present or not a tstr.";
-    const auto& subject = payload->get(kBccPayloadSubject);
-    if (!subject || !subject->asTstr()) return "Subject is not present or not a tstr.";
-    const auto& keyUsage = payload->get(kBccPayloadKeyUsage);
-    if (!keyUsage || !keyUsage->asBstr()) return "Key usage is not present or not a bstr.";
-    const auto& serializedKey = payload->get(kBccPayloadSubjPubKey);
-    if (!serializedKey || !serializedKey->asBstr()) return "Key is not present or not a bstr.";
-    return serializedKey->asBstr()->value();
-}
-
-ErrMsgOr<bytevec> verifyAndParseCoseSign1Cwt(const cppbor::Array* coseSign1,
-                                             const bytevec& signingCoseKey, const bytevec& aad) {
-    if (!coseSign1 || coseSign1->size() != kCoseSign1EntryCount) {
-        return "Invalid COSE_Sign1";
-    }
-
-    const cppbor::Bstr* protectedParams = coseSign1->get(kCoseSign1ProtectedParams)->asBstr();
-    const cppbor::Map* unprotectedParams = coseSign1->get(kCoseSign1UnprotectedParams)->asMap();
-    const cppbor::Bstr* payload = coseSign1->get(kCoseSign1Payload)->asBstr();
-    const cppbor::Bstr* signature = coseSign1->get(kCoseSign1Signature)->asBstr();
-
-    if (!protectedParams || !unprotectedParams || !payload || !signature) {
-        return "Invalid COSE_Sign1";
-    }
-
-    auto [parsedProtParams, _, errMsg] = cppbor::parse(protectedParams);
-    if (!parsedProtParams) {
-        return errMsg + " when parsing protected params.";
-    }
-    if (!parsedProtParams->asMap()) {
-        return "Protected params must be a map";
-    }
-
-    auto& algorithm = parsedProtParams->asMap()->get(ALGORITHM);
-    if (!algorithm || !algorithm->asInt() ||
-        (algorithm->asInt()->value() != EDDSA && algorithm->asInt()->value() != ES256)) {
-        return "Unsupported signature algorithm";
-    }
-
-    auto [parsedPayload, __, payloadErrMsg] = cppbor::parse(payload);
-    if (!parsedPayload) return payloadErrMsg + " when parsing key";
-    if (!parsedPayload->asMap()) return "CWT must be a map";
-    auto serializedKey = validatePayloadAndFetchPubKey(parsedPayload->asMap());
-    if (!serializedKey) {
-        return "CWT validation failed: " + serializedKey.moveMessage();
-    }
-
-    bool selfSigned = signingCoseKey.empty();
-    bytevec signatureInput =
-        cppbor::Array().add("Signature1").add(*protectedParams).add(aad).add(*payload).encode();
-
-    if (algorithm->asInt()->value() == EDDSA) {
-        auto key = CoseKey::parseEd25519(selfSigned ? *serializedKey : signingCoseKey);
-
-        if (!key) return "Bad signing key: " + key.moveMessage();
-
-        if (!ED25519_verify(signatureInput.data(), signatureInput.size(), signature->value().data(),
-                            key->getBstrValue(CoseKey::PUBKEY_X)->data())) {
-            return "Signature verification failed";
-        }
-    } else {  // P256
-        auto key = CoseKey::parseP256(selfSigned ? *serializedKey : signingCoseKey);
-        if (!key || key->getBstrValue(CoseKey::PUBKEY_X)->empty() ||
-            key->getBstrValue(CoseKey::PUBKEY_Y)->empty()) {
-            return "Bad signing key: " + key.moveMessage();
-        }
-        auto publicKey = key->getEcPublicKey();
-        if (!publicKey) return publicKey.moveMessage();
-
-        auto ecdsaDerSignature = ecdsaCoseSignatureToDer(signature->value());
-        if (!ecdsaDerSignature) return ecdsaDerSignature.moveMessage();
-
-        // convert public key to uncompressed form.
-        publicKey->insert(publicKey->begin(), 0x04);
-
-        if (!verifyEcdsaDigest(publicKey.moveValue(), sha256(signatureInput), *ecdsaDerSignature)) {
-            return "Signature verification failed";
-        }
-    }
-
-    return serializedKey.moveValue();
-}
-
 ErrMsgOr<std::vector<BccEntryData>> validateBcc(const cppbor::Array* bcc) {
-    if (!bcc || bcc->size() == 0) return "Invalid BCC";
-
+    auto encodedBcc = bcc->encode();
+    auto chain = hwtrust::DiceChain::verify(encodedBcc);
+    if (!chain.ok()) return chain.error().message();
+    auto keys = chain->cose_public_keys();
+    if (!keys.ok()) return keys.error().message();
     std::vector<BccEntryData> result;
-
-    const auto& devicePubKey = bcc->get(0);
-    if (!devicePubKey->asMap()) return "Invalid device public key at the 1st entry in the BCC";
-
-    bytevec prevKey;
-
-    for (size_t i = 1; i < bcc->size(); ++i) {
-        const cppbor::Array* entry = bcc->get(i)->asArray();
-        if (!entry || entry->size() != kCoseSign1EntryCount) {
-            return "Invalid BCC entry " + std::to_string(i) + ": " + prettyPrint(entry);
-        }
-        auto payload = verifyAndParseCoseSign1Cwt(entry, std::move(prevKey), bytevec{} /* AAD */);
-        if (!payload) {
-            return "Failed to verify entry " + std::to_string(i) + ": " + payload.moveMessage();
-        }
-
-        auto& certProtParms = entry->get(kCoseSign1ProtectedParams);
-        if (!certProtParms || !certProtParms->asBstr()) return "Invalid prot params";
-        auto [parsedProtParms, _, errMsg] = cppbor::parse(certProtParms->asBstr()->value());
-        if (!parsedProtParms || !parsedProtParms->asMap()) return "Invalid prot params";
-
-        result.push_back(BccEntryData{*payload});
-
-        // This entry's public key is the signing key for the next entry.
-        prevKey = payload.moveValue();
-        if (i == 1) {
-            auto [parsedRootKey, _, errMsg] = cppbor::parse(prevKey);
-            if (!parsedRootKey || !parsedRootKey->asMap()) return "Invalid payload entry in BCC.";
-            if (*parsedRootKey != *devicePubKey) {
-                return "Device public key doesn't match BCC root.";
-            }
-        }
+    for (auto& key : *keys) {
+        result.push_back({std::move(key)});
     }
-
     return result;
 }
 
 JsonOutput jsonEncodeCsrWithBuild(const std::string instance_name, const cppbor::Array& csr) {
     const std::string kFingerprintProp = "ro.build.fingerprint";
+    const std::string kSerialNoProp = "ro.serialno";
 
     if (!::android::base::WaitForPropertyCreation(kFingerprintProp)) {
         return JsonOutput::Error("Unable to read build fingerprint");
@@ -441,6 +330,7 @@
     Json::Value json(Json::objectValue);
     json["name"] = instance_name;
     json["build_fingerprint"] = ::android::base::GetProperty(kFingerprintProp, /*default=*/"");
+    json["serialno"] = ::android::base::GetProperty(kSerialNoProp, /*default=*/"");
     json["csr"] = base64.data();  // Boring writes a NUL-terminated c-string
 
     Json::StreamWriterBuilder factory;
@@ -683,9 +573,6 @@
     if (!bccContents) {
         return bccContents.message() + "\n" + prettyPrint(bcc.get());
     }
-    if (bccContents->size() == 0U) {
-        return "The BCC is empty. It must contain at least one entry.";
-    }
 
     auto deviceInfoResult =
             parseAndValidateDeviceInfo(deviceInfo.deviceInfo, provisionable, isFactory);
@@ -977,9 +864,6 @@
     if (!diceContents) {
         return diceContents.message() + "\n" + prettyPrint(diceCertChain);
     }
-    if (diceContents->size() == 0U) {
-        return "The DICE chain is empty. It must contain at least one entry.";
-    }
 
     auto& udsPub = diceContents->back().pubKey;
 
diff --git a/security/keymint/support/remote_prov_utils_test.cpp b/security/keymint/support/remote_prov_utils_test.cpp
index 0250cd6..eaaba45 100644
--- a/security/keymint/support/remote_prov_utils_test.cpp
+++ b/security/keymint/support/remote_prov_utils_test.cpp
@@ -191,7 +191,8 @@
 
     std::string expected = R"({"build_fingerprint":")" +
                            ::android::base::GetProperty("ro.build.fingerprint", /*default=*/"") +
-                           R"(","csr":"gQE=","name":"test"})";
+                           R"(","csr":"gQE=","name":"test","serialno":")" +
+                           ::android::base::GetProperty("ro.serialno", /*default=*/"") + R"("})";
 
     ASSERT_EQ(json, expected);
 }
diff --git a/security/rkp/CHANGELOG.md b/security/rkp/CHANGELOG.md
index 715cf28..9409a6d 100644
--- a/security/rkp/CHANGELOG.md
+++ b/security/rkp/CHANGELOG.md
@@ -41,6 +41,7 @@
       payload and the implementation-defined payload itself. This is done by creating a typed
       `AuthenticatedRequest<T>` object representing the top level data required to authenticate
       the data provided in the payload, `T`.
+  * The new CSR format supports P-384 signing keys and SHA-384 hashes in the DICE chain.
 * RpcHardwareInfo
   * `supportedNumKeysInCsr` added to report the maximum number of keys supported in a CSR.
   * `supportedEekCurve` is no longer used, due to the removal of the EEK from the scheme.
diff --git a/security/rkp/README.md b/security/rkp/README.md
index 5fb4948..9090ac5 100644
--- a/security/rkp/README.md
+++ b/security/rkp/README.md
@@ -172,31 +172,28 @@
 
 *   ECDSA P-256 for attestation signing keys;
 *   Remote provisioning protocol signing keys:
-  *  Ed25519 / P-256
+  *  Ed25519 / P-256 / P-384
 *   ECDH keys:
   *  X25519 / P-256
 *   AES-GCM for all encryption;
-*   SHA-256 for all message digesting;
-*   HMAC-SHA-256 for all MACing; and
-*   HKDF-SHA-256 for all key derivation.
+*   SHA-256 / SHA-384 / SHA-512 for message digesting;
+*   HMAC with a supported message digest for all MACing; and
+*   HKDF with a supported message digest for all key derivation.
 
 We believe that Curve25519 offers the best tradeoff in terms of security,
 efficiency and global trustworthiness, and that it is now sufficiently
 widely-used and widely-implemented to make it a practical choice.
 
-However, since Secure Elements (SE) do not currently offer support for curve
-25519, we are allowing implementations to instead make use of EC P-256 for
-signing and ECDH. To put it simply, the device unique key pair will be a P-256
-key pair for ECDSA instead of Ed25519, and the ProtectedData COSE\_Encrypt
-message will have its payload encrypted with P-256 ECDH key exchange instead of
-X25519.
+However, since hardware such as Secure Elements (SE) do not currently offer
+support for curve 25519, we are allowing implementations to instead make use of
+ECDSA and ECDH.
 
 The CDDL in the rest of the document will use the '/' operator to show areas
-where either curve 25519 or P-256 may be used. Since there is no easy way to
-bind choices across different CDDL groups, it is important that the implementor
-stays consistent in which type is chosen. E.g. taking ES256 as the choice for
-algorithm implies the implementor should also choose the P256 public key group
-further down in the COSE structure.
+where either curve 25519, P-256 or P-384 may be used. Since there is no easy way
+to bind choices across different CDDL groups, it is important that the
+implementor stays consistent in which type is chosen. E.g. taking ES256 as the
+choice for algorithm implies the implementor should also choose the P256 public
+key group further down in the COSE structure.
 
 ### Testability
 
diff --git a/security/rkp/aidl/android/hardware/security/keymint/IRemotelyProvisionedComponent.aidl b/security/rkp/aidl/android/hardware/security/keymint/IRemotelyProvisionedComponent.aidl
index ff710f1..5bd2145 100644
--- a/security/rkp/aidl/android/hardware/security/keymint/IRemotelyProvisionedComponent.aidl
+++ b/security/rkp/aidl/android/hardware/security/keymint/IRemotelyProvisionedComponent.aidl
@@ -159,18 +159,27 @@
      *        IRemotelyProvisionedComponent must validate the MACs on each key.  If any entry in the
      *        array lacks a valid MAC, the method must return STATUS_INVALID_MAC.
      *
-     *        If testMode is true, the keysToCertify array must contain only keys flagged as test
+     *        If testMode is true, the keysToSign array must contain only keys flagged as test
      *        keys. Otherwise, the method must return STATUS_PRODUCTION_KEY_IN_TEST_REQUEST.
      *
-     *        If testMode is false, the keysToCertify array must not contain any keys flagged as
+     *        If testMode is false, the keysToSign array must not contain any keys flagged as
      *        test keys. Otherwise, the method must return STATUS_TEST_KEY_IN_PRODUCTION_REQUEST.
      *
-     * @param in endpointEncryptionKey contains an X25519 public key which will be used to encrypt
-     *        the BCC. For flexibility, this is represented as a certificate chain, represented as a
-     *        CBOR array of COSE_Sign1 objects, ordered from root to leaf. The leaf contains the
-     *        X25519 encryption key, each other element is an Ed25519 key signing the next in the
-     *        chain. The root is self-signed. An implementor may also choose to use P256 as an
-     *        alternative curve for signing and encryption instead of Curve 25519.
+     * @param in endpointEncryptionKey contains an X25519 or P-256 public key which will be used to
+     *        encrypt the BCC. For flexibility, this is represented as a certificate chain
+     *        in the form of a CBOR array of COSE_Sign1 objects, ordered from root to leaf.  An
+     *        implementor may also choose to use P256 as an alternative curve for signing and
+     *        encryption instead of Curve 25519, as indicated by the supportedEekCurve field in
+     *        RpcHardwareInfo; the contents of the EEK chain will match the specified
+     *        supportedEekCurve.
+     *
+     *        - For CURVE_25519 the leaf contains the X25519 agreement key, each other element is an
+     *          Ed25519 key signing the next in the chain.
+     *
+     *        - For CURVE_P256 the leaf contains the P-256 agreement key, each other element is a
+     *          P-256 key signing the next in the chain.
+     *
+     *        In either case, the root is self-signed.
      *
      *            EekChain = [ + SignedSignatureKey, SignedEek ]
      *
@@ -335,14 +344,14 @@
      *     UdsCerts,
      *     DiceCertChain,
      *     SignedData<[
-     *         challenge: bstr .size (32..64), ; Provided by the method parameters
+     *         challenge: bstr .size (16..64), ; Provided by the method parameters
      *         bstr .cbor T,
      *     ]>,
      * ]
      *
      * ; COSE_Sign1 (untagged)
      * SignedData<Data> = [
-     *     protected: bstr .cbor { 1 : AlgorithmEdDSA / AlgorithmES256 },
+     *     protected: bstr .cbor { 1 : AlgorithmEdDSA / AlgorithmES256 / AlgorithmES384 },
      *     unprotected: {},
      *     payload: bstr .cbor Data / nil,
      *     signature: bstr      ; PureEd25519(CDI_Leaf_Priv, SignedDataSigStruct<Data>) /
@@ -352,7 +361,7 @@
      * ; Sig_structure for SignedData
      * SignedDataSigStruct<Data> = [
      *     context: "Signature1",
-     *     protected: bstr .cbor { 1 : AlgorithmEdDSA / AlgorithmES256 },
+     *     protected: bstr .cbor { 1 : AlgorithmEdDSA / AlgorithmES256 / AlgorithmES384 },
      *     external_aad: bstr .size 0,
      *     payload: bstr .cbor Data / nil,
      * ]
@@ -384,7 +393,7 @@
      * ; after the first describe a link in the boot chain (e.g. bootloaders: BL1, BL2, ... BLN)
      * ; Note that there is no DiceChainEntry for UDS_pub, only a "bare" COSE_key.
      * DiceCertChain = [
-     *     PubKeyEd25519 / PubKeyECDSA256,  ; UDS_Pub
+     *     PubKeyEd25519 / PubKeyECDSA256 / PubKeyECDSA384,  ; UDS_Pub
      *     + DiceChainEntry,                ; First CDI_Certificate -> Last CDI_Certificate
      *                                      ; Last certificate corresponds to KeyMint's DICE key.
      * ]
@@ -392,16 +401,17 @@
      * ; This is the signed payload for each entry in the DICE chain. Note that the "Configuration
      * ; Input Values" described by the Open Profile are not used here. Instead, the DICE chain
      * ; defines its own configuration values for the Configuration Descriptor field. See
-     * ; the Open Profile for DICE for more details on the fields. SHA256 and SHA512 are acceptable
-     * ; hash algorithms. The digest bstr values in the payload are the digest values without any
-     * ; padding. Note that for SHA256, this implies the digest bstr is 32 bytes. This is an
-     * ; intentional, minor deviation from Open Profile for DICE, which specifies all digests are
-     * ; 64 bytes.
+     * ; the Open Profile for DICE for more details on the fields. SHA256, SHA384 and SHA512 are
+     * ; acceptable hash algorithms. The digest bstr values in the payload are the digest values
+     * ; without any padding. Note that this implies that the digest is a 32-byte bstr for SHA256
+     * ; and a 48-byte bstr for SHA384. This is an intentional, minor deviation from Open Profile
+     * ; for DICE, which specifies all digests are 64 bytes.
      * DiceChainEntryPayload = {                    ; CWT [RFC8392]
      *     1 : tstr,                                ; Issuer
      *     2 : tstr,                                ; Subject
      *     -4670552 : bstr .cbor PubKeyEd25519 /
-     *                bstr .cbor PubKeyECDSA256,    ; Subject Public Key
+     *                bstr .cbor PubKeyECDSA256,
+     *                bstr .cbor PubKeyECDSA384,    ; Subject Public Key
      *     -4670553 : bstr                          ; Key Usage
      *
      *     ; NOTE: All of the following fields may be omitted for a "Degenerate DICE Chain", as
@@ -422,7 +432,7 @@
      * ; Each entry in the DICE chain is a DiceChainEntryPayload signed by the key from the previous
      * ; entry in the DICE chain array.
      * DiceChainEntry = [                            ; COSE_Sign1 (untagged)
-     *     protected : bstr .cbor { 1 : AlgorithmEdDSA / AlgorithmES256 },
+     *     protected : bstr .cbor { 1 : AlgorithmEdDSA / AlgorithmES256 / AlgorithmES384 },
      *     unprotected: {},
      *     payload: bstr .cbor DiceChainEntryPayload,
      *     signature: bstr ; PureEd25519(SigningKey, DiceChainEntryInput) /
@@ -433,7 +443,7 @@
      *
      * DiceChainEntryInput = [
      *     context: "Signature1",
-     *     protected: bstr .cbor { 1 : AlgorithmEdDSA / AlgorithmES256 },
+     *     protected: bstr .cbor { 1 : AlgorithmEdDSA / AlgorithmES256 / AlgorithmES384 },
      *     external_aad: bstr .size 0,
      *     payload: bstr .cbor DiceChainEntryPayload
      * ]
@@ -458,7 +468,16 @@
      *     -3 : bstr                    ; Y coordinate, big-endian
      * }
      *
+     * PubKeyECDSA384 = {               ; COSE_Key
+     *     1 : 2,                       ; Key type : EC2
+     *     3 : AlgorithmES384,          ; Algorithm : ECDSA w/ SHA-384
+     *     -1 : 2,                      ; Curve: P384
+     *     -2 : bstr,                   ; X coordinate
+     *     -3 : bstr                    ; Y coordinate
+     * }
+     *
      * AlgorithmES256 = -7
+     * AlgorithmES384 = -35
      * AlgorithmEdDSA = -8
      */
     byte[] generateCertificateRequestV2(in MacedPublicKey[] keysToSign, in byte[] challenge);
diff --git a/security/rkp/aidl/android/hardware/security/keymint/ProtectedData.aidl b/security/rkp/aidl/android/hardware/security/keymint/ProtectedData.aidl
index 3f699bc..57ee8cf 100644
--- a/security/rkp/aidl/android/hardware/security/keymint/ProtectedData.aidl
+++ b/security/rkp/aidl/android/hardware/security/keymint/ProtectedData.aidl
@@ -50,6 +50,8 @@
      *                                     ; salt = null
      *                                     ; info = .cbor Context (see below)
      *                                     ; K = HKDF-SHA-256(ikm, salt, info)
+     *                                     ; AAD for the encryption is a CBOR-serialized
+     *                                     ; Enc_structure (RFC 8152 s5.3) with empty external_aad.
      *         recipients : [
      *             [                       ; COSE_Recipient
      *                 protected : bstr .cbor {
@@ -65,7 +67,10 @@
      *     ]
      *
      *     ; The COSE_KDF_Context that is used to derive the ProtectedData encryption key with
-     *     ; HKDF. See details on use in ProtectedData comments above.
+     *     ; HKDF. See details on use in ProtectedData comments above. The public key data
+     *     ; included in the other field of PartyUInfo / PartyVInfo is encoded as:
+     *     ;  - a raw 32-byte public key for X25519
+     *     ;  - uncompressed SEC-1 coordinate data (0x04 || x || y) for P-256
      *     Context = [
      *         AlgorithmID : 3             ; AES-GCM 256
      *         PartyUInfo : [
@@ -134,11 +139,11 @@
      *     ]
      *
      *     SignedMacAad = [
-     *         challenge : bstr .size (32..64),   ; Size between 32 - 64
+     *         challenge : bstr .size (16..64),   ; Size between 16 - 64
      *                                            ; bytes inclusive
      *         VerifiedDeviceInfo,
      *         tag: bstr                 ; This is the tag from COSE_Mac0 of
-     *                                   ; KeysToCertify, to tie the key set to
+     *                                   ; KeysToSign, to tie the key set to
      *                                   ; the signature.
      *     ]
      *
diff --git a/security/rkp/aidl/vts/functional/VtsRemotelyProvisionedComponentTests.cpp b/security/rkp/aidl/vts/functional/VtsRemotelyProvisionedComponentTests.cpp
index bbda56d..573f10b 100644
--- a/security/rkp/aidl/vts/functional/VtsRemotelyProvisionedComponentTests.cpp
+++ b/security/rkp/aidl/vts/functional/VtsRemotelyProvisionedComponentTests.cpp
@@ -404,6 +404,7 @@
   protected:
     void SetUp() override {
         CertificateRequestTestBase::SetUp();
+        ASSERT_FALSE(HasFatalFailure());
 
         if (rpcHardwareInfo.versionNumber >= VERSION_WITHOUT_TEST_MODE) {
             bytevec keysToSignMac;
@@ -689,6 +690,7 @@
 class CertificateRequestV2Test : public CertificateRequestTestBase {
     void SetUp() override {
         CertificateRequestTestBase::SetUp();
+        ASSERT_FALSE(HasFatalFailure());
 
         if (rpcHardwareInfo.versionNumber < VERSION_WITHOUT_TEST_MODE) {
             GTEST_SKIP() << "This test case only applies to RKP v3 and above. "
diff --git a/tetheroffload/aidl/Android.bp b/tetheroffload/aidl/Android.bp
new file mode 100644
index 0000000..1d80586
--- /dev/null
+++ b/tetheroffload/aidl/Android.bp
@@ -0,0 +1,27 @@
+package {
+    default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
+aidl_interface {
+    name: "android.hardware.tetheroffload",
+    vendor_available: true,
+    srcs: ["android/hardware/tetheroffload/*.aidl"],
+    stability: "vintf",
+    backend: {
+        cpp: {
+            enabled: false,
+        },
+        java: {
+            sdk_version: "module_current",
+            apex_available: [
+                "com.android.tethering",
+            ],
+            min_sdk_version: "30",
+            enabled: true,
+        },
+        ndk: {
+            apps_enabled: false,
+        },
+    },
+    frozen: false,
+}
diff --git a/tetheroffload/aidl/TEST_MAPPING b/tetheroffload/aidl/TEST_MAPPING
new file mode 100644
index 0000000..c6d4c07
--- /dev/null
+++ b/tetheroffload/aidl/TEST_MAPPING
@@ -0,0 +1,7 @@
+{
+  "presubmit" : [
+    {
+      "name": "VtsHalTetheroffloadTargetTest"
+    }
+  ]
+}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/AnbrBitrate.aidl b/tetheroffload/aidl/aidl_api/android.hardware.tetheroffload/current/android/hardware/tetheroffload/ForwardedStats.aidl
similarity index 91%
rename from radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/AnbrBitrate.aidl
rename to tetheroffload/aidl/aidl_api/android.hardware.tetheroffload/current/android/hardware/tetheroffload/ForwardedStats.aidl
index 711ac19..493a698 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/AnbrBitrate.aidl
+++ b/tetheroffload/aidl/aidl_api/android.hardware.tetheroffload/current/android/hardware/tetheroffload/ForwardedStats.aidl
@@ -31,10 +31,9 @@
 // with such a backward incompatible change, it has a high risk of breaking
 // later when a module using the interface is updated, e.g., Mainline modules.
 
-package android.hardware.radio.ims.media;
+package android.hardware.tetheroffload;
 @VintfStability
-parcelable AnbrBitrate {
-  int uplinkBps;
-  int downlinkBps;
-  const int INVALID_ANBR_BITRATE = -1;
+parcelable ForwardedStats {
+  long rxBytes;
+  long txBytes;
 }
diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/AnbrBitrate.aidl b/tetheroffload/aidl/aidl_api/android.hardware.tetheroffload/current/android/hardware/tetheroffload/IOffload.aidl
similarity index 70%
copy from radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/AnbrBitrate.aidl
copy to tetheroffload/aidl/aidl_api/android.hardware.tetheroffload/current/android/hardware/tetheroffload/IOffload.aidl
index 711ac19..9a58b1f 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/AnbrBitrate.aidl
+++ b/tetheroffload/aidl/aidl_api/android.hardware.tetheroffload/current/android/hardware/tetheroffload/IOffload.aidl
@@ -31,10 +31,16 @@
 // with such a backward incompatible change, it has a high risk of breaking
 // later when a module using the interface is updated, e.g., Mainline modules.
 
-package android.hardware.radio.ims.media;
+package android.hardware.tetheroffload;
 @VintfStability
-parcelable AnbrBitrate {
-  int uplinkBps;
-  int downlinkBps;
-  const int INVALID_ANBR_BITRATE = -1;
+interface IOffload {
+  void initOffload(in ParcelFileDescriptor fd1, in ParcelFileDescriptor fd2, in android.hardware.tetheroffload.ITetheringOffloadCallback cb);
+  void stopOffload();
+  void setLocalPrefixes(in String[] prefixes);
+  android.hardware.tetheroffload.ForwardedStats getForwardedStats(in String upstream);
+  void setDataWarningAndLimit(in String upstream, in long warningBytes, in long limitBytes);
+  void setUpstreamParameters(in String iface, in String v4Addr, in String v4Gw, in String[] v6Gws);
+  void addDownstream(in String iface, in String prefix);
+  void removeDownstream(in String iface, in String prefix);
+  const int ERROR_CODE_UNUSED = 0;
 }
diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/AnbrBitrate.aidl b/tetheroffload/aidl/aidl_api/android.hardware.tetheroffload/current/android/hardware/tetheroffload/IPv4AddrPortPair.aidl
similarity index 91%
copy from radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/AnbrBitrate.aidl
copy to tetheroffload/aidl/aidl_api/android.hardware.tetheroffload/current/android/hardware/tetheroffload/IPv4AddrPortPair.aidl
index 711ac19..2b42f0c 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/AnbrBitrate.aidl
+++ b/tetheroffload/aidl/aidl_api/android.hardware.tetheroffload/current/android/hardware/tetheroffload/IPv4AddrPortPair.aidl
@@ -31,10 +31,9 @@
 // with such a backward incompatible change, it has a high risk of breaking
 // later when a module using the interface is updated, e.g., Mainline modules.
 
-package android.hardware.radio.ims.media;
+package android.hardware.tetheroffload;
 @VintfStability
-parcelable AnbrBitrate {
-  int uplinkBps;
-  int downlinkBps;
-  const int INVALID_ANBR_BITRATE = -1;
+parcelable IPv4AddrPortPair {
+  String addr;
+  int port;
 }
diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/AnbrBitrate.aidl b/tetheroffload/aidl/aidl_api/android.hardware.tetheroffload/current/android/hardware/tetheroffload/ITetheringOffloadCallback.aidl
similarity index 86%
copy from radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/AnbrBitrate.aidl
copy to tetheroffload/aidl/aidl_api/android.hardware.tetheroffload/current/android/hardware/tetheroffload/ITetheringOffloadCallback.aidl
index 711ac19..4eb7d04 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/AnbrBitrate.aidl
+++ b/tetheroffload/aidl/aidl_api/android.hardware.tetheroffload/current/android/hardware/tetheroffload/ITetheringOffloadCallback.aidl
@@ -31,10 +31,9 @@
 // with such a backward incompatible change, it has a high risk of breaking
 // later when a module using the interface is updated, e.g., Mainline modules.
 
-package android.hardware.radio.ims.media;
+package android.hardware.tetheroffload;
 @VintfStability
-parcelable AnbrBitrate {
-  int uplinkBps;
-  int downlinkBps;
-  const int INVALID_ANBR_BITRATE = -1;
+interface ITetheringOffloadCallback {
+  oneway void onEvent(in android.hardware.tetheroffload.OffloadCallbackEvent event);
+  oneway void updateTimeout(in android.hardware.tetheroffload.NatTimeoutUpdate params);
 }
diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/AnbrBitrate.aidl b/tetheroffload/aidl/aidl_api/android.hardware.tetheroffload/current/android/hardware/tetheroffload/NatTimeoutUpdate.aidl
similarity index 87%
copy from radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/AnbrBitrate.aidl
copy to tetheroffload/aidl/aidl_api/android.hardware.tetheroffload/current/android/hardware/tetheroffload/NatTimeoutUpdate.aidl
index 711ac19..9eddaa2 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/AnbrBitrate.aidl
+++ b/tetheroffload/aidl/aidl_api/android.hardware.tetheroffload/current/android/hardware/tetheroffload/NatTimeoutUpdate.aidl
@@ -31,10 +31,10 @@
 // with such a backward incompatible change, it has a high risk of breaking
 // later when a module using the interface is updated, e.g., Mainline modules.
 
-package android.hardware.radio.ims.media;
+package android.hardware.tetheroffload;
 @VintfStability
-parcelable AnbrBitrate {
-  int uplinkBps;
-  int downlinkBps;
-  const int INVALID_ANBR_BITRATE = -1;
+parcelable NatTimeoutUpdate {
+  android.hardware.tetheroffload.IPv4AddrPortPair src;
+  android.hardware.tetheroffload.IPv4AddrPortPair dst;
+  android.hardware.tetheroffload.NetworkProtocol proto;
 }
diff --git a/audio/aidl/aidl_api/android.hardware.audio.core/current/android/hardware/audio/core/AudioMode.aidl b/tetheroffload/aidl/aidl_api/android.hardware.tetheroffload/current/android/hardware/tetheroffload/NetworkProtocol.aidl
similarity index 91%
rename from audio/aidl/aidl_api/android.hardware.audio.core/current/android/hardware/audio/core/AudioMode.aidl
rename to tetheroffload/aidl/aidl_api/android.hardware.tetheroffload/current/android/hardware/tetheroffload/NetworkProtocol.aidl
index 336f9b5..52bd2a6 100644
--- a/audio/aidl/aidl_api/android.hardware.audio.core/current/android/hardware/audio/core/AudioMode.aidl
+++ b/tetheroffload/aidl/aidl_api/android.hardware.tetheroffload/current/android/hardware/tetheroffload/NetworkProtocol.aidl
@@ -31,12 +31,9 @@
 // with such a backward incompatible change, it has a high risk of breaking
 // later when a module using the interface is updated, e.g., Mainline modules.
 
-package android.hardware.audio.core;
+package android.hardware.tetheroffload;
 @Backing(type="int") @VintfStability
-enum AudioMode {
-  NORMAL = 0,
-  RINGTONE = 1,
-  IN_CALL = 2,
-  IN_COMMUNICATION = 3,
-  CALL_SCREEN = 4,
+enum NetworkProtocol {
+  TCP = 6,
+  UDP = 17,
 }
diff --git a/audio/aidl/aidl_api/android.hardware.audio.core/current/android/hardware/audio/core/AudioMode.aidl b/tetheroffload/aidl/aidl_api/android.hardware.tetheroffload/current/android/hardware/tetheroffload/OffloadCallbackEvent.aidl
similarity index 86%
copy from audio/aidl/aidl_api/android.hardware.audio.core/current/android/hardware/audio/core/AudioMode.aidl
copy to tetheroffload/aidl/aidl_api/android.hardware.tetheroffload/current/android/hardware/tetheroffload/OffloadCallbackEvent.aidl
index 336f9b5..026e18e 100644
--- a/audio/aidl/aidl_api/android.hardware.audio.core/current/android/hardware/audio/core/AudioMode.aidl
+++ b/tetheroffload/aidl/aidl_api/android.hardware.tetheroffload/current/android/hardware/tetheroffload/OffloadCallbackEvent.aidl
@@ -31,12 +31,13 @@
 // with such a backward incompatible change, it has a high risk of breaking
 // later when a module using the interface is updated, e.g., Mainline modules.
 
-package android.hardware.audio.core;
+package android.hardware.tetheroffload;
 @Backing(type="int") @VintfStability
-enum AudioMode {
-  NORMAL = 0,
-  RINGTONE = 1,
-  IN_CALL = 2,
-  IN_COMMUNICATION = 3,
-  CALL_SCREEN = 4,
+enum OffloadCallbackEvent {
+  OFFLOAD_STARTED = 1,
+  OFFLOAD_STOPPED_ERROR = 2,
+  OFFLOAD_STOPPED_UNSUPPORTED = 3,
+  OFFLOAD_SUPPORT_AVAILABLE = 4,
+  OFFLOAD_STOPPED_LIMIT_REACHED = 5,
+  OFFLOAD_WARNING_REACHED = 6,
 }
diff --git a/radio/aidl/android/hardware/radio/ims/media/MediaProtocolType.aidl b/tetheroffload/aidl/android/hardware/tetheroffload/ForwardedStats.aidl
similarity index 68%
copy from radio/aidl/android/hardware/radio/ims/media/MediaProtocolType.aidl
copy to tetheroffload/aidl/android/hardware/tetheroffload/ForwardedStats.aidl
index 325c6fa..d2fe49b 100644
--- a/radio/aidl/android/hardware/radio/ims/media/MediaProtocolType.aidl
+++ b/tetheroffload/aidl/android/hardware/tetheroffload/ForwardedStats.aidl
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright (C) 2022 The Android Open Source Project
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -14,13 +14,13 @@
  * limitations under the License.
  */
 
-package android.hardware.radio.ims.media;
+package android.hardware.tetheroffload;
 
 @VintfStability
-@Backing(type="int")
-enum MediaProtocolType {
-   /** Real Time Protocol, see RFC 3550 */
-   RTP = 0,
-   /** Real Time Control Protocol, see RFC 3550 */
-   RTCP = 1,
+parcelable ForwardedStats {
+    /**
+     * Tx/Rx forwarded bytes
+     */
+    long rxBytes;
+    long txBytes;
 }
diff --git a/tetheroffload/aidl/android/hardware/tetheroffload/IOffload.aidl b/tetheroffload/aidl/android/hardware/tetheroffload/IOffload.aidl
new file mode 100644
index 0000000..30b2c8d
--- /dev/null
+++ b/tetheroffload/aidl/android/hardware/tetheroffload/IOffload.aidl
@@ -0,0 +1,284 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.tetheroffload;
+
+import android.hardware.tetheroffload.ForwardedStats;
+import android.hardware.tetheroffload.ITetheringOffloadCallback;
+
+/**
+ * Interface used to control tethering offload.
+ */
+@VintfStability
+interface IOffload {
+    /**
+     * Error code for all {@code ServiceSpecificException}s thrown by this interface.
+     */
+    const int ERROR_CODE_UNUSED = 0;
+
+    /**
+     * Indicates intent to start offload for tethering in immediate future.
+     *
+     * This API must be called exactly once the first time that Tethering is requested by
+     * the user.
+     *
+     * If this API is called multiple times without first calling stopOffload, then the subsequent
+     * calls must fail without changing the state of the server.
+     *
+     * If for some reason, the hardware is currently unable to support offload, this call must fail.
+     *
+     * @param fd1 A file descriptor bound to the following netlink groups
+     *            (NF_NETLINK_CONNTRACK_NEW | NF_NETLINK_CONNTRACK_DESTROY).
+     * @param fd2 A file descriptor bound to the following netlink groups
+     *            (NF_NETLINK_CONNTRACK_UPDATE | NF_NETLINK_CONNTRACK_DESTROY).
+     * @param cb Assuming success, this callback must provide unsolicited updates of offload status.
+     *           It is assumed to be valid until stopOffload is called.
+     *
+     * @throws:
+     *         - EX_ILLEGAL_ARGUMENT if any file descriptors are invalid.
+     *         - EX_ILLEGAL_STATE if this method previously succeeded and stopOffload() was not
+     *           later called.
+     *         - EX_SERVICE_SPECIFIC with the error message set to a human-readable reason for the
+     *           error.
+     *
+     * Remarks: Initializing offload does not imply that any upstreams or downstreams have yet been,
+     * or even will be, chosen.  This API is symmetrical with stopOffload.
+     */
+    void initOffload(in ParcelFileDescriptor fd1, in ParcelFileDescriptor fd2,
+            in ITetheringOffloadCallback cb);
+
+    /**
+     * Indicate desire to tear down all tethering offload.
+     *
+     * Called after tethering is no longer requested by the user. Any remaining offload must
+     * be subsequently torn down by the management process.  Upon success, the callback registered
+     * in initOffload must be released, and offload must be stopped.
+     *
+     * @throws:
+     *         - EX_ILLEGAL_STATE if initOffload() was not called, or if stopOffload() was already
+     *           called.
+     *         - EX_SERVICE_SPECIFIC with the error message set to a human-readable reason for the
+     *           error.
+     *
+     * Remarks: Statistics must be reset by this API.
+     */
+    void stopOffload();
+
+    /**
+     * Instruct management process not to forward traffic destined to or from the specified
+     * prefixes.
+     *
+     * This API may only be called after initOffload and before stopOffload.
+     *
+     * @param prefixes List containing fully specified prefixes. For e.g. 192.168.1.0/24
+     * or 2001:4860:684::/64
+     *
+     * @throws:
+     *         - EX_ILLEGAL_ARGUMENT if the IP prefixes are invalid.
+     *         - EX_ILLEGAL_STATE if this method is called before initOffload(), or if this method
+     *           is called after stopOffload().
+     *         - EX_SERVICE_SPECIFIC with the error message set to a human-readable reason for the
+     *           error.
+     *
+     * Remarks: This list overrides any previously specified list
+     */
+    void setLocalPrefixes(in String[] prefixes);
+
+    /**
+     * Query offloaded traffic statistics forwarded to an upstream address.
+     *
+     * Return statistics that have transpired since the last query.  This would include
+     * statistics from all offloaded downstream tether interfaces that have been forwarded to this
+     * upstream interface.  After returning the statistics, the counters are reset to zero.
+     *
+     * Only offloaded statistics must be returned by this API, software stats must not be
+     * returned.
+     *
+     * @param upstream Upstream interface on which traffic exited/entered
+     *
+     * @return ForwardedStats depicting the received and transmitted bytes
+     *
+     * @throws:
+     *         - EX_SERVICE_SPECIFIC with the error message set to a human-readable reason for the
+     *           error.
+     */
+    ForwardedStats getForwardedStats(in String upstream);
+
+    /**
+     * Instruct hardware to send callbacks, and possibly stop offload, after certain number of bytes
+     * have been transferred in either direction on this upstream interface.
+     *
+     * The specified quota bytes must be applied to all traffic on the given upstream interface.
+     * This includes hardware forwarded traffic, software forwarded traffic, and AP-originated
+     * traffic. IPv4 and IPv6 traffic both count towards the same quota. IP headers are included
+     * in the byte count quota, but, link-layer headers are not.
+     *
+     * This API may only be called while offload is occurring on this upstream. The hardware
+     * management process MUST NOT store the values when offload is not started and apply them
+     * once offload is started. This is because the quota values would likely become stale over
+     * time and would not reflect any new traffic that has occurred.
+     *
+     * The specified quota bytes MUST replace any previous quotas set by
+     * {@code setDataWarningAndLimit} specified on the same interface. It may be interpreted as
+     * "tell me when either <warningBytes> or <limitBytes> bytes have been transferred
+     * (in either direction), and stop offload when <limitBytes> bytes have been transferred,
+     * starting now and counting from zero on <upstream>."
+     *
+     * Once the {@code warningBytes} is reached, the callback registered in initOffload must be
+     * called with {@code OFFLOAD_WARNING_REACHED} to indicate this event. Once the event fires
+     * for this upstream, no further {@code OFFLOAD_WARNING_REACHED} event will be fired for this
+     * upstream unless this method is called again with the same interface. Note that there is
+     * no need to call initOffload again to resume offload if stopOffload was not called by the
+     * client.
+     *
+     * Similarly, Once the {@code limitBytes} is reached, the callback registered in initOffload
+     * must be called with {@code OFFLOAD_STOPPED_LIMIT_REACHED} to indicate this event. Once
+     * the event fires for this upstream, no further {@code OFFLOAD_STOPPED_LIMIT_REACHED}
+     * event will be fired for this upstream unless this method is called again with the same
+     * interface. However, unlike {@code warningBytes}, when {@code limitBytes} is reached,
+     * all offload must be stopped. If offload is desired again, the hardware management
+     * process must be completely reprogrammed by calling setUpstreamParameters and
+     * addDownstream again.
+     *
+     * Note that {@code warningBytes} must always be less than or equal to {@code limitBytes},
+     * when {@code warningBytes} is reached, {@code limitBytes} may still valid unless this method
+     * is called again with the same interface.
+     *
+     * @param upstream Upstream interface name that quota must apply to.
+     * @param warningBytes The quota of warning, defined as the number of bytes, starting from
+     *                     zero and counting from now.
+     * @param limitBytes The quota of limit, defined as the number of bytes, starting from zero
+     *                   and counting from now.
+     *
+     * @throws:
+     *         - EX_ILLEGAL_ARGUMENT if any parameters are invalid (such as invalid upstream
+     *           or negative number of bytes).
+     *         - EX_ILLEGAL_STATE if this method is called before initOffload(), or if this method
+     *           is called after stopOffload().
+     *         - EX_UNSUPPORTED_OPERATION if it is not supported.
+     *         - EX_SERVICE_SPECIFIC with the error message set to a human-readable reason for the
+     *           error.
+     */
+    void setDataWarningAndLimit(in String upstream, in long warningBytes, in long limitBytes);
+
+    /**
+     * Instruct hardware to start forwarding traffic to the specified upstream.
+     *
+     * When iface, v4Addr, and v4Gw are all non-null, the management process may begin forwarding
+     * any currently configured or future configured IPv4 downstreams to this upstream interface.
+     *
+     * If any of the previously three mentioned parameters are null, then any current IPv4 offload
+     * must be stopped.
+     *
+     * When iface and v6Gws are both non-null, and in the case of v6Gws, are not empty, the
+     * management process may begin forwarding any currently configured or future configured IPv6
+     * downstreams to this upstream interface.
+     *
+     * If either of the two above parameters are null, or no V6 Gateways are provided, then IPv6
+     * offload must be stopped.
+     *
+     * This API may only be called after initOffload and before stopOffload.
+     *
+     * @param iface  Upstream interface name.  Note that only one is needed because IPv4 and IPv6
+     *               interfaces cannot be different (only known that this can occur during software
+     *               xlat, which cannot be offloaded through hardware anyways).  If the iface is
+     *               null, offload must be stopped.
+     * @param v4Addr The local IPv4 address assigned to the provided upstream interface, i.e. the
+     *               IPv4 address the packets are NATed to. For e.g. 192.168.0.12.
+     * @param v4Gw   The IPv4 address of the IPv4 gateway on the upstream interface.
+     *               For e.g. 192.168.1.1
+     * @param v6Gws  A list of IPv6 addresses (for e.g. fe80::97be:9de7:b24b:9194) for possible IPv6
+     *               gateways on the upstream interface.
+     *
+     * @throws:
+     *         - EX_ILLEGAL_ARGUMENT if any parameters are invalid (such as invalid upstream
+     *           or IP addresses).
+     *         - EX_ILLEGAL_STATE if this method is called before initOffload(), or if this method
+     *           is called after stopOffload().
+     *         - EX_SERVICE_SPECIFIC with the error message set to a human-readable reason for the
+     *           error.
+     *
+     * Remarks: This overrides any previously configured parameters.
+     */
+    void setUpstreamParameters(
+            in String iface, in String v4Addr, in String v4Gw, in String[] v6Gws);
+
+    /**
+     * Configure a downstream interface and prefix in the hardware management process that may be
+     * forwarded.
+     *
+     * The prefix may be an IPv4 or an IPv6 prefix to signify which family can be offloaded from
+     * the specified tether interface.  The list of IPv4 and IPv6 downstreams that are configured
+     * may differ.
+     *
+     * If the given protocol, as determined by the prefix, has an upstream set,
+     * the hardware may begin forwarding traffic between the upstream and any devices on the
+     * downstream interface that have IP addresses within the specified prefix. Other traffic from
+     * the same downstream interfaces is unaffected and must be forwarded if and only if it was
+     * already being forwarded.
+     *
+     * If no upstream is currently configured, then these downstream interface and prefixes must be
+     * preserved so that offload may begin in the future when an upstream is set.
+     *
+     * This API does not replace any previously configured downstreams and any such downstreams must
+     * be explicitly removed by calling removeDownstream.
+     *
+     * This API may only be called after initOffload and before stopOffload.
+     *
+     * @param iface  Downstream interface
+     * @param prefix Downstream prefix depicting addresses that may be offloaded.
+     *               For e.g. 192.168.1.0/24 or 2001:4860:684::/64)
+     *
+     * @throws:
+     *         - EX_ILLEGAL_ARGUMENT if any parameters are invalid (such as invalid downstream
+     *           or IP prefix).
+     *         - EX_ILLEGAL_STATE if this method is called before initOffload(), or if this method
+     *           is called after stopOffload().
+     *         - EX_SERVICE_SPECIFIC with the error message set to a human-readable reason for the
+     *           error.
+     *
+     * Remarks: The hardware management process may fail this call in a normal situation.  This can
+     *          happen because the hardware cannot support the current number of prefixes, the
+     *          hardware cannot support concurrent offload on multiple interfaces, the hardware
+     *          cannot currently support offload on the tether interface for some reason, or any
+     *          other dynamic configuration issues which may occur.  In this case,
+     *          traffic must remain unaffected and must be forwarded if and only if it was already
+     *          being forwarded.
+     */
+    void addDownstream(in String iface, in String prefix);
+
+    /**
+     * Remove a downstream prefix that may be forwarded from the hardware management process.
+     *
+     * The prefix may be an IPv4 or an IPv6 prefix. If it was not previously configured using
+     * addDownstream, then this must be a no-op.
+     *
+     * This API may only be called after initOffload and before stopOffload.
+     *
+     * @param iface  Downstream interface
+     * @param prefix Downstream prefix depicting address that must no longer be offloaded
+     *               For e.g. 192.168.1.0/24 or 2001:4860:684::/64)
+     *
+     * @throws:
+     *         - EX_ILLEGAL_ARGUMENT if any parameters are invalid (such as invalid downstream
+     *           or IP prefix).
+     *         - EX_ILLEGAL_STATE if this method is called before initOffload(), or if this method
+     *           is called after stopOffload().
+     *         - EX_SERVICE_SPECIFIC with the error message set to a human-readable reason for the
+     *           error.
+     */
+    void removeDownstream(in String iface, in String prefix);
+}
diff --git a/radio/aidl/android/hardware/radio/ims/media/MediaProtocolType.aidl b/tetheroffload/aidl/android/hardware/tetheroffload/IPv4AddrPortPair.aidl
similarity index 68%
copy from radio/aidl/android/hardware/radio/ims/media/MediaProtocolType.aidl
copy to tetheroffload/aidl/android/hardware/tetheroffload/IPv4AddrPortPair.aidl
index 325c6fa..16d7d85 100644
--- a/radio/aidl/android/hardware/radio/ims/media/MediaProtocolType.aidl
+++ b/tetheroffload/aidl/android/hardware/tetheroffload/IPv4AddrPortPair.aidl
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright (C) 2022 The Android Open Source Project
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -14,13 +14,13 @@
  * limitations under the License.
  */
 
-package android.hardware.radio.ims.media;
+package android.hardware.tetheroffload;
 
 @VintfStability
-@Backing(type="int")
-enum MediaProtocolType {
-   /** Real Time Protocol, see RFC 3550 */
-   RTP = 0,
-   /** Real Time Control Protocol, see RFC 3550 */
-   RTCP = 1,
+parcelable IPv4AddrPortPair {
+    /**
+     * IPv4 Address and Port
+     */
+    String addr;
+    int port;
 }
diff --git a/tetheroffload/aidl/android/hardware/tetheroffload/ITetheringOffloadCallback.aidl b/tetheroffload/aidl/android/hardware/tetheroffload/ITetheringOffloadCallback.aidl
new file mode 100644
index 0000000..5ee819b
--- /dev/null
+++ b/tetheroffload/aidl/android/hardware/tetheroffload/ITetheringOffloadCallback.aidl
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.tetheroffload;
+
+import android.hardware.tetheroffload.NatTimeoutUpdate;
+import android.hardware.tetheroffload.OffloadCallbackEvent;
+
+/**
+ * Callback providing information about status of hardware management process
+ * as well as providing a way to keep offloaded connections from timing out.
+ */
+@VintfStability
+oneway interface ITetheringOffloadCallback {
+    /**
+     * Called when an asynchronous event is generated by the hardware
+     * management process.
+     */
+    void onEvent(in OffloadCallbackEvent event);
+
+    /**
+     *  Provide a way for the management process to request that a connections
+     *  timeout be updated in kernel.
+     *
+     *  This is necessary to ensure that offloaded traffic is not cleaned up
+     *  by the kernel connection tracking module for IPv4.
+     */
+    void updateTimeout(in NatTimeoutUpdate params);
+}
diff --git a/radio/aidl/android/hardware/radio/ims/media/AnbrBitrate.aidl b/tetheroffload/aidl/android/hardware/tetheroffload/NatTimeoutUpdate.aidl
similarity index 64%
rename from radio/aidl/android/hardware/radio/ims/media/AnbrBitrate.aidl
rename to tetheroffload/aidl/android/hardware/tetheroffload/NatTimeoutUpdate.aidl
index 61239d0..50805ef 100644
--- a/radio/aidl/android/hardware/radio/ims/media/AnbrBitrate.aidl
+++ b/tetheroffload/aidl/android/hardware/tetheroffload/NatTimeoutUpdate.aidl
@@ -14,15 +14,14 @@
  * limitations under the License.
  */
 
-package android.hardware.radio.ims.media;
+package android.hardware.tetheroffload;
+
+import android.hardware.tetheroffload.IPv4AddrPortPair;
+import android.hardware.tetheroffload.NetworkProtocol;
 
 @VintfStability
-parcelable AnbrBitrate {
-    /** default value to represent NOT_SET */
-    const int INVALID_ANBR_BITRATE = -1;
-
-    /** Received bitrate in seconds for Uplink from NW or peer UE for ANBR */
-    int uplinkBps;
-    /** Received bitrate in secondsfor Downlink from NW or peer UE for ANBR */
-    int downlinkBps;
+parcelable NatTimeoutUpdate {
+    IPv4AddrPortPair src;
+    IPv4AddrPortPair dst;
+    NetworkProtocol proto;
 }
diff --git a/radio/aidl/android/hardware/radio/ims/media/MediaProtocolType.aidl b/tetheroffload/aidl/android/hardware/tetheroffload/NetworkProtocol.aidl
similarity index 71%
copy from radio/aidl/android/hardware/radio/ims/media/MediaProtocolType.aidl
copy to tetheroffload/aidl/android/hardware/tetheroffload/NetworkProtocol.aidl
index 325c6fa..cc4f7ac 100644
--- a/radio/aidl/android/hardware/radio/ims/media/MediaProtocolType.aidl
+++ b/tetheroffload/aidl/android/hardware/tetheroffload/NetworkProtocol.aidl
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright (C) 2022 The Android Open Source Project
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -14,13 +14,11 @@
  * limitations under the License.
  */
 
-package android.hardware.radio.ims.media;
+package android.hardware.tetheroffload;
 
 @VintfStability
 @Backing(type="int")
-enum MediaProtocolType {
-   /** Real Time Protocol, see RFC 3550 */
-   RTP = 0,
-   /** Real Time Control Protocol, see RFC 3550 */
-   RTCP = 1,
+enum NetworkProtocol {
+    TCP = 6,
+    UDP = 17,
 }
diff --git a/tetheroffload/aidl/android/hardware/tetheroffload/OffloadCallbackEvent.aidl b/tetheroffload/aidl/android/hardware/tetheroffload/OffloadCallbackEvent.aidl
new file mode 100644
index 0000000..a95f674
--- /dev/null
+++ b/tetheroffload/aidl/android/hardware/tetheroffload/OffloadCallbackEvent.aidl
@@ -0,0 +1,64 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.tetheroffload;
+
+@VintfStability
+@Backing(type="int")
+enum OffloadCallbackEvent {
+    /**
+     * Indicate that a working configuration has been programmed and the
+     * hardware management process has begun forwarding traffic.
+     */
+    OFFLOAD_STARTED = 1,
+    /**
+     * Indicate that an error has occurred which has disrupted hardware
+     * acceleration.  Software routing may still be attempted; however,
+     * statistics may be temporarily unavailable.  Statistics may be recovered
+     * after OFFLOAD_SUPPORT_AVAILABLE event is fired.
+     */
+    OFFLOAD_STOPPED_ERROR = 2,
+    /**
+     * Indicate that the device has moved to a RAT on which hardware
+     * acceleration is not supported.  Subsequent calls to setUpstreamParameters
+     * and add/removeDownstream will likely fail and cannot be presumed to be
+     * saved inside of the hardware management process.  Upon receiving
+     * OFFLOAD_SUPPORT_AVAILABLE, the client may reprogram the hardware
+     * management process to begin offload again.
+     */
+    OFFLOAD_STOPPED_UNSUPPORTED = 3,
+    /**
+     * Indicate that the hardware management process is willing and able to
+     * provide support for hardware acceleration at this time.  If applicable,
+     * the client may query for statistics.  If offload is desired, the client
+     * must reprogram the hardware management process.
+     */
+    OFFLOAD_SUPPORT_AVAILABLE = 4,
+    /**
+     * Hardware acceleration is no longer in effect and must be reprogrammed
+     * in order to resume.  This event is fired when the limit, applied in
+     * setDataLimit, has expired.  It is recommended that the client query for
+     * statistics immediately after receiving this event.
+     */
+    OFFLOAD_STOPPED_LIMIT_REACHED = 5,
+    /**
+     * This event is fired when the quota, applied in setDataWarning, has expired. It is
+     * recommended that the client query for statistics immediately after receiving this event.
+     * Any offloaded traffic will continue to be offloaded until offload is stopped or
+     * OFFLOAD_STOPPED_LIMIT_REACHED is sent.
+     */
+    OFFLOAD_WARNING_REACHED = 6,
+}
diff --git a/tetheroffload/aidl/default/Android.bp b/tetheroffload/aidl/default/Android.bp
new file mode 100644
index 0000000..8f0739c
--- /dev/null
+++ b/tetheroffload/aidl/default/Android.bp
@@ -0,0 +1,36 @@
+// Copyright (C) 2022 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package {
+    default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
+cc_binary {
+    name: "android.hardware.tetheroffload-service.example",
+    relative_install_path: "hw",
+    init_rc: ["tetheroffload-example.rc"],
+    vintf_fragments: ["tetheroffload-example.xml"],
+    vendor: true,
+    shared_libs: [
+        "android.hardware.tetheroffload-V1-ndk",
+        "libbase",
+        "libbinder_ndk",
+        "libcutils",
+        "libutils",
+    ],
+    srcs: [
+        "main.cpp",
+        "Offload.cpp",
+    ],
+}
diff --git a/tetheroffload/aidl/default/Offload.cpp b/tetheroffload/aidl/default/Offload.cpp
new file mode 100644
index 0000000..8aa6916
--- /dev/null
+++ b/tetheroffload/aidl/default/Offload.cpp
@@ -0,0 +1,246 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <numeric>
+#include <string>
+
+#include <android-base/logging.h>
+#include <android-base/strings.h>
+#include <netdb.h>
+
+#include "Offload.h"
+
+namespace aidl::android::hardware::tetheroffload::impl::example {
+
+using ::android::base::Join;
+
+ndk::ScopedAStatus Offload::addDownstream(const std::string& in_iface,
+                                          const std::string& in_prefix) {
+    LOG(VERBOSE) << __func__ << " Interface: " << in_iface << ", Prefix: " << in_prefix;
+    if (!isInitialized()) {
+        return ndk::ScopedAStatus::fromExceptionCodeWithMessage(
+                EX_ILLEGAL_STATE, "Tetheroffload HAL not initialized");
+    }
+    if (!isValidInterface(in_iface)) {
+        return ndk::ScopedAStatus::fromExceptionCodeWithMessage(EX_ILLEGAL_ARGUMENT,
+                                                                "Invalid interface name");
+    }
+    if (!isValidIpPrefix(in_prefix)) {
+        return ndk::ScopedAStatus::fromExceptionCodeWithMessage(EX_ILLEGAL_ARGUMENT,
+                                                                "Invalid IP prefix");
+    }
+    return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus Offload::getForwardedStats(const std::string& in_upstream,
+                                              ForwardedStats* _aidl_return) {
+    LOG(VERBOSE) << __func__ << " Upstream: " << in_upstream;
+    ForwardedStats stats;
+    stats.rxBytes = 0;
+    stats.txBytes = 0;
+    *_aidl_return = std::move(stats);
+    return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus Offload::initOffload(const ndk::ScopedFileDescriptor& in_fd1,
+                                        const ndk::ScopedFileDescriptor& in_fd2,
+                                        const std::shared_ptr<ITetheringOffloadCallback>& in_cb) {
+    LOG(VERBOSE) << __func__ << " FileDescriptor1: " << std::to_string(in_fd1.get())
+                 << ", FileDescriptor2: " << std::to_string(in_fd2.get())
+                 << ", ITetheringOffloadCallback: " << in_cb;
+    if (isInitialized()) {
+        return ndk::ScopedAStatus::fromExceptionCodeWithMessage(
+                EX_ILLEGAL_STATE, "Tetheroffload HAL already initialized");
+    }
+    int fd1 = in_fd1.get();
+    int fd2 = in_fd2.get();
+    if (fd1 < 0 || fd2 < 0) {
+        return ndk::ScopedAStatus::fromExceptionCodeWithMessage(EX_ILLEGAL_ARGUMENT,
+                                                                "Invalid file descriptors");
+    }
+    mFd1 = ndk::ScopedFileDescriptor(dup(fd1));
+    mFd2 = ndk::ScopedFileDescriptor(dup(fd2));
+    mInitialized = true;
+    return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus Offload::removeDownstream(const std::string& in_iface,
+                                             const std::string& in_prefix) {
+    LOG(VERBOSE) << __func__ << " Interface: " << in_iface << ", Prefix: " << in_prefix;
+    if (!isInitialized()) {
+        return ndk::ScopedAStatus::fromExceptionCodeWithMessage(
+                EX_ILLEGAL_STATE, "Tetheroffload HAL not initialized");
+    }
+    if (!isValidIpPrefix(in_prefix)) {
+        return ndk::ScopedAStatus::fromExceptionCodeWithMessage(EX_ILLEGAL_ARGUMENT,
+                                                                "Invalid IP prefix");
+    }
+    if (!isValidInterface(in_iface)) {
+        return ndk::ScopedAStatus::fromExceptionCodeWithMessage(EX_ILLEGAL_ARGUMENT,
+                                                                "Invalid interface name");
+    }
+    return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus Offload::setDataWarningAndLimit(const std::string& in_upstream,
+                                                   int64_t in_warningBytes, int64_t in_limitBytes) {
+    LOG(VERBOSE) << __func__ << " Upstream: " << in_upstream
+                 << ", WarningBytes: " << in_warningBytes << ", LimitBytes: " << in_limitBytes;
+    if (!isInitialized()) {
+        return ndk::ScopedAStatus::fromExceptionCodeWithMessage(
+                EX_ILLEGAL_STATE, "Tetheroffload HAL not initialized");
+    }
+    if (!isValidInterface(in_upstream)) {
+        return ndk::ScopedAStatus::fromExceptionCodeWithMessage(EX_ILLEGAL_ARGUMENT,
+                                                                "Invalid interface name");
+    }
+    if (in_warningBytes < 0 || in_limitBytes < 0) {
+        return ndk::ScopedAStatus::fromExceptionCodeWithMessage(EX_ILLEGAL_ARGUMENT,
+                                                                "Threshold must be non-negative");
+    }
+    return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus Offload::setLocalPrefixes(const std::vector<std::string>& in_prefixes) {
+    LOG(VERBOSE) << __func__ << " Prefixes: " << Join(in_prefixes, ',');
+    if (!isInitialized()) {
+        return ndk::ScopedAStatus::fromExceptionCodeWithMessage(
+                EX_ILLEGAL_STATE, "Tetheroffload HAL not initialized");
+    }
+    if (in_prefixes.empty()) {
+        return ndk::ScopedAStatus::fromExceptionCodeWithMessage(EX_ILLEGAL_ARGUMENT,
+                                                                "No IP prefix");
+    }
+    for (std::string prefix : in_prefixes) {
+        if (!isValidIpPrefix(prefix)) {
+            return ndk::ScopedAStatus::fromExceptionCodeWithMessage(EX_ILLEGAL_ARGUMENT,
+                                                                    "Invalid IP prefix");
+        }
+    }
+    return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus Offload::setUpstreamParameters(const std::string& in_iface,
+                                                  const std::string& in_v4Addr,
+                                                  const std::string& in_v4Gw,
+                                                  const std::vector<std::string>& in_v6Gws) {
+    LOG(VERBOSE) << __func__ << " Interface: " << in_iface << ", IPv4Address: " << in_v4Addr
+                 << ", IPv4Gateway: " << in_v4Gw << ", IPv6Gateways: " << Join(in_v6Gws, ',');
+    if (!isInitialized()) {
+        return ndk::ScopedAStatus::fromExceptionCodeWithMessage(
+                EX_ILLEGAL_STATE, "Tetheroffload HAL not initialized");
+    }
+    if (!isValidInterface(in_iface)) {
+        return ndk::ScopedAStatus::fromExceptionCodeWithMessage(EX_ILLEGAL_ARGUMENT,
+                                                                "Invalid interface name");
+    }
+    if (in_v4Addr.empty() && in_v4Gw.empty() && in_v6Gws.empty()) {
+        return ndk::ScopedAStatus::fromExceptionCodeWithMessage(EX_ILLEGAL_ARGUMENT,
+                                                                "No upstream IP address");
+    }
+    if (!in_v4Addr.empty() && !in_v4Gw.empty()) {
+        if (!isValidIpv4Address(in_v4Addr) || !isValidIpv4Address(in_v4Gw)) {
+            return ndk::ScopedAStatus::fromExceptionCodeWithMessage(EX_ILLEGAL_ARGUMENT,
+                                                                    "Invalid IP address");
+        }
+    }
+    for (std::string ip : in_v6Gws) {
+        if (!isValidIpv6Address(ip)) {
+            return ndk::ScopedAStatus::fromExceptionCodeWithMessage(EX_ILLEGAL_ARGUMENT,
+                                                                    "Invalid IP address");
+        }
+    }
+    return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus Offload::stopOffload() {
+    LOG(VERBOSE) << __func__;
+    if (!isInitialized()) {
+        return ndk::ScopedAStatus::fromExceptionCodeWithMessage(
+                EX_ILLEGAL_STATE, "Tetheroffload HAL not initialized");
+    }
+    mInitialized = false;
+    return ndk::ScopedAStatus::ok();
+};
+
+bool Offload::isInitialized() {
+    return (mInitialized == true);
+}
+
+bool Offload::isValidInterface(const std::string& iface) {
+    return !iface.empty() && iface != "invalid";
+}
+
+bool Offload::isValidIpv4Address(const std::string& repr) {
+    return validateIpAddressOrPrefix(repr, AF_INET, false);
+}
+
+bool Offload::isValidIpv4Prefix(const std::string& repr) {
+    return validateIpAddressOrPrefix(repr, AF_INET, true);
+}
+
+bool Offload::isValidIpv6Address(const std::string& repr) {
+    return validateIpAddressOrPrefix(repr, AF_INET6, false);
+}
+
+bool Offload::isValidIpv6Prefix(const std::string& repr) {
+    return validateIpAddressOrPrefix(repr, AF_INET6, true);
+}
+
+bool Offload::isValidIpAddress(const std::string& repr) {
+    return isValidIpv4Address(repr) || isValidIpv6Address(repr);
+}
+
+bool Offload::isValidIpPrefix(const std::string& repr) {
+    return isValidIpv4Prefix(repr) || isValidIpv6Prefix(repr);
+}
+
+// Refer to libnetdutils's IPAddress and IPPrefix classes.
+// Can't use them directly because libnetdutils is not "vendor_available".
+bool Offload::validateIpAddressOrPrefix(const std::string& repr, const int expectedFamily,
+                                        const bool isPrefix) {
+    const addrinfo hints = {
+            .ai_flags = AI_NUMERICHOST | AI_NUMERICSERV,
+    };
+    addrinfo* res;
+    size_t index = repr.find('/');
+    if (isPrefix && index == std::string::npos) return false;
+
+    // Parse the IP address.
+    const std::string ipAddress = isPrefix ? repr.substr(0, index) : repr;
+    const int ret = getaddrinfo(ipAddress.c_str(), nullptr, &hints, &res);
+    if (ret != 0) return false;
+
+    // Check the address family.
+    int family = res[0].ai_family;
+    freeaddrinfo(res);
+    if (family != expectedFamily) return false;
+    if (!isPrefix) return true;
+
+    // Parse the prefix length.
+    const char* prefixString = repr.c_str() + index + 1;
+    if (!isdigit(*prefixString)) return false;
+    char* endptr;
+    unsigned long prefixlen = strtoul(prefixString, &endptr, 10);
+    if (*endptr != '\0') return false;
+
+    uint8_t maxlen = (family == AF_INET) ? 32 : 128;
+    if (prefixlen > maxlen) return false;
+
+    return true;
+}
+
+}  // namespace aidl::android::hardware::tetheroffload::impl::example
diff --git a/tetheroffload/aidl/default/Offload.h b/tetheroffload/aidl/default/Offload.h
new file mode 100644
index 0000000..a1f6bce
--- /dev/null
+++ b/tetheroffload/aidl/default/Offload.h
@@ -0,0 +1,74 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+#include <aidl/android/hardware/tetheroffload/BnOffload.h>
+
+namespace aidl {
+namespace android {
+namespace hardware {
+namespace tetheroffload {
+namespace impl {
+namespace example {
+
+using aidl::android::hardware::tetheroffload::ForwardedStats;
+using aidl::android::hardware::tetheroffload::ITetheringOffloadCallback;
+
+class Offload : public BnOffload {
+  public:
+    ndk::ScopedAStatus addDownstream(const std::string& in_iface,
+                                     const std::string& in_prefix) override;
+    ndk::ScopedAStatus getForwardedStats(const std::string& in_upstream,
+                                         ForwardedStats* _aidl_return) override;
+    ndk::ScopedAStatus initOffload(
+            const ndk::ScopedFileDescriptor& in_fd1, const ndk::ScopedFileDescriptor& in_fd2,
+            const std::shared_ptr<ITetheringOffloadCallback>& in_cb) override;
+    ndk::ScopedAStatus removeDownstream(const std::string& in_iface,
+                                        const std::string& in_prefix) override;
+    ndk::ScopedAStatus setDataWarningAndLimit(const std::string& in_upstream,
+                                              int64_t in_warningBytes,
+                                              int64_t in_limitBytes) override;
+    ndk::ScopedAStatus setLocalPrefixes(const std::vector<std::string>& in_prefixes) override;
+    ndk::ScopedAStatus setUpstreamParameters(const std::string& in_iface,
+                                             const std::string& in_v4Addr,
+                                             const std::string& in_v4Gw,
+                                             const std::vector<std::string>& in_v6Gws) override;
+    ndk::ScopedAStatus stopOffload() override;
+
+  private:
+    bool isInitialized();
+    bool isValidInterface(const std::string& iface);
+    bool isValidIpv4Address(const std::string& repr);
+    bool isValidIpv4Prefix(const std::string& repr);
+    bool isValidIpv6Address(const std::string& repr);
+    bool isValidIpv6Prefix(const std::string& repr);
+    bool isValidIpAddress(const std::string& repr);
+    bool isValidIpPrefix(const std::string& repr);
+    bool validateIpAddressOrPrefix(const std::string& repr, const int expectedFamily,
+                                   const bool isPrefix);
+
+    bool mInitialized = false;
+    ndk::ScopedFileDescriptor mFd1;
+    ndk::ScopedFileDescriptor mFd2;
+};
+
+}  // namespace example
+}  // namespace impl
+}  // namespace tetheroffload
+}  // namespace hardware
+}  // namespace android
+}  // namespace aidl
diff --git a/tetheroffload/aidl/default/main.cpp b/tetheroffload/aidl/default/main.cpp
new file mode 100644
index 0000000..6633630
--- /dev/null
+++ b/tetheroffload/aidl/default/main.cpp
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "Offload.h"
+
+#include <android-base/logging.h>
+#include <android/binder_manager.h>
+#include <android/binder_process.h>
+
+using aidl::android::hardware::tetheroffload::impl::example::Offload;
+
+int main() {
+    ABinderProcess_setThreadPoolMaxThreadCount(0);
+    std::shared_ptr<Offload> offload = ndk::SharedRefBase::make<Offload>();
+
+    binder_status_t status = AServiceManager_addService(
+            offload->asBinder().get(), Offload::makeServiceName("default").c_str());
+    CHECK_EQ(status, STATUS_OK);
+
+    ABinderProcess_joinThreadPool();
+    return EXIT_FAILURE;  // should not reach
+}
diff --git a/tetheroffload/aidl/default/tetheroffload-example.rc b/tetheroffload/aidl/default/tetheroffload-example.rc
new file mode 100644
index 0000000..46cda61
--- /dev/null
+++ b/tetheroffload/aidl/default/tetheroffload-example.rc
@@ -0,0 +1,4 @@
+service vendor.tetheroffload-example /vendor/bin/hw/android.hardware.tetheroffload-service.example
+    class hal
+    user nobody
+    group nobody
diff --git a/tetheroffload/aidl/default/tetheroffload-example.xml b/tetheroffload/aidl/default/tetheroffload-example.xml
new file mode 100644
index 0000000..9fe83f6
--- /dev/null
+++ b/tetheroffload/aidl/default/tetheroffload-example.xml
@@ -0,0 +1,7 @@
+<manifest version="1.0" type="device">
+    <hal format="aidl">
+        <name>android.hardware.tetheroffload</name>
+        <version>1</version>
+        <fqname>IOffload/default</fqname>
+    </hal>
+</manifest>
diff --git a/tetheroffload/aidl/vts/functional/Android.bp b/tetheroffload/aidl/vts/functional/Android.bp
new file mode 100644
index 0000000..74edab0
--- /dev/null
+++ b/tetheroffload/aidl/vts/functional/Android.bp
@@ -0,0 +1,25 @@
+package {
+    default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
+cc_test {
+    name: "VtsHalTetheroffloadTargetTest",
+    defaults: [
+        "VtsHalTargetTestDefaults",
+        "use_libaidlvintf_gtest_helper_static",
+    ],
+    srcs: [
+        "VtsHalTetheroffloadTargetTest.cpp",
+    ],
+    shared_libs: [
+        "libbinder_ndk",
+    ],
+    static_libs: [
+        "android.hardware.tetheroffload-V1-ndk",
+        "libgmock_ndk",
+    ],
+    test_suites: [
+        "general-tests",
+        "vts",
+    ],
+}
diff --git a/tetheroffload/aidl/vts/functional/VtsHalTetheroffloadTargetTest.cpp b/tetheroffload/aidl/vts/functional/VtsHalTetheroffloadTargetTest.cpp
new file mode 100644
index 0000000..fc8abbd
--- /dev/null
+++ b/tetheroffload/aidl/vts/functional/VtsHalTetheroffloadTargetTest.cpp
@@ -0,0 +1,689 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#define LOG_TAG "tetheroffload_aidl_hal_test"
+
+#include <aidl/Gtest.h>
+#include <aidl/Vintf.h>
+#include <aidl/android/hardware/tetheroffload/BnOffload.h>
+#include <aidl/android/hardware/tetheroffload/BnTetheringOffloadCallback.h>
+#include <android-base/logging.h>
+#include <android-base/unique_fd.h>
+#include <android/binder_manager.h>
+#include <android/binder_process.h>
+#include <gmock/gmock.h>
+#include <gtest/gtest.h>
+#include <linux/netfilter/nfnetlink.h>
+#include <linux/netlink.h>
+#include <linux/rtnetlink.h>
+#include <log/log.h>
+#include <net/if.h>
+#include <sys/socket.h>
+
+namespace aidl::android::hardware::tetheroffload {
+
+namespace {
+
+using ::android::base::unique_fd;
+using android::hardware::tetheroffload::ForwardedStats;
+using android::hardware::tetheroffload::IOffload;
+using android::hardware::tetheroffload::NatTimeoutUpdate;
+using android::hardware::tetheroffload::OffloadCallbackEvent;
+using ::testing::AnyOf;
+using ::testing::Eq;
+
+const std::string TEST_IFACE = "rmnet_data0";
+const unsigned kFd1Groups = NF_NETLINK_CONNTRACK_NEW | NF_NETLINK_CONNTRACK_DESTROY;
+const unsigned kFd2Groups = NF_NETLINK_CONNTRACK_UPDATE | NF_NETLINK_CONNTRACK_DESTROY;
+
+enum class ExpectBoolean {
+    Ignored = -1,
+    False = 0,
+    True = 1,
+};
+
+inline const sockaddr* asSockaddr(const sockaddr_nl* nladdr) {
+    return reinterpret_cast<const sockaddr*>(nladdr);
+}
+
+int netlinkSocket(int protocol, unsigned groups) {
+    unique_fd s(socket(AF_NETLINK, SOCK_DGRAM, protocol));
+    if (s.get() < 0) {
+        return -errno;
+    }
+
+    const struct sockaddr_nl bind_addr = {
+            .nl_family = AF_NETLINK,
+            .nl_pad = 0,
+            .nl_pid = 0,
+            .nl_groups = groups,
+    };
+    if (bind(s.get(), asSockaddr(&bind_addr), sizeof(bind_addr)) != 0) {
+        return -errno;
+    }
+
+    const struct sockaddr_nl kernel_addr = {
+            .nl_family = AF_NETLINK,
+            .nl_pad = 0,
+            .nl_pid = 0,
+            .nl_groups = groups,
+    };
+    if (connect(s.get(), asSockaddr(&kernel_addr), sizeof(kernel_addr)) != 0) {
+        return -errno;
+    }
+
+    return s.release();
+}
+
+int netlinkSocket(unsigned groups) {
+    return netlinkSocket(NETLINK_NETFILTER, groups);
+}
+
+// Check whether the specified interface is up.
+bool interfaceIsUp(const std::string name) {
+    struct ifreq ifr = {};
+    strlcpy(ifr.ifr_name, name.c_str(), sizeof(ifr.ifr_name));
+    int sock = socket(AF_INET6, SOCK_DGRAM, 0);
+    if (sock == -1) return false;
+    int ret = ioctl(sock, SIOCGIFFLAGS, &ifr, sizeof(ifr));
+    close(sock);
+    return (ret == 0) && (ifr.ifr_flags & IFF_UP);
+}
+
+// Callback class for both events and NAT timeout updates.
+class TetheringOffloadCallback : public BnTetheringOffloadCallback {
+  public:
+    ndk::ScopedAStatus onEvent(OffloadCallbackEvent in_event) override {
+        auto lock = std::lock_guard{mMutex};
+        mOnEventInvoked = true;
+        mLastEvent = in_event;
+        mNotifyCv.notify_all();
+        return ndk::ScopedAStatus::ok();
+    }
+
+    ndk::ScopedAStatus updateTimeout(const NatTimeoutUpdate& in_params) override {
+        auto lock = std::lock_guard{mMutex};
+        mOnUpdateTimeoutInvoked = true;
+        mNatTimeout = in_params;
+        mNotifyCv.notify_all();
+        return ndk::ScopedAStatus::ok();
+    }
+
+  private:
+    std::mutex mMutex;
+    std::condition_variable mNotifyCv;
+    OffloadCallbackEvent mLastEvent;
+    NatTimeoutUpdate mNatTimeout;
+    bool mOnEventInvoked = false;
+    bool mOnUpdateTimeoutInvoked = false;
+};
+
+// The common base class for tetheroffload AIDL HAL tests.
+class TetheroffloadAidlTestBase : public testing::TestWithParam<std::string> {
+  public:
+    virtual void SetUp() override { getService(); }
+    virtual void TearDown() override {
+        // For good measure, the teardown should try stopOffload() once more, since
+        // different HAL call test cycles might enter this function. Also the
+        // return code cannot be actually expected for all cases, hence ignore it.
+        stopOffload(ExpectBoolean::Ignored);
+    };
+
+  protected:
+    void getService() {
+        AIBinder* binder = AServiceManager_waitForService(GetParam().c_str());
+        ASSERT_NE(binder, nullptr);
+        mOffload = IOffload::fromBinder(ndk::SpAIBinder(binder));
+    }
+
+    void initOffload(const bool expectedResult) {
+        unique_fd ufd1(netlinkSocket(kFd1Groups));
+        if (ufd1.get() < 0) {
+            ALOGE("Unable to create conntrack sockets: %d/%s", errno, strerror(errno));
+            FAIL();
+        }
+        ndk::ScopedFileDescriptor fd1 = ndk::ScopedFileDescriptor(ufd1.release());
+
+        unique_fd ufd2(netlinkSocket(kFd2Groups));
+        if (ufd2.get() < 0) {
+            ALOGE("Unable to create conntrack sockets: %d/%s", errno, strerror(errno));
+            FAIL();
+        }
+        ndk::ScopedFileDescriptor fd2 = ndk::ScopedFileDescriptor(ufd2.release());
+
+        mTetheringOffloadCallback = ndk::SharedRefBase::make<TetheringOffloadCallback>();
+        ASSERT_NE(mTetheringOffloadCallback, nullptr) << "Could not get offload callback";
+
+        ASSERT_EQ(mOffload->initOffload(fd1, fd2, mTetheringOffloadCallback).getExceptionCode(),
+                  expectedResult ? EX_NONE : EX_ILLEGAL_STATE);
+    }
+
+    void stopOffload(const ExpectBoolean expectedResult) {
+        ndk::ScopedAStatus status = mOffload->stopOffload();
+        if (expectedResult == ExpectBoolean::Ignored) return;
+        ASSERT_EQ(status.getExceptionCode(),
+                  expectedResult == ExpectBoolean::True ? EX_NONE : EX_ILLEGAL_STATE);
+    }
+
+    std::shared_ptr<IOffload> mOffload;
+    std::shared_ptr<TetheringOffloadCallback> mTetheringOffloadCallback;
+};
+
+// The test class for tetheroffload before initialization.
+class TetheroffloadAidlPreInitTest : public TetheroffloadAidlTestBase {
+  public:
+    virtual void SetUp() override { getService(); }
+};
+
+// The main test class for tetheroffload AIDL HAL.
+class TetheroffloadAidlGeneralTest : public TetheroffloadAidlTestBase {
+  public:
+    virtual void SetUp() override {
+        getService();
+        initOffload(true);
+    }
+};
+
+// Passing invalid file descriptor to initOffload() should return an error.
+// Check that this occurs when both FDs are empty.
+TEST_P(TetheroffloadAidlPreInitTest, TestInitOffloadInvalidFdsReturnsError) {
+    ndk::ScopedFileDescriptor fd1 = ndk::ScopedFileDescriptor(-1);
+    ndk::ScopedFileDescriptor fd2 = ndk::ScopedFileDescriptor(-1);
+    mTetheringOffloadCallback = ndk::SharedRefBase::make<TetheringOffloadCallback>();
+    ASSERT_NE(mTetheringOffloadCallback, nullptr) << "Could not get offload callback";
+    EXPECT_THAT(mOffload->initOffload(fd1, fd2, mTetheringOffloadCallback).getExceptionCode(),
+                AnyOf(Eq(EX_ILLEGAL_ARGUMENT), Eq(EX_TRANSACTION_FAILED)));
+}
+
+// Passing invalid file descriptor to initOffload() should return an error.
+// Check that this occurs when FD1 is empty.
+TEST_P(TetheroffloadAidlPreInitTest, TestInitOffloadInvalidFd1ReturnsError) {
+    ndk::ScopedFileDescriptor fd1 = ndk::ScopedFileDescriptor(-1);
+    unique_fd ufd2(netlinkSocket(kFd2Groups));
+    if (ufd2.get() < 0) {
+        ALOGE("Unable to create conntrack sockets: %d/%s", errno, strerror(errno));
+        FAIL();
+    }
+    ndk::ScopedFileDescriptor fd2 = ndk::ScopedFileDescriptor(ufd2.release());
+    mTetheringOffloadCallback = ndk::SharedRefBase::make<TetheringOffloadCallback>();
+    ASSERT_NE(mTetheringOffloadCallback, nullptr) << "Could not get offload callback";
+    EXPECT_THAT(mOffload->initOffload(fd1, fd2, mTetheringOffloadCallback).getExceptionCode(),
+                AnyOf(Eq(EX_ILLEGAL_ARGUMENT), Eq(EX_TRANSACTION_FAILED)));
+}
+
+// Passing invalid file descriptor to initOffload() should return an error.
+// Check that this occurs when FD2 is empty.
+TEST_P(TetheroffloadAidlPreInitTest, TestInitOffloadInvalidFd2ReturnsError) {
+    unique_fd ufd1(netlinkSocket(kFd1Groups));
+    if (ufd1.get() < 0) {
+        ALOGE("Unable to create conntrack sockets: %d/%s", errno, strerror(errno));
+        FAIL();
+    }
+    ndk::ScopedFileDescriptor fd1 = ndk::ScopedFileDescriptor(ufd1.release());
+    ndk::ScopedFileDescriptor fd2 = ndk::ScopedFileDescriptor(-1);
+    mTetheringOffloadCallback = ndk::SharedRefBase::make<TetheringOffloadCallback>();
+    ASSERT_NE(mTetheringOffloadCallback, nullptr) << "Could not get offload callback";
+    EXPECT_THAT(mOffload->initOffload(fd1, fd2, mTetheringOffloadCallback).getExceptionCode(),
+                AnyOf(Eq(EX_ILLEGAL_ARGUMENT), Eq(EX_TRANSACTION_FAILED)));
+}
+
+// Call initOffload() multiple times. Check that non-first initOffload() calls return error.
+TEST_P(TetheroffloadAidlPreInitTest, AdditionalInitsWithoutStopReturnError) {
+    initOffload(true);
+    initOffload(false);
+    initOffload(false);
+    initOffload(false);
+}
+
+// Check that calling stopOffload() without first having called initOffload() returns error.
+TEST_P(TetheroffloadAidlPreInitTest, MultipleStopsWithoutInitReturnError) {
+    stopOffload(ExpectBoolean::False);
+    stopOffload(ExpectBoolean::False);
+    stopOffload(ExpectBoolean::False);
+}
+
+// Check that calling stopOffload() after a complete init/stop cycle returns error.
+TEST_P(TetheroffloadAidlPreInitTest, AdditionalStopsWithInitReturnError) {
+    initOffload(true);
+    // Call setUpstreamParameters() so that "offload" can be reasonably said
+    // to be both requested and operational.
+    const std::string iface(TEST_IFACE);
+    const std::string v4Addr("192.0.0.2");
+    const std::string v4Gw("192.0.0.1");
+    const std::vector<std::string> v6Gws{std::string("fe80::db8:1"), std::string("fe80::db8:2")};
+    EXPECT_TRUE(mOffload->setUpstreamParameters(iface, v4Addr, v4Gw, v6Gws).isOk());
+    if (!interfaceIsUp(TEST_IFACE)) {
+        return;
+    }
+    SCOPED_TRACE("Expecting stopOffload to succeed");
+    stopOffload(ExpectBoolean::True);  // balance out initOffload(true)
+    SCOPED_TRACE("Expecting stopOffload to fail the first time");
+    stopOffload(ExpectBoolean::False);
+    SCOPED_TRACE("Expecting stopOffload to fail the second time");
+    stopOffload(ExpectBoolean::False);
+}
+
+// Check that calling setLocalPrefixes() without first having called initOffload() returns error.
+TEST_P(TetheroffloadAidlPreInitTest, SetLocalPrefixesWithoutInitReturnsError) {
+    const std::vector<std::string> prefixes{std::string("2001:db8::/64")};
+    EXPECT_EQ(mOffload->setLocalPrefixes(prefixes).getExceptionCode(), EX_ILLEGAL_STATE);
+}
+
+// Check that calling getForwardedStats() without first having called initOffload()
+// returns zero bytes statistics.
+TEST_P(TetheroffloadAidlPreInitTest, GetForwardedStatsWithoutInitReturnsZeroValues) {
+    const std::string upstream(TEST_IFACE);
+    ForwardedStats stats;
+    EXPECT_TRUE(mOffload->getForwardedStats(upstream, &stats).isOk());
+    EXPECT_EQ(stats.rxBytes, 0ULL);
+    EXPECT_EQ(stats.txBytes, 0ULL);
+}
+
+// Check that calling setDataWarningAndLimit() without first having called initOffload() returns
+// error.
+TEST_P(TetheroffloadAidlPreInitTest, SetDataWarningAndLimitWithoutInitReturnsError) {
+    const std::string upstream(TEST_IFACE);
+    const int64_t warning = 5000LL;
+    const int64_t limit = 5000LL;
+    EXPECT_EQ(mOffload->setDataWarningAndLimit(upstream, warning, limit).getExceptionCode(),
+              EX_ILLEGAL_STATE);
+}
+
+// Check that calling setUpstreamParameters() without first having called initOffload()
+// returns error.
+TEST_P(TetheroffloadAidlPreInitTest, SetUpstreamParametersWithoutInitReturnsError) {
+    const std::string iface(TEST_IFACE);
+    const std::string v4Addr("192.0.2.0/24");
+    const std::string v4Gw("192.0.2.1");
+    const std::vector<std::string> v6Gws{std::string("fe80::db8:1")};
+    EXPECT_EQ(mOffload->setUpstreamParameters(iface, v4Addr, v4Gw, v6Gws).getExceptionCode(),
+              EX_ILLEGAL_STATE);
+}
+
+// Check that calling addDownstream() with an IPv4 prefix without first having called
+// initOffload() returns error.
+TEST_P(TetheroffloadAidlPreInitTest, AddIPv4DownstreamWithoutInitReturnsError) {
+    const std::string iface(TEST_IFACE);
+    const std::string prefix("192.0.2.0/24");
+    EXPECT_EQ(mOffload->addDownstream(iface, prefix).getExceptionCode(), EX_ILLEGAL_STATE);
+}
+
+// Check that calling addDownstream() with an IPv6 prefix without first having called
+// initOffload() returns error.
+TEST_P(TetheroffloadAidlPreInitTest, AddIPv6DownstreamWithoutInitReturnsError) {
+    const std::string iface(TEST_IFACE);
+    const std::string prefix("2001:db8::/64");
+    EXPECT_EQ(mOffload->addDownstream(iface, prefix).getExceptionCode(), EX_ILLEGAL_STATE);
+}
+
+// Check that calling removeDownstream() with an IPv4 prefix without first having called
+// initOffload() returns error.
+TEST_P(TetheroffloadAidlPreInitTest, RemoveIPv4DownstreamWithoutInitReturnsError) {
+    const std::string iface(TEST_IFACE);
+    const std::string prefix("192.0.2.0/24");
+    EXPECT_EQ(mOffload->removeDownstream(iface, prefix).getExceptionCode(), EX_ILLEGAL_STATE);
+}
+
+// Check that calling removeDownstream() with an IPv6 prefix without first having called
+// initOffload() returns error.
+TEST_P(TetheroffloadAidlPreInitTest, RemoveIPv6DownstreamWithoutInitReturnsError) {
+    const std::string iface(TEST_IFACE);
+    const std::string prefix("2001:db8::/64");
+    EXPECT_EQ(mOffload->removeDownstream(iface, prefix).getExceptionCode(), EX_ILLEGAL_STATE);
+}
+
+/*
+ * Tests for IOffload::setLocalPrefixes().
+ */
+
+// Test setLocalPrefixes() rejects an IPv4 address.
+TEST_P(TetheroffloadAidlGeneralTest, SetLocalPrefixesIPv4AddressFails) {
+    const std::vector<std::string> prefixes{std::string("192.0.2.1")};
+    EXPECT_EQ(mOffload->setLocalPrefixes(prefixes).getExceptionCode(), EX_ILLEGAL_ARGUMENT);
+}
+
+// Test setLocalPrefixes() rejects an IPv6 address.
+TEST_P(TetheroffloadAidlGeneralTest, SetLocalPrefixesIPv6AddressFails) {
+    const std::vector<std::string> prefixes{std::string("fe80::1")};
+    EXPECT_EQ(mOffload->setLocalPrefixes(prefixes).getExceptionCode(), EX_ILLEGAL_ARGUMENT);
+}
+
+// Test setLocalPrefixes() accepts both IPv4 and IPv6 prefixes.
+TEST_P(TetheroffloadAidlGeneralTest, SetLocalPrefixesIPv4v6PrefixesOk) {
+    const std::vector<std::string> prefixes{std::string("192.0.2.0/24"), std::string("fe80::/64")};
+    EXPECT_TRUE(mOffload->setLocalPrefixes(prefixes).isOk());
+}
+
+// Test that setLocalPrefixes() fails given empty input. There is always
+// a non-empty set of local prefixes; when all networking interfaces are down
+// we still apply {127.0.0.0/8, ::1/128, fe80::/64} here.
+TEST_P(TetheroffloadAidlGeneralTest, SetLocalPrefixesEmptyFails) {
+    const std::vector<std::string> prefixes{};
+    EXPECT_EQ(mOffload->setLocalPrefixes(prefixes).getExceptionCode(), EX_ILLEGAL_ARGUMENT);
+}
+
+// Test setLocalPrefixes() fails on incorrectly formed input strings.
+TEST_P(TetheroffloadAidlGeneralTest, SetLocalPrefixesInvalidFails) {
+    const std::vector<std::string> prefixes{std::string("192.0.2.0/24"), std::string("invalid")};
+    EXPECT_EQ(mOffload->setLocalPrefixes(prefixes).getExceptionCode(), EX_ILLEGAL_ARGUMENT);
+}
+
+/*
+ * Tests for IOffload::getForwardedStats().
+ */
+
+// Test that getForwardedStats() for a non-existent upstream yields zero bytes statistics.
+TEST_P(TetheroffloadAidlGeneralTest, GetForwardedStatsInvalidUpstreamIface) {
+    const std::string upstream("invalid");
+    ForwardedStats stats;
+    EXPECT_TRUE(mOffload->getForwardedStats(upstream, &stats).isOk());
+    EXPECT_EQ(stats.rxBytes, 0ULL);
+    EXPECT_EQ(stats.txBytes, 0ULL);
+}
+
+// TEST_IFACE is presumed to exist on the device and be up. No packets
+// are ever actually caused to be forwarded.
+TEST_P(TetheroffloadAidlGeneralTest, GetForwardedStatsDummyIface) {
+    const std::string upstream(TEST_IFACE);
+    ForwardedStats stats;
+    EXPECT_TRUE(mOffload->getForwardedStats(upstream, &stats).isOk());
+    EXPECT_EQ(stats.rxBytes, 0ULL);
+    EXPECT_EQ(stats.txBytes, 0ULL);
+}
+
+/*
+ * Tests for IOffload::setDataWarningAndLimit().
+ */
+
+// Test that setDataWarningAndLimit() for an empty interface name fails.
+TEST_P(TetheroffloadAidlGeneralTest, SetDataWarningAndLimitEmptyUpstreamIfaceFails) {
+    const std::string upstream("");
+    const int64_t warning = 12345LL;
+    const int64_t limit = 67890LL;
+    EXPECT_THAT(mOffload->setDataWarningAndLimit(upstream, warning, limit).getExceptionCode(),
+                AnyOf(Eq(EX_ILLEGAL_ARGUMENT), Eq(EX_UNSUPPORTED_OPERATION)));
+}
+
+// TEST_IFACE is presumed to exist on the device and be up. No packets
+// are ever actually caused to be forwarded.
+TEST_P(TetheroffloadAidlGeneralTest, SetDataWarningAndLimitNonZeroOk) {
+    const std::string upstream(TEST_IFACE);
+    const int64_t warning = 4000LL;
+    const int64_t limit = 5000LL;
+    EXPECT_THAT(mOffload->setDataWarningAndLimit(upstream, warning, limit).getExceptionCode(),
+                AnyOf(Eq(EX_NONE), Eq(EX_UNSUPPORTED_OPERATION)));
+}
+
+// TEST_IFACE is presumed to exist on the device and be up. No packets
+// are ever actually caused to be forwarded.
+TEST_P(TetheroffloadAidlGeneralTest, SetDataWarningAndLimitZeroOk) {
+    const std::string upstream(TEST_IFACE);
+    const int64_t warning = 0LL;
+    const int64_t limit = 0LL;
+    EXPECT_THAT(mOffload->setDataWarningAndLimit(upstream, warning, limit).getExceptionCode(),
+                AnyOf(Eq(EX_NONE), Eq(EX_UNSUPPORTED_OPERATION)));
+}
+
+// TEST_IFACE is presumed to exist on the device and be up. No packets
+// are ever actually caused to be forwarded.
+TEST_P(TetheroffloadAidlGeneralTest, SetDataWarningAndLimitUnlimitedWarningOk) {
+    const std::string upstream(TEST_IFACE);
+    const int64_t warning = LLONG_MAX;
+    const int64_t limit = 5000LL;
+    EXPECT_TRUE(mOffload->setDataWarningAndLimit(upstream, warning, limit).isOk());
+}
+
+// Test that setDataWarningAndLimit() with negative thresholds fails.
+TEST_P(TetheroffloadAidlGeneralTest, SetDataWarningAndLimitNegativeFails) {
+    const std::string upstream(TEST_IFACE);
+    const int64_t warning = -1LL;
+    const int64_t limit = -1LL;
+    EXPECT_THAT(mOffload->setDataWarningAndLimit(upstream, warning, limit).getExceptionCode(),
+                AnyOf(Eq(EX_ILLEGAL_ARGUMENT), Eq(EX_UNSUPPORTED_OPERATION)));
+}
+
+/*
+ * Tests for IOffload::setUpstreamParameters().
+ */
+
+// TEST_IFACE is presumed to exist on the device and be up. No packets
+// are ever actually caused to be forwarded.
+TEST_P(TetheroffloadAidlGeneralTest, SetUpstreamParametersIPv6OnlyOk) {
+    const std::string iface(TEST_IFACE);
+    const std::string v4Addr("");
+    const std::string v4Gw("");
+    const std::vector<std::string> v6Gws{std::string("fe80::db8:1"), std::string("fe80::db8:2")};
+    EXPECT_TRUE(mOffload->setUpstreamParameters(iface, v4Addr, v4Gw, v6Gws).isOk());
+}
+
+// TEST_IFACE is presumed to exist on the device and be up. No packets
+// are ever actually caused to be forwarded.
+TEST_P(TetheroffloadAidlGeneralTest, SetUpstreamParametersAlternateIPv6OnlyOk) {
+    const std::string iface(TEST_IFACE);
+    const std::string v4Addr("");
+    const std::string v4Gw("");
+    const std::vector<std::string> v6Gws{std::string("fe80::db8:1"), std::string("fe80::db8:3")};
+    EXPECT_TRUE(mOffload->setUpstreamParameters(iface, v4Addr, v4Gw, v6Gws).isOk());
+}
+
+// TEST_IFACE is presumed to exist on the device and be up. No packets
+// are ever actually caused to be forwarded.
+TEST_P(TetheroffloadAidlGeneralTest, SetUpstreamParametersIPv4OnlyOk) {
+    const std::string iface(TEST_IFACE);
+    const std::string v4Addr("192.0.2.2");
+    const std::string v4Gw("192.0.2.1");
+    const std::vector<std::string> v6Gws{};
+    EXPECT_TRUE(mOffload->setUpstreamParameters(iface, v4Addr, v4Gw, v6Gws).isOk());
+}
+
+// TEST_IFACE is presumed to exist on the device and be up. No packets
+// are ever actually caused to be forwarded.
+TEST_P(TetheroffloadAidlGeneralTest, SetUpstreamParametersIPv4v6Ok) {
+    const std::string iface(TEST_IFACE);
+    const std::string v4Addr("192.0.2.2");
+    const std::string v4Gw("192.0.2.1");
+    const std::vector<std::string> v6Gws{std::string("fe80::db8:1"), std::string("fe80::db8:2")};
+    EXPECT_TRUE(mOffload->setUpstreamParameters(iface, v4Addr, v4Gw, v6Gws).isOk());
+}
+
+// Test that setUpstreamParameters() fails when all parameters are empty.
+TEST_P(TetheroffloadAidlGeneralTest, SetUpstreamParametersEmptyFails) {
+    const std::string iface("");
+    const std::string v4Addr("");
+    const std::string v4Gw("");
+    const std::vector<std::string> v6Gws{};
+    EXPECT_EQ(mOffload->setUpstreamParameters(iface, v4Addr, v4Gw, v6Gws).getExceptionCode(),
+              EX_ILLEGAL_ARGUMENT);
+}
+
+// Test that setUpstreamParameters() fails when given empty or non-existent interface names.
+TEST_P(TetheroffloadAidlGeneralTest, SetUpstreamParametersBogusIfaceFails) {
+    const std::string v4Addr("192.0.2.2");
+    const std::string v4Gw("192.0.2.1");
+    const std::vector<std::string> v6Gws{std::string("fe80::db8:1")};
+    for (const auto& bogus : {"", "invalid"}) {
+        SCOPED_TRACE(testing::Message() << "upstream: " << bogus);
+        const std::string iface(bogus);
+        EXPECT_EQ(mOffload->setUpstreamParameters(iface, v4Addr, v4Gw, v6Gws).getExceptionCode(),
+                  EX_ILLEGAL_ARGUMENT);
+    }
+}
+
+// Test that setUpstreamParameters() fails when given unparseable IPv4 addresses.
+TEST_P(TetheroffloadAidlGeneralTest, SetUpstreamParametersInvalidIPv4AddrFails) {
+    const std::string iface(TEST_IFACE);
+    const std::string v4Gw("192.0.2.1");
+    const std::vector<std::string> v6Gws{std::string("fe80::db8:1")};
+    for (const auto& bogus : {"invalid", "192.0.2"}) {
+        SCOPED_TRACE(testing::Message() << "v4addr: " << bogus);
+        const std::string v4Addr(bogus);
+        EXPECT_EQ(mOffload->setUpstreamParameters(iface, v4Addr, v4Gw, v6Gws).getExceptionCode(),
+                  EX_ILLEGAL_ARGUMENT);
+    }
+}
+
+// Test that setUpstreamParameters() fails when given unparseable IPv4 gateways.
+TEST_P(TetheroffloadAidlGeneralTest, SetUpstreamParametersInvalidIPv4GatewayFails) {
+    const std::string iface(TEST_IFACE);
+    const std::string v4Addr("192.0.2.2");
+    const std::vector<std::string> v6Gws{std::string("fe80::db8:1")};
+    for (const auto& bogus : {"invalid", "192.0.2"}) {
+        SCOPED_TRACE(testing::Message() << "v4gateway: " << bogus);
+        const std::string v4Gw(bogus);
+        EXPECT_EQ(mOffload->setUpstreamParameters(iface, v4Addr, v4Gw, v6Gws).getExceptionCode(),
+                  EX_ILLEGAL_ARGUMENT);
+    }
+}
+
+// Test that setUpstreamParameters() fails when given unparseable IPv6 gateways.
+TEST_P(TetheroffloadAidlGeneralTest, SetUpstreamParametersBadIPv6GatewaysFail) {
+    const std::string iface(TEST_IFACE);
+    const std::string v4Addr("192.0.2.2");
+    const std::string v4Gw("192.0.2.1");
+    for (const auto& bogus : {"", "invalid", "fe80::bogus", "192.0.2.66"}) {
+        SCOPED_TRACE(testing::Message() << "v6gateway: " << bogus);
+        const std::vector<std::string> v6Gws{std::string("fe80::1"), std::string(bogus)};
+        EXPECT_EQ(mOffload->setUpstreamParameters(iface, v4Addr, v4Gw, v6Gws).getExceptionCode(),
+                  EX_ILLEGAL_ARGUMENT);
+    }
+}
+
+/*
+ * Tests for IOffload::addDownstream().
+ */
+
+// Test addDownstream() works given an IPv4 prefix.
+TEST_P(TetheroffloadAidlGeneralTest, AddDownstreamIPv4) {
+    const std::string iface("dummy0");
+    const std::string prefix("192.0.2.0/24");
+    EXPECT_TRUE(mOffload->addDownstream(iface, prefix).isOk());
+}
+
+// Test addDownstream() works given an IPv6 prefix.
+TEST_P(TetheroffloadAidlGeneralTest, AddDownstreamIPv6) {
+    const std::string iface("dummy0");
+    const std::string prefix("2001:db8::/64");
+    EXPECT_TRUE(mOffload->addDownstream(iface, prefix).isOk());
+}
+
+// Test addDownstream() fails given all empty parameters.
+TEST_P(TetheroffloadAidlGeneralTest, AddDownstreamEmptyFails) {
+    const std::string iface("");
+    const std::string prefix("");
+    EXPECT_EQ(mOffload->addDownstream(iface, prefix).getExceptionCode(), EX_ILLEGAL_ARGUMENT);
+}
+
+// Test addDownstream() fails given empty or non-existent interface names.
+TEST_P(TetheroffloadAidlGeneralTest, AddDownstreamInvalidIfaceFails) {
+    const std::string prefix("192.0.2.0/24");
+    for (const auto& bogus : {"", "invalid"}) {
+        SCOPED_TRACE(testing::Message() << "iface: " << bogus);
+        const std::string iface(bogus);
+        EXPECT_EQ(mOffload->addDownstream(iface, prefix).getExceptionCode(), EX_ILLEGAL_ARGUMENT);
+    }
+}
+
+// Test addDownstream() fails given unparseable prefix arguments.
+TEST_P(TetheroffloadAidlGeneralTest, AddDownstreamBogusPrefixFails) {
+    const std::string iface("dummy0");
+    for (const auto& bogus : {"", "192.0.2/24", "2001:db8/64"}) {
+        SCOPED_TRACE(testing::Message() << "prefix: " << bogus);
+        const std::string prefix(bogus);
+        EXPECT_EQ(mOffload->addDownstream(iface, prefix).getExceptionCode(), EX_ILLEGAL_ARGUMENT);
+    }
+}
+
+/*
+ * Tests for IOffload::removeDownstream().
+ */
+
+// Test removeDownstream() works given an IPv4 prefix.
+TEST_P(TetheroffloadAidlGeneralTest, RemoveDownstreamIPv4) {
+    const std::string iface("dummy0");
+    const std::string prefix("192.0.2.0/24");
+    // First add the downstream, otherwise removeDownstream logic can reasonably
+    // return error for downstreams not previously added.
+    EXPECT_TRUE(mOffload->addDownstream(iface, prefix).isOk());
+    EXPECT_TRUE(mOffload->removeDownstream(iface, prefix).isOk());
+}
+
+// Test removeDownstream() works given an IPv6 prefix.
+TEST_P(TetheroffloadAidlGeneralTest, RemoveDownstreamIPv6) {
+    const std::string iface("dummy0");
+    const std::string prefix("2001:db8::/64");
+    // First add the downstream, otherwise removeDownstream logic can reasonably
+    // return error for downstreams not previously added.
+    EXPECT_TRUE(mOffload->addDownstream(iface, prefix).isOk());
+    EXPECT_TRUE(mOffload->removeDownstream(iface, prefix).isOk());
+}
+
+// Test removeDownstream() fails given all empty parameters.
+TEST_P(TetheroffloadAidlGeneralTest, RemoveDownstreamEmptyFails) {
+    const std::string iface("");
+    const std::string prefix("");
+    EXPECT_EQ(mOffload->removeDownstream(iface, prefix).getExceptionCode(), EX_ILLEGAL_ARGUMENT);
+}
+
+// Test removeDownstream() fails given empty or non-existent interface names.
+TEST_P(TetheroffloadAidlGeneralTest, RemoveDownstreamBogusIfaceFails) {
+    const std::string prefix("192.0.2.0/24");
+    for (const auto& bogus : {"", "invalid"}) {
+        SCOPED_TRACE(testing::Message() << "iface: " << bogus);
+        const std::string iface(bogus);
+        EXPECT_EQ(mOffload->removeDownstream(iface, prefix).getExceptionCode(),
+                  EX_ILLEGAL_ARGUMENT);
+    }
+}
+
+// Test removeDownstream() fails given unparseable prefix arguments.
+TEST_P(TetheroffloadAidlGeneralTest, RemoveDownstreamBogusPrefixFails) {
+    const std::string iface("dummy0");
+    for (const auto& bogus : {"", "192.0.2/24", "2001:db8/64"}) {
+        SCOPED_TRACE(testing::Message() << "prefix: " << bogus);
+        const std::string prefix(bogus);
+        EXPECT_EQ(mOffload->removeDownstream(iface, prefix).getExceptionCode(),
+                  EX_ILLEGAL_ARGUMENT);
+    }
+}
+
+GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(TetheroffloadAidlTestBase);
+INSTANTIATE_TEST_SUITE_P(
+        IOffload, TetheroffloadAidlTestBase,
+        testing::ValuesIn(::android::getAidlHalInstanceNames(IOffload::descriptor)),
+        ::android::PrintInstanceNameToString);
+
+GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(TetheroffloadAidlPreInitTest);
+INSTANTIATE_TEST_SUITE_P(
+        IOffload, TetheroffloadAidlPreInitTest,
+        testing::ValuesIn(::android::getAidlHalInstanceNames(IOffload::descriptor)),
+        ::android::PrintInstanceNameToString);
+
+GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(TetheroffloadAidlGeneralTest);
+INSTANTIATE_TEST_SUITE_P(
+        IOffload, TetheroffloadAidlGeneralTest,
+        testing::ValuesIn(::android::getAidlHalInstanceNames(IOffload::descriptor)),
+        ::android::PrintInstanceNameToString);
+
+}  // namespace
+
+int main(int argc, char** argv) {
+    ::testing::InitGoogleTest(&argc, argv);
+    ABinderProcess_setThreadPoolMaxThreadCount(1);
+    ABinderProcess_startThreadPool();
+    return RUN_ALL_TESTS();
+}
+
+}  // namespace aidl::android::hardware::tetheroffload
diff --git a/thermal/aidl/aidl_api/android.hardware.thermal/current/android/hardware/thermal/CoolingType.aidl b/thermal/aidl/aidl_api/android.hardware.thermal/current/android/hardware/thermal/CoolingType.aidl
index d2eb389..1f87cf2 100644
--- a/thermal/aidl/aidl_api/android.hardware.thermal/current/android/hardware/thermal/CoolingType.aidl
+++ b/thermal/aidl/aidl_api/android.hardware.thermal/current/android/hardware/thermal/CoolingType.aidl
@@ -35,15 +35,15 @@
 /* @hide */
 @Backing(type="int") @VintfStability
 enum CoolingType {
-  FAN = 0,
-  BATTERY = 1,
-  CPU = 2,
-  GPU = 3,
-  MODEM = 4,
-  NPU = 5,
-  COMPONENT = 6,
-  TPU = 7,
-  POWER_AMPLIFIER = 8,
-  DISPLAY = 9,
-  SPEAKER = 10,
+  FAN,
+  BATTERY,
+  CPU,
+  GPU,
+  MODEM,
+  NPU,
+  COMPONENT,
+  TPU,
+  POWER_AMPLIFIER,
+  DISPLAY,
+  SPEAKER,
 }
diff --git a/thermal/aidl/aidl_api/android.hardware.thermal/current/android/hardware/thermal/TemperatureType.aidl b/thermal/aidl/aidl_api/android.hardware.thermal/current/android/hardware/thermal/TemperatureType.aidl
index 0a9efdd..e9710a7 100644
--- a/thermal/aidl/aidl_api/android.hardware.thermal/current/android/hardware/thermal/TemperatureType.aidl
+++ b/thermal/aidl/aidl_api/android.hardware.thermal/current/android/hardware/thermal/TemperatureType.aidl
@@ -35,7 +35,7 @@
 /* @hide */
 @Backing(type="int") @VintfStability
 enum TemperatureType {
-  UNKNOWN = -1,
+  UNKNOWN = (-1),
   CPU = 0,
   GPU = 1,
   BATTERY = 2,
diff --git a/thermal/aidl/aidl_api/android.hardware.thermal/current/android/hardware/thermal/ThrottlingSeverity.aidl b/thermal/aidl/aidl_api/android.hardware.thermal/current/android/hardware/thermal/ThrottlingSeverity.aidl
index 8fe3df6..183344d 100644
--- a/thermal/aidl/aidl_api/android.hardware.thermal/current/android/hardware/thermal/ThrottlingSeverity.aidl
+++ b/thermal/aidl/aidl_api/android.hardware.thermal/current/android/hardware/thermal/ThrottlingSeverity.aidl
@@ -36,10 +36,10 @@
 @Backing(type="int") @VintfStability
 enum ThrottlingSeverity {
   NONE = 0,
-  LIGHT = 1,
-  MODERATE = 2,
-  SEVERE = 3,
-  CRITICAL = 4,
-  EMERGENCY = 5,
-  SHUTDOWN = 6,
+  LIGHT,
+  MODERATE,
+  SEVERE,
+  CRITICAL,
+  EMERGENCY,
+  SHUTDOWN,
 }
diff --git a/thermal/aidl/android/hardware/thermal/IThermal.aidl b/thermal/aidl/android/hardware/thermal/IThermal.aidl
index dd87b3a..7c23c17 100644
--- a/thermal/aidl/android/hardware/thermal/IThermal.aidl
+++ b/thermal/aidl/android/hardware/thermal/IThermal.aidl
@@ -104,9 +104,9 @@
      *    they go offline, if these devices exist on boot. The method
      *    always returns and never removes such temperatures. The thresholds
      *    are returned as static values and must not change across calls. The actual
-     *    throttling state is determined in device thermal mitigation policy/agorithm
+     *    throttling state is determined in device thermal mitigation policy/algorithm
      *    which might not be simple thresholds so these values Thermal HAL provided
-     *    may not be accurate to detemin the throttling status. To get accurate
+     *    may not be accurate to determine the throttling status. To get accurate
      *    throttling status, use getTemperatures or registerThermalChangedCallback
      *    and listen to the callback.
      *
@@ -129,9 +129,9 @@
      *    they go offline, if these devices exist on boot. The method
      *    always returns and never removes such temperatures. The thresholds
      *    are returned as static values and must not change across calls. The actual
-     *    throttling state is determined in device thermal mitigation policy/agorithm
+     *    throttling state is determined in device thermal mitigation policy/algorithm
      *    which might not be simple thresholds so these values Thermal HAL provided
-     *    may not be accurate to detemin the throttling status. To get accurate
+     *    may not be accurate to determine the throttling status. To get accurate
      *    throttling status, use getTemperatures or registerThermalChangedCallback
      *    and listen to the callback.
      *
diff --git a/thermal/aidl/android/hardware/thermal/TemperatureThreshold.aidl b/thermal/aidl/android/hardware/thermal/TemperatureThreshold.aidl
index 8065f76..0714c82 100644
--- a/thermal/aidl/android/hardware/thermal/TemperatureThreshold.aidl
+++ b/thermal/aidl/android/hardware/thermal/TemperatureThreshold.aidl
@@ -36,7 +36,7 @@
      * level defined in ThrottlingSeverity including shutdown. Throttling
      * happens when temperature >= threshold. If not available, set to NAN.
      * Unit is same as Temperature's value.
-     * The number of thresholds must be the same as ThrottlingSeverity#len.
+     * The array size must be the same as ThrottlingSeverity's enum cardinality.
      */
     float[] hotThrottlingThresholds;
     /**
@@ -44,7 +44,7 @@
      * level defined in ThrottlingSeverity including shutdown. Throttling
      * happens when temperature <= threshold. If not available, set to NAN.
      * Unit is same as Temperature's value.
-     * The number of theresholds must be the same as ThrottlingSeverity#len.
+     * The array size must be the same as ThrottlingSeverity's enum cardinality.
      */
     float[] coldThrottlingThresholds;
 }
diff --git a/tv/hdmi/aidl/TEST_MAPPING b/tv/hdmi/aidl/TEST_MAPPING
deleted file mode 100644
index 6bd3b57..0000000
--- a/tv/hdmi/aidl/TEST_MAPPING
+++ /dev/null
@@ -1,7 +0,0 @@
-{
-  "presubmit": [
-    {
-      "name": "VtsHalTvHdmiAidlTargetTest"
-    }
-  ]
-}
diff --git a/tv/hdmi/aidl/vts/functional/VtsHalTvHdmiAidlTargetTest.cpp b/tv/hdmi/aidl/vts/functional/VtsHalTvHdmiAidlTargetTest.cpp
deleted file mode 100644
index fd4d94f..0000000
--- a/tv/hdmi/aidl/vts/functional/VtsHalTvHdmiAidlTargetTest.cpp
+++ /dev/null
@@ -1,119 +0,0 @@
-/*
- * Copyright (C) 2022 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#define LOG_TAG "Hdmi_hal_test"
-
-#include <aidl/Gtest.h>
-#include <aidl/Vintf.h>
-#include <aidl/android/hardware/tv/hdmi/BnHdmi.h>
-#include <aidl/android/hardware/tv/hdmi/BnHdmiCallback.h>
-#include <android-base/logging.h>
-#include <android/binder_manager.h>
-#include <android/binder_process.h>
-#include <gtest/gtest.h>
-#include <log/log.h>
-#include <sstream>
-#include <vector>
-
-using ::aidl::android::hardware::tv::hdmi::BnHdmiCallback;
-using ::aidl::android::hardware::tv::hdmi::HdmiPortInfo;
-using ::aidl::android::hardware::tv::hdmi::HdmiPortType;
-using ::aidl::android::hardware::tv::hdmi::HpdSignal;
-using ::aidl::android::hardware::tv::hdmi::IHdmi;
-using ::aidl::android::hardware::tv::hdmi::IHdmiCallback;
-using ::ndk::SpAIBinder;
-
-#define INCORRECT_VENDOR_ID 0x00
-#define TV_PHYSICAL_ADDRESS 0x0000
-
-// The main test class for TV HDMI HAL.
-class HdmiTest : public ::testing::TestWithParam<std::string> {
-    static void serviceDied(void* /* cookie */) { ALOGE("VtsHalTvCecAidlTargetTest died"); }
-
-  public:
-    void SetUp() override {
-        hdmi = IHdmi::fromBinder(SpAIBinder(AServiceManager_waitForService(GetParam().c_str())));
-        ASSERT_NE(hdmi, nullptr);
-        ALOGI("%s: getService() for hdmi is %s", __func__, hdmi->isRemote() ? "remote" : "local");
-
-        hdmiCallback = ::ndk::SharedRefBase::make<HdmiCallback>();
-        ASSERT_NE(hdmiCallback, nullptr);
-        hdmiDeathRecipient =
-                ndk::ScopedAIBinder_DeathRecipient(AIBinder_DeathRecipient_new(&serviceDied));
-        ASSERT_EQ(AIBinder_linkToDeath(hdmi->asBinder().get(), hdmiDeathRecipient.get(), 0),
-                  STATUS_OK);
-    }
-
-    class HdmiCallback : public BnHdmiCallback {
-      public:
-        ::ndk::ScopedAStatus onHotplugEvent(bool connected __unused, int32_t portId __unused) {
-            return ::ndk::ScopedAStatus::ok();
-        };
-    };
-
-    std::shared_ptr<IHdmi> hdmi;
-    std::shared_ptr<IHdmiCallback> hdmiCallback;
-    ::ndk::ScopedAIBinder_DeathRecipient hdmiDeathRecipient;
-};
-
-GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(HdmiTest);
-INSTANTIATE_TEST_SUITE_P(PerInstance, HdmiTest,
-                         testing::ValuesIn(android::getAidlHalInstanceNames(IHdmi::descriptor)),
-                         android::PrintInstanceNameToString);
-
-TEST_P(HdmiTest, SetCallback) {
-    ASSERT_TRUE(hdmi->setCallback(::ndk::SharedRefBase::make<HdmiCallback>()).isOk());
-}
-
-TEST_P(HdmiTest, GetPortInfo) {
-    std::vector<HdmiPortInfo> ports;
-    ASSERT_TRUE(hdmi->getPortInfo(&ports).isOk());
-
-    bool cecSupportedOnDevice = false;
-    for (size_t i = 0; i < ports.size(); ++i) {
-        EXPECT_TRUE((ports[i].type == HdmiPortType::OUTPUT) ||
-                    (ports[i].type == HdmiPortType::INPUT));
-        if (ports[i].portId == 0) {
-            ALOGW("%s: Port id should start from 1", __func__);
-        }
-        cecSupportedOnDevice = cecSupportedOnDevice | ports[i].cecSupported;
-    }
-    EXPECT_NE(cecSupportedOnDevice, false) << "At least one port should support CEC";
-}
-
-TEST_P(HdmiTest, IsConnected) {
-    std::vector<HdmiPortInfo> ports;
-    ASSERT_TRUE(hdmi->getPortInfo(&ports).isOk());
-    for (size_t i = 0; i < ports.size(); ++i) {
-        bool connected;
-        ASSERT_TRUE(hdmi->isConnected(ports[i].portId, &connected).isOk());
-    }
-}
-
-TEST_P(HdmiTest, HdpSignal) {
-    HpdSignal originalSignal;
-    HpdSignal signal = HpdSignal::HDMI_HPD_STATUS_BIT;
-    HpdSignal readSignal;
-    ASSERT_TRUE(hdmi->getHpdSignal(&originalSignal).isOk());
-    ASSERT_TRUE(hdmi->setHpdSignal(signal).isOk());
-    ASSERT_TRUE(hdmi->getHpdSignal(&readSignal).isOk());
-    EXPECT_EQ(readSignal, signal);
-    signal = HpdSignal::HDMI_HPD_PHYSICAL;
-    ASSERT_TRUE(hdmi->setHpdSignal(signal).isOk());
-    ASSERT_TRUE(hdmi->getHpdSignal(&readSignal).isOk());
-    EXPECT_EQ(readSignal, signal);
-    ASSERT_TRUE(hdmi->setHpdSignal(originalSignal).isOk());
-}
diff --git a/tv/hdmi/connection/aidl/TEST_MAPPING b/tv/hdmi/connection/aidl/TEST_MAPPING
new file mode 100644
index 0000000..13cf0c2
--- /dev/null
+++ b/tv/hdmi/connection/aidl/TEST_MAPPING
@@ -0,0 +1,7 @@
+{
+  "presubmit": [
+    {
+      "name": "VtsHalTvHdmiConnectionAidlTargetTest"
+    }
+  ]
+}
diff --git a/tv/hdmi/connection/aidl/aidl_api/android.hardware.tv.hdmi.connection/current/android/hardware/tv/hdmi/connection/IHdmiConnection.aidl b/tv/hdmi/connection/aidl/aidl_api/android.hardware.tv.hdmi.connection/current/android/hardware/tv/hdmi/connection/IHdmiConnection.aidl
index 98d1452..cf7c4bd 100644
--- a/tv/hdmi/connection/aidl/aidl_api/android.hardware.tv.hdmi.connection/current/android/hardware/tv/hdmi/connection/IHdmiConnection.aidl
+++ b/tv/hdmi/connection/aidl/aidl_api/android.hardware.tv.hdmi.connection/current/android/hardware/tv/hdmi/connection/IHdmiConnection.aidl
@@ -37,6 +37,6 @@
   android.hardware.tv.hdmi.connection.HdmiPortInfo[] getPortInfo();
   boolean isConnected(in int portId);
   void setCallback(in android.hardware.tv.hdmi.connection.IHdmiConnectionCallback callback);
-  void setHpdSignal(android.hardware.tv.hdmi.connection.HpdSignal signal);
-  android.hardware.tv.hdmi.connection.HpdSignal getHpdSignal();
+  void setHpdSignal(android.hardware.tv.hdmi.connection.HpdSignal signal, in int portId);
+  android.hardware.tv.hdmi.connection.HpdSignal getHpdSignal(in int portId);
 }
diff --git a/tv/hdmi/connection/aidl/android/hardware/tv/hdmi/connection/HdmiPortInfo.aidl b/tv/hdmi/connection/aidl/android/hardware/tv/hdmi/connection/HdmiPortInfo.aidl
index c8a10d1..1d2ef4a 100644
--- a/tv/hdmi/connection/aidl/android/hardware/tv/hdmi/connection/HdmiPortInfo.aidl
+++ b/tv/hdmi/connection/aidl/android/hardware/tv/hdmi/connection/HdmiPortInfo.aidl
@@ -24,7 +24,7 @@
 @VintfStability
 parcelable HdmiPortInfo {
     HdmiPortType type;
-    int portId; // Should start from 1 which corresponds to HDMI "port 1".
+    int portId; // Output ports should start from 1 which corresponds to HDMI "port 1".
     boolean cecSupported;
     boolean arcSupported;
     boolean eArcSupported;
diff --git a/tv/hdmi/connection/aidl/android/hardware/tv/hdmi/connection/IHdmiConnection.aidl b/tv/hdmi/connection/aidl/android/hardware/tv/hdmi/connection/IHdmiConnection.aidl
index c8759f2..6c7a438 100644
--- a/tv/hdmi/connection/aidl/android/hardware/tv/hdmi/connection/IHdmiConnection.aidl
+++ b/tv/hdmi/connection/aidl/android/hardware/tv/hdmi/connection/IHdmiConnection.aidl
@@ -55,16 +55,22 @@
      * signaling EDID updates). By default, the HAL will use {@code HDMI_HPD_PHYSICAL} (the physical
      * hotplug signal). When set to {@code HDMI_HPD_STATUS_BIT} the HAL should use the HDP status
      * bit.
+     *
+     * @param signal The HPD signal type to use.
+     * @param portId id of the port on which the HPD signal should be set.
+     *
      * @throws ServiceSpecificException with error code set to
      *         {@code Result::FAILURE_NOT_SUPPORTED} if the signal type is not supported.
      *         {@code Result::FAILURE_INVALID_ARGS} if the signal type is invalid.
      *         {@code Result::FAILURE_UNKNOWN} if the signal type could not be set because of an
      *                                         unknown failure.
      */
-    void setHpdSignal(HpdSignal signal);
+    void setHpdSignal(HpdSignal signal, in int portId);
 
     /**
      * Get the current signal the HAL is using for HPD
+     *
+     * @param portId id of the port of which the current HPD signal is queried.
      */
-    HpdSignal getHpdSignal();
+    HpdSignal getHpdSignal(in int portId);
 }
diff --git a/tv/hdmi/connection/aidl/default/HdmiConnectionMock.cpp b/tv/hdmi/connection/aidl/default/HdmiConnectionMock.cpp
index db9f4c1..ca8c348 100644
--- a/tv/hdmi/connection/aidl/default/HdmiConnectionMock.cpp
+++ b/tv/hdmi/connection/aidl/default/HdmiConnectionMock.cpp
@@ -44,7 +44,7 @@
 ScopedAStatus HdmiConnectionMock::isConnected(int32_t portId, bool* _aidl_return) {
     // Maintain port connection status and update on hotplug event
     if (portId <= mTotalPorts && portId >= 1) {
-        *_aidl_return = mPortConnectionStatus[portId];
+        *_aidl_return = mPortConnectionStatus.at(portId - 1);
     } else {
         *_aidl_return = false;
     }
@@ -69,9 +69,9 @@
     return ScopedAStatus::ok();
 }
 
-ScopedAStatus HdmiConnectionMock::setHpdSignal(HpdSignal signal) {
+ScopedAStatus HdmiConnectionMock::setHpdSignal(HpdSignal signal, int32_t portId) {
     if (mHdmiThreadRun) {
-        mHpdSignal = signal;
+        mHpdSignal.at(portId - 1) = signal;
         return ScopedAStatus::ok();
     } else {
         return ScopedAStatus::fromServiceSpecificError(
@@ -79,8 +79,8 @@
     }
 }
 
-ScopedAStatus HdmiConnectionMock::getHpdSignal(HpdSignal* _aidl_return) {
-    *_aidl_return = mHpdSignal;
+ScopedAStatus HdmiConnectionMock::getHpdSignal(int32_t portId, HpdSignal* _aidl_return) {
+    *_aidl_return = mHpdSignal.at(portId - 1);
     return ScopedAStatus::ok();
 }
 
@@ -130,10 +130,10 @@
 
     ALOGD("[halimp_aidl] hot plug port id %x, is connected %x", (msgBuf[0] & 0xf),
           (msgBuf[3] & 0xf));
-    mPortConnectionStatus[portId] = connected;
-    if (mPortInfos[portId].type == HdmiPortType::OUTPUT) {
+    mPortConnectionStatus.at(portId - 1) = connected;
+    if (mPortInfos.at(portId - 1).type == HdmiPortType::OUTPUT) {
         mPhysicalAddress = (connected ? 0xffff : ((msgBuf[1] << 8) | (msgBuf[2])));
-        mPortInfos[portId].physicalAddress = mPhysicalAddress;
+        mPortInfos.at(portId - 1).physicalAddress = mPhysicalAddress;
         ALOGD("[halimp_aidl] hot plug physical address %x", mPhysicalAddress);
     }
 
@@ -179,6 +179,7 @@
     mCallback = nullptr;
     mPortInfos.resize(mTotalPorts);
     mPortConnectionStatus.resize(mTotalPorts);
+    mHpdSignal.resize(mTotalPorts);
     mPortInfos[0] = {.type = HdmiPortType::OUTPUT,
                      .portId = static_cast<uint32_t>(1),
                      .cecSupported = true,
@@ -186,6 +187,7 @@
                      .eArcSupported = false,
                      .physicalAddress = mPhysicalAddress};
     mPortConnectionStatus[0] = false;
+    mHpdSignal[0] = HpdSignal::HDMI_HPD_PHYSICAL;
     mDeathRecipient = ndk::ScopedAIBinder_DeathRecipient(AIBinder_DeathRecipient_new(serviceDied));
 }
 
diff --git a/tv/hdmi/connection/aidl/default/HdmiConnectionMock.h b/tv/hdmi/connection/aidl/default/HdmiConnectionMock.h
index b879e51..c013fdd 100644
--- a/tv/hdmi/connection/aidl/default/HdmiConnectionMock.h
+++ b/tv/hdmi/connection/aidl/default/HdmiConnectionMock.h
@@ -46,8 +46,8 @@
     ::ndk::ScopedAStatus isConnected(int32_t portId, bool* _aidl_return) override;
     ::ndk::ScopedAStatus setCallback(
             const std::shared_ptr<IHdmiConnectionCallback>& callback) override;
-    ::ndk::ScopedAStatus setHpdSignal(HpdSignal signal) override;
-    ::ndk::ScopedAStatus getHpdSignal(HpdSignal* _aidl_return) override;
+    ::ndk::ScopedAStatus setHpdSignal(HpdSignal signal, int32_t portId) override;
+    ::ndk::ScopedAStatus getHpdSignal(int32_t portId, HpdSignal* _aidl_return) override;
 
     void printEventBuf(const char* msg_buf, int len);
 
@@ -70,7 +70,7 @@
     int mTotalPorts = 1;
 
     // HPD Signal being used
-    HpdSignal mHpdSignal = HpdSignal::HDMI_HPD_PHYSICAL;
+    std::vector<HpdSignal> mHpdSignal;
 
     // Testing variables
     // Input file descriptor
diff --git a/tv/hdmi/aidl/vts/functional/AndroidTest.xml b/tv/hdmi/connection/aidl/vts/functional/AndroidTest.xml
similarity index 81%
copy from tv/hdmi/aidl/vts/functional/AndroidTest.xml
copy to tv/hdmi/connection/aidl/vts/functional/AndroidTest.xml
index 0640b2d..5a7fed0 100644
--- a/tv/hdmi/aidl/vts/functional/AndroidTest.xml
+++ b/tv/hdmi/connection/aidl/vts/functional/AndroidTest.xml
@@ -13,7 +13,7 @@
      See the License for the specific language governing permissions and
      limitations under the License.
 -->
-<configuration description="Runs VtsHalTvHdmiAidlTargetTest.">
+<configuration description="Runs VtsHalTvHdmiConnectionAidlTargetTest.">
     <option name="test-suite-tag" value="apct" />
     <option name="test-suite-tag" value="apct-native" />
 
@@ -22,12 +22,12 @@
 
     <target_preparer class="com.android.tradefed.targetprep.PushFilePreparer">
         <option name="cleanup" value="true" />
-        <option name="push" value="VtsHalTvHdmiAidlTargetTest->/data/local/tmp/VtsHalTvHdmiAidlTargetTest" />
+        <option name="push" value="VtsHalTvHdmiConnectionAidlTargetTest->/data/local/tmp/VtsHalTvHdmiConnectionAidlTargetTest" />
     </target_preparer>
 
     <test class="com.android.tradefed.testtype.GTest" >
         <option name="native-test-device-path" value="/data/local/tmp" />
-        <option name="module-name" value="VtsHalTvHdmiAidlTargetTest" />
+        <option name="module-name" value="VtsHalTvHdmiConnectionAidlTargetTest" />
         <option name="native-test-timeout" value="30m" />
     </test>
 </configuration>
diff --git a/tv/hdmi/connection/aidl/vts/functional/VtsHalTvHdmiConnectionAidlTargetTest.cpp b/tv/hdmi/connection/aidl/vts/functional/VtsHalTvHdmiConnectionAidlTargetTest.cpp
index 69f7ef5..a9b288b 100644
--- a/tv/hdmi/connection/aidl/vts/functional/VtsHalTvHdmiConnectionAidlTargetTest.cpp
+++ b/tv/hdmi/connection/aidl/vts/functional/VtsHalTvHdmiConnectionAidlTargetTest.cpp
@@ -93,8 +93,8 @@
     for (size_t i = 0; i < ports.size(); ++i) {
         EXPECT_TRUE((ports[i].type == HdmiPortType::OUTPUT) ||
                     (ports[i].type == HdmiPortType::INPUT));
-        if (ports[i].portId == 0) {
-            ALOGW("%s: Port id should start from 1", __func__);
+        if (ports[i].type == HdmiPortType::OUTPUT && ports[i].portId <= 0) {
+            ALOGW("%s: Port id for output ports should start from 1", __func__);
         }
         cecSupportedOnDevice = cecSupportedOnDevice | ports[i].cecSupported;
     }
@@ -111,16 +111,21 @@
 }
 
 TEST_P(HdmiConnectionTest, HdpSignal) {
+    std::vector<HdmiPortInfo> ports;
+    ASSERT_TRUE(hdmiConnection->getPortInfo(&ports).isOk());
     HpdSignal originalSignal;
     HpdSignal signal = HpdSignal::HDMI_HPD_STATUS_BIT;
-    HpdSignal readSignal;
-    ASSERT_TRUE(hdmiConnection->getHpdSignal(&originalSignal).isOk());
-    ASSERT_TRUE(hdmiConnection->setHpdSignal(signal).isOk());
-    ASSERT_TRUE(hdmiConnection->getHpdSignal(&readSignal).isOk());
-    EXPECT_EQ(readSignal, signal);
-    signal = HpdSignal::HDMI_HPD_PHYSICAL;
-    ASSERT_TRUE(hdmiConnection->setHpdSignal(signal).isOk());
-    ASSERT_TRUE(hdmiConnection->getHpdSignal(&readSignal).isOk());
-    EXPECT_EQ(readSignal, signal);
-    ASSERT_TRUE(hdmiConnection->setHpdSignal(originalSignal).isOk());
+    for (size_t i = 0; i < ports.size(); ++i) {
+        int32_t portId = ports[i].portId;
+        HpdSignal readSignal;
+        ASSERT_TRUE(hdmiConnection->getHpdSignal(portId, &originalSignal).isOk());
+        ASSERT_TRUE(hdmiConnection->setHpdSignal(signal, portId).isOk());
+        ASSERT_TRUE(hdmiConnection->getHpdSignal(portId, &readSignal).isOk());
+        EXPECT_EQ(readSignal, signal);
+        signal = HpdSignal::HDMI_HPD_PHYSICAL;
+        ASSERT_TRUE(hdmiConnection->setHpdSignal(signal, portId).isOk());
+        ASSERT_TRUE(hdmiConnection->getHpdSignal(portId, &readSignal).isOk());
+        EXPECT_EQ(readSignal, signal);
+        ASSERT_TRUE(hdmiConnection->setHpdSignal(originalSignal, portId).isOk());
+    }
 }
diff --git a/tv/hdmi/earc/aidl/TEST_MAPPING b/tv/hdmi/earc/aidl/TEST_MAPPING
new file mode 100644
index 0000000..ccc48fc
--- /dev/null
+++ b/tv/hdmi/earc/aidl/TEST_MAPPING
@@ -0,0 +1,7 @@
+{
+  "presubmit": [
+    {
+      "name": "VtsHalTvHdmiEArcAidlTargetTest"
+    }
+  ]
+}
diff --git a/tv/hdmi/earc/aidl/default/EArcMock.cpp b/tv/hdmi/earc/aidl/default/EArcMock.cpp
index 3578999..a3ccabf 100644
--- a/tv/hdmi/earc/aidl/default/EArcMock.cpp
+++ b/tv/hdmi/earc/aidl/default/EArcMock.cpp
@@ -54,7 +54,7 @@
 ScopedAStatus EArcMock::getState(int32_t portId, IEArcStatus* _aidl_return) {
     // Maintain port connection status and update on hotplug event
     if (portId <= mTotalPorts && portId >= 1) {
-        *_aidl_return = mPortStatus[portId];
+        *_aidl_return = mPortStatus.at(portId - 1);
     } else {
         return ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT);
     }
@@ -65,7 +65,7 @@
 ScopedAStatus EArcMock::getLastReportedAudioCapabilities(int32_t portId,
                                                          std::vector<uint8_t>* _aidl_return) {
     if (portId <= mTotalPorts && portId >= 1) {
-        *_aidl_return = mCapabilities[portId];
+        *_aidl_return = mCapabilities.at(portId - 1);
     } else {
         return ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT);
     }
@@ -85,7 +85,7 @@
     return ScopedAStatus::ok();
 }
 
-ScopedAStatus EArcMock::reportCapabilities(const std::vector<uint8_t> capabilities,
+ScopedAStatus EArcMock::reportCapabilities(const std::vector<uint8_t>& capabilities,
                                            int32_t portId) {
     if (mCallback != nullptr) {
         mCallback->onCapabilitiesReported(capabilities, portId);
diff --git a/tv/hdmi/earc/aidl/default/EArcMock.h b/tv/hdmi/earc/aidl/default/EArcMock.h
index fc4c828..8af9706 100644
--- a/tv/hdmi/earc/aidl/default/EArcMock.h
+++ b/tv/hdmi/earc/aidl/default/EArcMock.h
@@ -43,7 +43,7 @@
     ::ndk::ScopedAStatus getState(int32_t in_portId, IEArcStatus* _aidl_return) override;
     ::ndk::ScopedAStatus getLastReportedAudioCapabilities(
             int32_t in_portId, std::vector<uint8_t>* _aidl_return) override;
-    ::ndk::ScopedAStatus reportCapabilities(const std::vector<uint8_t> capabilities,
+    ::ndk::ScopedAStatus reportCapabilities(const std::vector<uint8_t>& capabilities,
                                             int32_t portId);
     ::ndk::ScopedAStatus changeState(const IEArcStatus status, int32_t portId);
 
diff --git a/tv/hdmi/aidl/vts/functional/AndroidTest.xml b/tv/hdmi/earc/aidl/vts/functional/AndroidTest.xml
similarity index 82%
rename from tv/hdmi/aidl/vts/functional/AndroidTest.xml
rename to tv/hdmi/earc/aidl/vts/functional/AndroidTest.xml
index 0640b2d..12dd1e4 100644
--- a/tv/hdmi/aidl/vts/functional/AndroidTest.xml
+++ b/tv/hdmi/earc/aidl/vts/functional/AndroidTest.xml
@@ -13,7 +13,7 @@
      See the License for the specific language governing permissions and
      limitations under the License.
 -->
-<configuration description="Runs VtsHalTvHdmiAidlTargetTest.">
+<configuration description="Runs VtsHalTvHdmiEArcAidlTargetTest.">
     <option name="test-suite-tag" value="apct" />
     <option name="test-suite-tag" value="apct-native" />
 
@@ -22,12 +22,12 @@
 
     <target_preparer class="com.android.tradefed.targetprep.PushFilePreparer">
         <option name="cleanup" value="true" />
-        <option name="push" value="VtsHalTvHdmiAidlTargetTest->/data/local/tmp/VtsHalTvHdmiAidlTargetTest" />
+        <option name="push" value="VtsHalTvHdmiEArcAidlTargetTest->/data/local/tmp/VtsHalTvHdmiEArcAidlTargetTest" />
     </target_preparer>
 
     <test class="com.android.tradefed.testtype.GTest" >
         <option name="native-test-device-path" value="/data/local/tmp" />
-        <option name="module-name" value="VtsHalTvHdmiAidlTargetTest" />
+        <option name="module-name" value="VtsHalTvHdmiEArcAidlTargetTest" />
         <option name="native-test-timeout" value="30m" />
     </test>
 </configuration>
diff --git a/tv/input/OWNERS b/tv/input/OWNERS
index a02291a..ae65f67 100644
--- a/tv/input/OWNERS
+++ b/tv/input/OWNERS
@@ -1,3 +1,4 @@
+# Bug component: 105688
 hgchen@google.com
 shubang@google.com
 quxiangfang@google.com
diff --git a/tv/input/aidl/Android.bp b/tv/input/aidl/Android.bp
index 1987174..2591151 100644
--- a/tv/input/aidl/Android.bp
+++ b/tv/input/aidl/Android.bp
@@ -14,6 +14,7 @@
     imports: [
         "android.hardware.common-V2",
         "android.media.audio.common.types-V1",
+        "android.hardware.common.fmq-V1",
     ],
     stability: "vintf",
     backend: {
diff --git a/tv/input/aidl/TEST_MAPPING b/tv/input/aidl/TEST_MAPPING
new file mode 100644
index 0000000..981e46f
--- /dev/null
+++ b/tv/input/aidl/TEST_MAPPING
@@ -0,0 +1,7 @@
+{
+  "presubmit": [
+    {
+      "name": "VtsHalTvInputTargetTest"
+    }
+  ]
+}
diff --git a/tv/input/aidl/aidl_api/android.hardware.tv.input/current/android/hardware/tv/input/ITvInput.aidl b/tv/input/aidl/aidl_api/android.hardware.tv.input/current/android/hardware/tv/input/ITvInput.aidl
index f8d5e05..84fe2fb 100644
--- a/tv/input/aidl/aidl_api/android.hardware.tv.input/current/android/hardware/tv/input/ITvInput.aidl
+++ b/tv/input/aidl/aidl_api/android.hardware.tv.input/current/android/hardware/tv/input/ITvInput.aidl
@@ -38,6 +38,8 @@
   android.hardware.tv.input.TvStreamConfig[] getStreamConfigurations(in int deviceId);
   android.hardware.common.NativeHandle openStream(in int deviceId, in int streamId);
   void setCallback(in android.hardware.tv.input.ITvInputCallback callback);
+  void setTvMessageEnabled(int deviceId, int streamId, in android.hardware.tv.input.TvMessageEventType type, boolean enabled);
+  void getTvMessageQueueDesc(out android.hardware.common.fmq.MQDescriptor<byte,android.hardware.common.fmq.SynchronizedReadWrite> queue, int deviceId, int streamId);
   const int STATUS_UNKNOWN = 1;
   const int STATUS_NO_RESOURCE = 2;
   const int STATUS_INVALID_ARGUMENTS = 3;
diff --git a/tv/input/aidl/aidl_api/android.hardware.tv.input/current/android/hardware/tv/input/ITvInputCallback.aidl b/tv/input/aidl/aidl_api/android.hardware.tv.input/current/android/hardware/tv/input/ITvInputCallback.aidl
index 7f2aff6..9747013 100644
--- a/tv/input/aidl/aidl_api/android.hardware.tv.input/current/android/hardware/tv/input/ITvInputCallback.aidl
+++ b/tv/input/aidl/aidl_api/android.hardware.tv.input/current/android/hardware/tv/input/ITvInputCallback.aidl
@@ -35,4 +35,5 @@
 @VintfStability
 interface ITvInputCallback {
   void notify(in android.hardware.tv.input.TvInputEvent event);
+  void notifyTvMessageEvent(in android.hardware.tv.input.TvMessageEvent event);
 }
diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/MediaProtocolType.aidl b/tv/input/aidl/aidl_api/android.hardware.tv.input/current/android/hardware/tv/input/TvMessage.aidl
similarity index 89%
copy from radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/MediaProtocolType.aidl
copy to tv/input/aidl/aidl_api/android.hardware.tv.input/current/android/hardware/tv/input/TvMessage.aidl
index 1a290d4..637b01c 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/MediaProtocolType.aidl
+++ b/tv/input/aidl/aidl_api/android.hardware.tv.input/current/android/hardware/tv/input/TvMessage.aidl
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright 2022 The Android Open Source Project
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -31,9 +31,10 @@
 // with such a backward incompatible change, it has a high risk of breaking
 // later when a module using the interface is updated, e.g., Mainline modules.
 
-package android.hardware.radio.ims.media;
-@Backing(type="int") @VintfStability
-enum MediaProtocolType {
-  RTP = 0,
-  RTCP = 1,
+package android.hardware.tv.input;
+@VintfStability
+parcelable TvMessage {
+  String subType;
+  long groupId;
+  int dataLengthBytes;
 }
diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/AnbrBitrate.aidl b/tv/input/aidl/aidl_api/android.hardware.tv.input/current/android/hardware/tv/input/TvMessageEvent.aidl
similarity index 87%
copy from radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/AnbrBitrate.aidl
copy to tv/input/aidl/aidl_api/android.hardware.tv.input/current/android/hardware/tv/input/TvMessageEvent.aidl
index 711ac19..94fe665 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/AnbrBitrate.aidl
+++ b/tv/input/aidl/aidl_api/android.hardware.tv.input/current/android/hardware/tv/input/TvMessageEvent.aidl
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2022 The Android Open Source Project
+ * Copyright 2022 The Android Open Source Project
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -31,10 +31,10 @@
 // with such a backward incompatible change, it has a high risk of breaking
 // later when a module using the interface is updated, e.g., Mainline modules.
 
-package android.hardware.radio.ims.media;
+package android.hardware.tv.input;
 @VintfStability
-parcelable AnbrBitrate {
-  int uplinkBps;
-  int downlinkBps;
-  const int INVALID_ANBR_BITRATE = -1;
+parcelable TvMessageEvent {
+  android.hardware.tv.input.TvMessageEventType type;
+  int streamId;
+  android.hardware.tv.input.TvMessage[] messages;
 }
diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/MediaProtocolType.aidl b/tv/input/aidl/aidl_api/android.hardware.tv.input/current/android/hardware/tv/input/TvMessageEventType.aidl
similarity index 90%
rename from radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/MediaProtocolType.aidl
rename to tv/input/aidl/aidl_api/android.hardware.tv.input/current/android/hardware/tv/input/TvMessageEventType.aidl
index 1a290d4..a033903 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/MediaProtocolType.aidl
+++ b/tv/input/aidl/aidl_api/android.hardware.tv.input/current/android/hardware/tv/input/TvMessageEventType.aidl
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright 2022 The Android Open Source Project
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -31,9 +31,10 @@
 // with such a backward incompatible change, it has a high risk of breaking
 // later when a module using the interface is updated, e.g., Mainline modules.
 
-package android.hardware.radio.ims.media;
+package android.hardware.tv.input;
 @Backing(type="int") @VintfStability
-enum MediaProtocolType {
-  RTP = 0,
-  RTCP = 1,
+enum TvMessageEventType {
+  WATERMARK = 1,
+  CLOSED_CAPTION = 2,
+  OTHER = 3,
 }
diff --git a/tv/input/aidl/android/hardware/tv/input/ITvInput.aidl b/tv/input/aidl/android/hardware/tv/input/ITvInput.aidl
index 31d6586..cbaf066 100644
--- a/tv/input/aidl/android/hardware/tv/input/ITvInput.aidl
+++ b/tv/input/aidl/android/hardware/tv/input/ITvInput.aidl
@@ -17,7 +17,10 @@
 package android.hardware.tv.input;
 
 import android.hardware.common.NativeHandle;
+import android.hardware.common.fmq.MQDescriptor;
+import android.hardware.common.fmq.SynchronizedReadWrite;
 import android.hardware.tv.input.ITvInputCallback;
+import android.hardware.tv.input.TvMessageEventType;
 import android.hardware.tv.input.TvStreamConfig;
 
 @VintfStability
@@ -73,4 +76,32 @@
      * @throws ServiceSpecificException with values from the ITvInput::STATUS_* constants
      */
     void setCallback(in ITvInputCallback callback);
+
+    /**
+     * Enables or disables TV message detection for the specified stream on the device.
+     *
+     * @param deviceId The ID of the device that contains the stream to set the flag for.
+     * @param streamId The ID of the stream to set the flag for.
+     * @param type The type of {@link android.hardware.tv.input.TvMessageEventType}.
+     * @param enabled {@code true} if you want to enable TV message detection
+     *                {@code false} otherwise.
+     */
+    void setTvMessageEnabled(
+            int deviceId, int streamId, in TvMessageEventType type, boolean enabled);
+
+    /**
+     * Gets the TV message queue for the specified stream on the device.
+     *
+     * The FMQ is used to relay events that are parsed from the specified stream to the
+     * app or service responsible for processing the message. The HAL implementation
+     * is expected to parse these messages and add them to the queue as new events are
+     * detected from the stream based on whether or not they are enabled by
+     * {@link #setTvMessageEnabled(int, int, TvMessageEventType, boolean)}.
+     *
+     * @param deviceId The ID of the device that contains the stream to get the queue for.
+     * @param streamId THe ID of the stream to get the queue for.
+     * @return The descriptor of the TV message queue.
+     */
+    void getTvMessageQueueDesc(
+            out MQDescriptor<byte, SynchronizedReadWrite> queue, int deviceId, int streamId);
 }
diff --git a/tv/input/aidl/android/hardware/tv/input/ITvInputCallback.aidl b/tv/input/aidl/android/hardware/tv/input/ITvInputCallback.aidl
index fc7492d..5d47317 100644
--- a/tv/input/aidl/android/hardware/tv/input/ITvInputCallback.aidl
+++ b/tv/input/aidl/android/hardware/tv/input/ITvInputCallback.aidl
@@ -17,6 +17,7 @@
 package android.hardware.tv.input;
 
 import android.hardware.tv.input.TvInputEvent;
+import android.hardware.tv.input.TvMessageEvent;
 
 @VintfStability
 interface ITvInputCallback {
@@ -27,4 +28,11 @@
      * @param event Event passed to the client.
      */
     void notify(in TvInputEvent event);
+    /**
+     * Notifies the client that an TV message event has occurred. For possible event types,
+     * check TvMessageEventType.
+     *
+     * @param event Event passed to the client.
+     */
+    void notifyTvMessageEvent(in TvMessageEvent event);
 }
diff --git a/tv/input/aidl/android/hardware/tv/input/TvMessage.aidl b/tv/input/aidl/android/hardware/tv/input/TvMessage.aidl
new file mode 100644
index 0000000..6df1f9a
--- /dev/null
+++ b/tv/input/aidl/android/hardware/tv/input/TvMessage.aidl
@@ -0,0 +1,35 @@
+/*
+ * Copyright 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.tv.input;
+
+@VintfStability
+parcelable TvMessage {
+    /**
+     * Extended data type, like “ATSC A/336 Watermark”, “ATSC_CC”, etc. This is opaque
+     * to the framework.
+     */
+    String subType;
+    /**
+     * This group id is used to optionally identify messages that belong together, such as
+     * headers and bodies of the same event. For messages that do not have a group, this value
+     * should be -1.
+     *
+     * As -1 is a reserved value, -1 should not be used as a valid groupId.
+     */
+    long groupId;
+    int dataLengthBytes;
+}
diff --git a/radio/aidl/android/hardware/radio/ims/media/MediaProtocolType.aidl b/tv/input/aidl/android/hardware/tv/input/TvMessageEvent.aidl
similarity index 66%
copy from radio/aidl/android/hardware/radio/ims/media/MediaProtocolType.aidl
copy to tv/input/aidl/android/hardware/tv/input/TvMessageEvent.aidl
index 325c6fa..74a078a 100644
--- a/radio/aidl/android/hardware/radio/ims/media/MediaProtocolType.aidl
+++ b/tv/input/aidl/android/hardware/tv/input/TvMessageEvent.aidl
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright 2022 The Android Open Source Project
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -14,13 +14,15 @@
  * limitations under the License.
  */
 
-package android.hardware.radio.ims.media;
+package android.hardware.tv.input;
+
+import android.hardware.tv.input.TvMessage;
+import android.hardware.tv.input.TvMessageEventType;
 
 @VintfStability
-@Backing(type="int")
-enum MediaProtocolType {
-   /** Real Time Protocol, see RFC 3550 */
-   RTP = 0,
-   /** Real Time Control Protocol, see RFC 3550 */
-   RTCP = 1,
+parcelable TvMessageEvent {
+    TvMessageEventType type;
+
+    int streamId;
+    TvMessage[] messages;
 }
diff --git a/radio/aidl/android/hardware/radio/ims/media/MediaProtocolType.aidl b/tv/input/aidl/android/hardware/tv/input/TvMessageEventType.aidl
similarity index 71%
copy from radio/aidl/android/hardware/radio/ims/media/MediaProtocolType.aidl
copy to tv/input/aidl/android/hardware/tv/input/TvMessageEventType.aidl
index 325c6fa..5a5f472 100644
--- a/radio/aidl/android/hardware/radio/ims/media/MediaProtocolType.aidl
+++ b/tv/input/aidl/android/hardware/tv/input/TvMessageEventType.aidl
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright 2022 The Android Open Source Project
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -14,13 +14,12 @@
  * limitations under the License.
  */
 
-package android.hardware.radio.ims.media;
+package android.hardware.tv.input;
 
 @VintfStability
 @Backing(type="int")
-enum MediaProtocolType {
-   /** Real Time Protocol, see RFC 3550 */
-   RTP = 0,
-   /** Real Time Control Protocol, see RFC 3550 */
-   RTCP = 1,
+enum TvMessageEventType {
+    WATERMARK = 1,
+    CLOSED_CAPTION = 2,
+    OTHER = 3,
 }
diff --git a/tv/input/aidl/default/Android.bp b/tv/input/aidl/default/Android.bp
index 66148c8..05af6a9 100644
--- a/tv/input/aidl/default/Android.bp
+++ b/tv/input/aidl/default/Android.bp
@@ -13,6 +13,10 @@
     init_rc: ["input-default.rc"],
     vintf_fragments: ["input-default.xml"],
     vendor: true,
+    cflags: [
+        "-Werror",
+        "-Wno-unused-parameter",
+    ],
     srcs: [
         "TvInput.cpp",
         "service.cpp",
@@ -23,9 +27,11 @@
     shared_libs: [
         "libbase",
         "liblog",
+        "libfmq",
         "libutils",
         "libcutils",
         "libbinder_ndk",
         "android.hardware.tv.input-V1-ndk",
+        "android.hardware.common.fmq-V1-ndk",
     ],
 }
diff --git a/tv/input/aidl/default/TvInput.cpp b/tv/input/aidl/default/TvInput.cpp
index ed12cbc..c986ef1 100644
--- a/tv/input/aidl/default/TvInput.cpp
+++ b/tv/input/aidl/default/TvInput.cpp
@@ -65,6 +65,21 @@
     return ::ndk::ScopedAStatus::ok();
 }
 
+::ndk::ScopedAStatus TvInput::setTvMessageEnabled(int32_t deviceId, int32_t streamId,
+                                                  TvMessageEventType in_type, bool enabled) {
+    ALOGV("%s", __FUNCTION__);
+    // TODO: Implement this
+    return ::ndk::ScopedAStatus::ok();
+}
+
+::ndk::ScopedAStatus TvInput::getTvMessageQueueDesc(
+        MQDescriptor<int8_t, SynchronizedReadWrite>* out_queue, int32_t in_deviceId,
+        int32_t in_streamId) {
+    ALOGV("%s", __FUNCTION__);
+    // TODO: Implement this
+    return ::ndk::ScopedAStatus::ok();
+}
+
 ::ndk::ScopedAStatus TvInput::getStreamConfigurations(int32_t in_deviceId,
                                                       vector<TvStreamConfig>* _aidl_return) {
     ALOGV("%s", __FUNCTION__);
@@ -95,8 +110,8 @@
         return ::ndk::ScopedAStatus::fromServiceSpecificError(STATUS_INVALID_STATE);
     }
     mStreamConfigs[in_deviceId][in_streamId]->handle = createNativeHandle(in_streamId);
-    mStreamConfigs[in_deviceId][in_streamId]->isOpen = true;
     *_aidl_return = makeToAidl(mStreamConfigs[in_deviceId][in_streamId]->handle);
+    mStreamConfigs[in_deviceId][in_streamId]->isOpen = true;
     return ::ndk::ScopedAStatus::ok();
 }
 
@@ -112,27 +127,21 @@
         ALOGW("Stream with device id %d, stream id %d is already closed", in_deviceId, in_streamId);
         return ::ndk::ScopedAStatus::fromServiceSpecificError(STATUS_INVALID_STATE);
     }
-    releaseNativeHandle(mStreamConfigs[in_deviceId][in_streamId]->handle);
+    native_handle_delete(mStreamConfigs[in_deviceId][in_streamId]->handle);
     mStreamConfigs[in_deviceId][in_streamId]->handle = nullptr;
     mStreamConfigs[in_deviceId][in_streamId]->isOpen = false;
     return ::ndk::ScopedAStatus::ok();
 }
 
 native_handle_t* TvInput::createNativeHandle(int fd) {
-    native_handle_t* nativeHandle = native_handle_create(1, 0);
-    if (nativeHandle == nullptr) {
+    native_handle_t* handle = native_handle_create(1, 1);
+    if (handle == nullptr) {
         ALOGE("[TVInput] Failed to create native_handle %d", errno);
         return nullptr;
     }
-    if (nativeHandle->numFds > 0) {
-        nativeHandle->data[0] = dup(fd);
-    }
-    return nativeHandle;
-}
-
-void TvInput::releaseNativeHandle(native_handle_t* handle) {
-    native_handle_close(handle);
-    native_handle_delete(handle);
+    handle->data[0] = dup(0);
+    handle->data[1] = fd;
+    return handle;
 }
 
 }  // namespace input
diff --git a/tv/input/aidl/default/TvInput.h b/tv/input/aidl/default/TvInput.h
index a72bca3..92e7d4c 100644
--- a/tv/input/aidl/default/TvInput.h
+++ b/tv/input/aidl/default/TvInput.h
@@ -19,6 +19,8 @@
 #include <aidl/android/hardware/tv/input/BnTvInput.h>
 #include <utils/KeyedVector.h>
 
+#include <aidl/android/hardware/tv/input/TvMessageEventType.h>
+#include <fmq/AidlMessageQueue.h>
 #include <map>
 #include "TvInputDeviceInfoWrapper.h"
 #include "TvStreamConfigWrapper.h"
@@ -26,6 +28,9 @@
 using namespace android;
 using namespace std;
 using ::aidl::android::hardware::common::NativeHandle;
+using ::aidl::android::hardware::common::fmq::MQDescriptor;
+using ::aidl::android::hardware::common::fmq::SynchronizedReadWrite;
+using ::android::AidlMessageQueue;
 
 namespace aidl {
 namespace android {
@@ -38,6 +43,11 @@
     TvInput();
 
     ::ndk::ScopedAStatus setCallback(const shared_ptr<ITvInputCallback>& in_callback) override;
+    ::ndk::ScopedAStatus setTvMessageEnabled(int32_t deviceId, int32_t streamId,
+                                             TvMessageEventType in_type, bool enabled) override;
+    ::ndk::ScopedAStatus getTvMessageQueueDesc(
+            MQDescriptor<int8_t, SynchronizedReadWrite>* out_queue, int32_t in_deviceId,
+            int32_t in_streamId) override;
     ::ndk::ScopedAStatus getStreamConfigurations(int32_t in_deviceId,
                                                  vector<TvStreamConfig>* _aidl_return) override;
     ::ndk::ScopedAStatus openStream(int32_t in_deviceId, int32_t in_streamId,
@@ -48,7 +58,6 @@
 
   private:
     native_handle_t* createNativeHandle(int fd);
-    void releaseNativeHandle(native_handle_t* handle);
 
     shared_ptr<ITvInputCallback> mCallback;
     map<int32_t, shared_ptr<TvInputDeviceInfoWrapper>> mDeviceInfos;
diff --git a/tv/input/aidl/vts/functional/Android.bp b/tv/input/aidl/vts/functional/Android.bp
index 9829b6d..22487ea 100644
--- a/tv/input/aidl/vts/functional/Android.bp
+++ b/tv/input/aidl/vts/functional/Android.bp
@@ -9,10 +9,16 @@
 
 cc_test {
     name: "VtsHalTvInputTargetTest",
-    defaults: ["VtsHalTargetTestDefaults","use_libaidlvintf_gtest_helper_static",],
+    defaults: [
+        "VtsHalTargetTestDefaults",
+        "use_libaidlvintf_gtest_helper_static",
+    ],
+    cflags: [
+        "-Werror",
+        "-Wno-unused-parameter",
+    ],
     srcs: ["VtsHalTvInputTargetTest.cpp"],
     static_libs: [
-        "android.hardware.tv.input-V1-ndk",
         "android.media.audio.common.types-V1-ndk",
         "android.hardware.common-V2-ndk",
         "libaidlcommonsupport",
@@ -24,6 +30,9 @@
     shared_libs: [
         "libbinder_ndk",
         "libvndksupport",
+        "libfmq",
+        "android.hardware.common.fmq-V1-ndk",
+        "android.hardware.tv.input-V1-ndk",
     ],
     require_root: true,
 }
diff --git a/tv/hdmi/aidl/vts/functional/AndroidTest.xml b/tv/input/aidl/vts/functional/AndroidTest.xml
similarity index 79%
copy from tv/hdmi/aidl/vts/functional/AndroidTest.xml
copy to tv/input/aidl/vts/functional/AndroidTest.xml
index 0640b2d..5549102 100644
--- a/tv/hdmi/aidl/vts/functional/AndroidTest.xml
+++ b/tv/input/aidl/vts/functional/AndroidTest.xml
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright 2021 The Android Open Source Project
+<!-- Copyright 2023 The Android Open Source Project
 
      Licensed under the Apache License, Version 2.0 (the "License");
      you may not use this file except in compliance with the License.
@@ -13,7 +13,7 @@
      See the License for the specific language governing permissions and
      limitations under the License.
 -->
-<configuration description="Runs VtsHalTvHdmiAidlTargetTest.">
+<configuration description="Runs VtsHalTvInputTargetTest.">
     <option name="test-suite-tag" value="apct" />
     <option name="test-suite-tag" value="apct-native" />
 
@@ -22,12 +22,12 @@
 
     <target_preparer class="com.android.tradefed.targetprep.PushFilePreparer">
         <option name="cleanup" value="true" />
-        <option name="push" value="VtsHalTvHdmiAidlTargetTest->/data/local/tmp/VtsHalTvHdmiAidlTargetTest" />
+        <option name="push" value="VtsHalTvInputTargetTest->/data/local/tmp/VtsHalTvInputTargetTest" />
     </target_preparer>
 
     <test class="com.android.tradefed.testtype.GTest" >
         <option name="native-test-device-path" value="/data/local/tmp" />
-        <option name="module-name" value="VtsHalTvHdmiAidlTargetTest" />
+        <option name="module-name" value="VtsHalTvInputTargetTest" />
         <option name="native-test-timeout" value="30m" />
     </test>
 </configuration>
diff --git a/tv/input/aidl/vts/functional/VtsHalTvInputTargetTest.cpp b/tv/input/aidl/vts/functional/VtsHalTvInputTargetTest.cpp
index ec83e29..a2415b4 100644
--- a/tv/input/aidl/vts/functional/VtsHalTvInputTargetTest.cpp
+++ b/tv/input/aidl/vts/functional/VtsHalTvInputTargetTest.cpp
@@ -43,6 +43,11 @@
     return ::ndk::ScopedAStatus::ok();
 }
 
+::ndk::ScopedAStatus TvInputAidlTest::TvInputCallback::notifyTvMessageEvent(
+        const TvMessageEvent& in_event) {
+    return ::ndk::ScopedAStatus::ok();
+}
+
 void TvInputAidlTest::SetUp() {
     if (AServiceManager_isDeclared(GetParam().c_str())) {
         ::ndk::SpAIBinder binder(AServiceManager_waitForService(GetParam().c_str()));
@@ -158,10 +163,11 @@
         int32_t device_id = stream_config_.keyAt(j);
         vector<TvStreamConfig> config = stream_config_.valueAt(j);
         for (size_t i = 0; i < config.size(); i++) {
+            NativeHandle handle;
             int32_t stream_id = config[i].streamId;
             ALOGD("OpenAndCloseStreamTest: open stream, device_id=%d, stream_id=%d", device_id,
                   stream_id);
-            ASSERT_TRUE(tv_input_->openStream(device_id, stream_id, &handle_).isOk());
+            ASSERT_TRUE(tv_input_->openStream(device_id, stream_id, &handle).isOk());
             ALOGD("OpenAndCloseStreamTest: close stream, device_id=%d, stream_id=%d", device_id,
                   stream_id);
             ASSERT_TRUE(tv_input_->closeStream(device_id, stream_id).isOk());
@@ -190,9 +196,10 @@
                 ITvInput::STATUS_INVALID_ARGUMENTS);
 
     int32_t stream_id = 0;
+    NativeHandle handle;
 
     ALOGD("InvalidDeviceIdTest: open stream, device_id=%d, stream_id=%d", id, stream_id);
-    ASSERT_TRUE(tv_input_->openStream(id, stream_id, &handle_).getServiceSpecificError() ==
+    ASSERT_TRUE(tv_input_->openStream(id, stream_id, &handle).getServiceSpecificError() ==
                 ITvInput::STATUS_INVALID_ARGUMENTS);
 
     ALOGD("InvalidDeviceIdTest: close stream, device_id=%d, stream_id=%d", id, stream_id);
@@ -226,8 +233,10 @@
         id = getNumNotIn(stream_ids);
     }
 
+    NativeHandle handle;
+
     ALOGD("InvalidStreamIdTest: open stream, device_id=%d, stream_id=%d", device_id, id);
-    ASSERT_TRUE(tv_input_->openStream(device_id, id, &handle_).getServiceSpecificError() ==
+    ASSERT_TRUE(tv_input_->openStream(device_id, id, &handle).getServiceSpecificError() ==
                 ITvInput::STATUS_INVALID_ARGUMENTS);
 
     ALOGD("InvalidStreamIdTest: close stream, device_id=%d, stream_id=%d", device_id, id);
@@ -252,11 +261,13 @@
     int32_t device_id = stream_config_.keyAt(indices[0]);
     int32_t stream_id = stream_config_.valueAt(indices[0])[0].streamId;
 
-    ALOGD("OpenAnOpenedStreamsTest: open stream, device_id=%d, stream_id=%d", device_id, stream_id);
-    ASSERT_TRUE(tv_input_->openStream(device_id, stream_id, &handle_).isOk());
+    NativeHandle handle;
 
     ALOGD("OpenAnOpenedStreamsTest: open stream, device_id=%d, stream_id=%d", device_id, stream_id);
-    ASSERT_TRUE(tv_input_->openStream(device_id, stream_id, &handle_).getServiceSpecificError() ==
+    ASSERT_TRUE(tv_input_->openStream(device_id, stream_id, &handle).isOk());
+
+    ALOGD("OpenAnOpenedStreamsTest: open stream, device_id=%d, stream_id=%d", device_id, stream_id);
+    ASSERT_TRUE(tv_input_->openStream(device_id, stream_id, &handle).getServiceSpecificError() ==
                 ITvInput::STATUS_INVALID_STATE);
 
     // close stream as subsequent tests assume no open streams
diff --git a/tv/input/aidl/vts/functional/VtsHalTvInputTargetTest.h b/tv/input/aidl/vts/functional/VtsHalTvInputTargetTest.h
index c76e568..20d9227 100644
--- a/tv/input/aidl/vts/functional/VtsHalTvInputTargetTest.h
+++ b/tv/input/aidl/vts/functional/VtsHalTvInputTargetTest.h
@@ -25,15 +25,19 @@
 #include <aidl/android/hardware/tv/input/ITvInput.h>
 #include <aidl/android/hardware/tv/input/TvInputDeviceInfo.h>
 #include <aidl/android/hardware/tv/input/TvInputEvent.h>
+#include <aidl/android/hardware/tv/input/TvMessageEvent.h>
+#include <aidl/android/hardware/tv/input/TvMessageEventType.h>
 #include <aidl/android/hardware/tv/input/TvStreamConfig.h>
+#include <fmq/AidlMessageQueue.h>
 
 #include <log/log.h>
 #include <utils/KeyedVector.h>
 
 using namespace aidl::android::hardware::tv::input;
 using namespace std;
-
 using ::aidl::android::hardware::common::NativeHandle;
+using ::aidl::android::hardware::common::fmq::MQDescriptor;
+using ::android::AidlMessageQueue;
 
 #define WAIT_FOR_EVENT_TIMEOUT 5
 #define DEFAULT_ID INT32_MIN
@@ -46,6 +50,7 @@
       public:
         TvInputCallback(shared_ptr<TvInputAidlTest> parent);
         ::ndk::ScopedAStatus notify(const TvInputEvent& in_event) override;
+        ::ndk::ScopedAStatus notifyTvMessageEvent(const TvMessageEvent& in_event) override;
 
       private:
         shared_ptr<TvInputAidlTest> parent_;
@@ -84,7 +89,6 @@
     android::KeyedVector<int32_t, TvInputDeviceInfo> device_info_;
     android::KeyedVector<int32_t, vector<TvStreamConfig>> stream_config_;
     mutex mutex_;
-    NativeHandle handle_;
 };
 
 }  // namespace VtsHalTvInputTargetTest
diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/AnbrBitrate.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/AudioPreselection.aidl
similarity index 79%
copy from radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/AnbrBitrate.aidl
copy to tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/AudioPreselection.aidl
index 711ac19..ab0404e 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/AnbrBitrate.aidl
+++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/AudioPreselection.aidl
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2022 The Android Open Source Project
+ * Copyright 2022 The Android Open Source Project
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -31,10 +31,15 @@
 // with such a backward incompatible change, it has a high risk of breaking
 // later when a module using the interface is updated, e.g., Mainline modules.
 
-package android.hardware.radio.ims.media;
+package android.hardware.tv.tuner;
+/* @hide */
 @VintfStability
-parcelable AnbrBitrate {
-  int uplinkBps;
-  int downlinkBps;
-  const int INVALID_ANBR_BITRATE = -1;
+parcelable AudioPreselection {
+  int preselectionId;
+  android.hardware.tv.tuner.AudioPreselectionLabel[] labels;
+  String language;
+  android.hardware.tv.tuner.AudioPreselectionRenderingIndicationType renderingIndication;
+  boolean hasAudioDescription;
+  boolean hasSpokenSubtitles;
+  boolean hasDialogueEnhancement;
 }
diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/MediaProtocolType.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/AudioPreselectionLabel.aidl
similarity index 89%
copy from radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/MediaProtocolType.aidl
copy to tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/AudioPreselectionLabel.aidl
index 1a290d4..79f3b6f 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/MediaProtocolType.aidl
+++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/AudioPreselectionLabel.aidl
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright 2022 The Android Open Source Project
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -31,9 +31,10 @@
 // with such a backward incompatible change, it has a high risk of breaking
 // later when a module using the interface is updated, e.g., Mainline modules.
 
-package android.hardware.radio.ims.media;
-@Backing(type="int") @VintfStability
-enum MediaProtocolType {
-  RTP = 0,
-  RTCP = 1,
+package android.hardware.tv.tuner;
+/* @hide */
+@VintfStability
+parcelable AudioPreselectionLabel {
+  String language;
+  String text;
 }
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleApPowerStateConfigFlag.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/AudioPreselectionRenderingIndicationType.aidl
similarity index 86%
copy from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleApPowerStateConfigFlag.aidl
copy to tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/AudioPreselectionRenderingIndicationType.aidl
index d7b874a..783511f 100644
--- a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleApPowerStateConfigFlag.aidl
+++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/AudioPreselectionRenderingIndicationType.aidl
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright 2022 The Android Open Source Project
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -31,10 +31,13 @@
 // with such a backward incompatible change, it has a high risk of breaking
 // later when a module using the interface is updated, e.g., Mainline modules.
 
-package android.hardware.automotive.vehicle;
+package android.hardware.tv.tuner;
+/* @hide */
 @Backing(type="int") @VintfStability
-enum VehicleApPowerStateConfigFlag {
-  ENABLE_DEEP_SLEEP_FLAG = 1,
-  CONFIG_SUPPORT_TIMER_POWER_ON_FLAG = 2,
-  ENABLE_HIBERNATION_FLAG = 4,
+enum AudioPreselectionRenderingIndicationType {
+  NOT_INDICATED = 0,
+  STEREO = 1,
+  TWO_DIMENSIONAL = 2,
+  THREE_DIMENSIONAL = 3,
+  HEADPHONE = 4,
 }
diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/AnbrBitrate.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/AudioPresentation.aidl
similarity index 87%
copy from radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/AnbrBitrate.aidl
copy to tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/AudioPresentation.aidl
index 711ac19..96a6d98 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/AnbrBitrate.aidl
+++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/AudioPresentation.aidl
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2022 The Android Open Source Project
+ * Copyright 2022 The Android Open Source Project
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -31,10 +31,10 @@
 // with such a backward incompatible change, it has a high risk of breaking
 // later when a module using the interface is updated, e.g., Mainline modules.
 
-package android.hardware.radio.ims.media;
+package android.hardware.tv.tuner;
+/* @hide */
 @VintfStability
-parcelable AnbrBitrate {
-  int uplinkBps;
-  int downlinkBps;
-  const int INVALID_ANBR_BITRATE = -1;
+parcelable AudioPresentation {
+  android.hardware.tv.tuner.AudioPreselection preselection;
+  int ac4ShortProgramId = -1;
 }
diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterMediaEventExtraMetaData.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterMediaEventExtraMetaData.aidl
index ab36188..28caf19 100644
--- a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterMediaEventExtraMetaData.aidl
+++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterMediaEventExtraMetaData.aidl
@@ -37,4 +37,5 @@
 union DemuxFilterMediaEventExtraMetaData {
   boolean noinit;
   android.hardware.tv.tuner.AudioExtraMetaData audio;
+  android.hardware.tv.tuner.AudioPresentation[] audioPresentations = {};
 }
diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/MediaProtocolType.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxInfo.aidl
similarity index 89%
copy from radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/MediaProtocolType.aidl
copy to tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxInfo.aidl
index 1a290d4..872d963 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/MediaProtocolType.aidl
+++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxInfo.aidl
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright 2021 The Android Open Source Project
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -31,9 +31,9 @@
 // with such a backward incompatible change, it has a high risk of breaking
 // later when a module using the interface is updated, e.g., Mainline modules.
 
-package android.hardware.radio.ims.media;
-@Backing(type="int") @VintfStability
-enum MediaProtocolType {
-  RTP = 0,
-  RTCP = 1,
+package android.hardware.tv.tuner;
+/* @hide */
+@VintfStability
+parcelable DemuxInfo {
+  int filterTypes = 0;
 }
diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/AnbrBitrate.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendIptvSettings.aidl
similarity index 75%
copy from radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/AnbrBitrate.aidl
copy to tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendIptvSettings.aidl
index 711ac19..73582f3 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/AnbrBitrate.aidl
+++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendIptvSettings.aidl
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2022 The Android Open Source Project
+ * Copyright 2023 The Android Open Source Project
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -31,10 +31,14 @@
 // with such a backward incompatible change, it has a high risk of breaking
 // later when a module using the interface is updated, e.g., Mainline modules.
 
-package android.hardware.radio.ims.media;
+package android.hardware.tv.tuner;
+/* @hide */
 @VintfStability
-parcelable AnbrBitrate {
-  int uplinkBps;
-  int downlinkBps;
-  const int INVALID_ANBR_BITRATE = -1;
+parcelable FrontendIptvSettings {
+  android.hardware.tv.tuner.FrontendIptvSettingsProtocol protocol = android.hardware.tv.tuner.FrontendIptvSettingsProtocol.UNDEFINED;
+  android.hardware.tv.tuner.FrontendIptvSettingsFec fec;
+  android.hardware.tv.tuner.FrontendIptvSettingsIgmp igmp = android.hardware.tv.tuner.FrontendIptvSettingsIgmp.UNDEFINED;
+  long bitrate;
+  android.hardware.tv.tuner.DemuxIpAddress ipAddr;
+  String contentUrl;
 }
diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/AnbrBitrate.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendIptvSettingsFec.aidl
similarity index 87%
copy from radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/AnbrBitrate.aidl
copy to tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendIptvSettingsFec.aidl
index 711ac19..c361377 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/AnbrBitrate.aidl
+++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendIptvSettingsFec.aidl
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2022 The Android Open Source Project
+ * Copyright 2023 The Android Open Source Project
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -31,10 +31,11 @@
 // with such a backward incompatible change, it has a high risk of breaking
 // later when a module using the interface is updated, e.g., Mainline modules.
 
-package android.hardware.radio.ims.media;
+package android.hardware.tv.tuner;
+/* @hide */
 @VintfStability
-parcelable AnbrBitrate {
-  int uplinkBps;
-  int downlinkBps;
-  const int INVALID_ANBR_BITRATE = -1;
+parcelable FrontendIptvSettingsFec {
+  android.hardware.tv.tuner.FrontendIptvSettingsFecType type;
+  int fecColNum;
+  int fecRowNum;
 }
diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/MediaProtocolType.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendIptvSettingsFecType.aidl
similarity index 89%
copy from radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/MediaProtocolType.aidl
copy to tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendIptvSettingsFecType.aidl
index 1a290d4..50a1208 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/MediaProtocolType.aidl
+++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendIptvSettingsFecType.aidl
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright 2023 The Android Open Source Project
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -31,9 +31,12 @@
 // with such a backward incompatible change, it has a high risk of breaking
 // later when a module using the interface is updated, e.g., Mainline modules.
 
-package android.hardware.radio.ims.media;
+package android.hardware.tv.tuner;
+/* @hide */
 @Backing(type="int") @VintfStability
-enum MediaProtocolType {
-  RTP = 0,
-  RTCP = 1,
+enum FrontendIptvSettingsFecType {
+  UNDEFINED = 0,
+  COLUMN = 1,
+  ROW = 2,
+  COLUMN_ROW = 4,
 }
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleAreaMirror.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendIptvSettingsIgmp.aidl
similarity index 89%
copy from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleAreaMirror.aidl
copy to tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendIptvSettingsIgmp.aidl
index c1e2fbd..aa08496 100644
--- a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleAreaMirror.aidl
+++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendIptvSettingsIgmp.aidl
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright 2023 The Android Open Source Project
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -31,10 +31,12 @@
 // with such a backward incompatible change, it has a high risk of breaking
 // later when a module using the interface is updated, e.g., Mainline modules.
 
-package android.hardware.automotive.vehicle;
+package android.hardware.tv.tuner;
+/* @hide */
 @Backing(type="int") @VintfStability
-enum VehicleAreaMirror {
-  DRIVER_LEFT = 1,
-  DRIVER_RIGHT = 2,
-  DRIVER_CENTER = 4,
+enum FrontendIptvSettingsIgmp {
+  UNDEFINED = 0,
+  V1 = 1,
+  V2 = 2,
+  V3 = 4,
 }
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleAreaMirror.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendIptvSettingsProtocol.aidl
similarity index 89%
copy from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleAreaMirror.aidl
copy to tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendIptvSettingsProtocol.aidl
index c1e2fbd..08a01f1 100644
--- a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleAreaMirror.aidl
+++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendIptvSettingsProtocol.aidl
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright 2023 The Android Open Source Project
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -31,10 +31,11 @@
 // with such a backward incompatible change, it has a high risk of breaking
 // later when a module using the interface is updated, e.g., Mainline modules.
 
-package android.hardware.automotive.vehicle;
+package android.hardware.tv.tuner;
+/* @hide */
 @Backing(type="int") @VintfStability
-enum VehicleAreaMirror {
-  DRIVER_LEFT = 1,
-  DRIVER_RIGHT = 2,
-  DRIVER_CENTER = 4,
+enum FrontendIptvSettingsProtocol {
+  UNDEFINED = 0,
+  UDP = 1,
+  RTP = 2,
 }
diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendSettings.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendSettings.aidl
index 7eae9df..9810ba6 100644
--- a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendSettings.aidl
+++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendSettings.aidl
@@ -45,4 +45,5 @@
   android.hardware.tv.tuner.FrontendIsdbs3Settings isdbs3;
   android.hardware.tv.tuner.FrontendIsdbtSettings isdbt;
   android.hardware.tv.tuner.FrontendDtmbSettings dtmb;
+  @nullable android.hardware.tv.tuner.FrontendIptvSettings iptv;
 }
diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendStatus.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendStatus.aidl
index 1e0f5f0..b991ab6 100644
--- a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendStatus.aidl
+++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendStatus.aidl
@@ -77,4 +77,9 @@
   int[] streamIdList;
   int[] dvbtCellIds;
   android.hardware.tv.tuner.FrontendScanAtsc3PlpInfo[] allPlpInfo;
+  String iptvContentUrl = "";
+  long iptvPacketsReceived;
+  long iptvPacketsLost;
+  int iptvWorstJitterMs;
+  int iptvAverageJitterMs;
 }
diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendStatusType.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendStatusType.aidl
index cd6ccb3..3791299 100644
--- a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendStatusType.aidl
+++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendStatusType.aidl
@@ -77,4 +77,9 @@
   STREAM_ID_LIST = 39,
   DVBT_CELL_IDS = 40,
   ATSC3_ALL_PLP_INFO = 41,
+  IPTV_CONTENT_URL = 42,
+  IPTV_PACKETS_LOST = 43,
+  IPTV_PACKETS_RECEIVED = 44,
+  IPTV_WORST_JITTER_MS = 45,
+  IPTV_AVERAGE_JITTER_MS = 46,
 }
diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendType.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendType.aidl
index 99a120b..cbf5b47 100644
--- a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendType.aidl
+++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendType.aidl
@@ -1,5 +1,5 @@
 /*
- * Copyright 2021 The Android Open Source Project
+ * Copyright 2023 The Android Open Source Project
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -46,4 +46,5 @@
   ISDBS3 = 8,
   ISDBT = 9,
   DTMB = 10,
+  IPTV = 11,
 }
diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/ITuner.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/ITuner.aidl
index 5d1d215..732f3fd 100644
--- a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/ITuner.aidl
+++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/ITuner.aidl
@@ -48,4 +48,7 @@
   void setMaxNumberOfFrontends(in android.hardware.tv.tuner.FrontendType frontendType, in int maxNumber);
   int getMaxNumberOfFrontends(in android.hardware.tv.tuner.FrontendType frontendType);
   boolean isLnaSupported();
+  int[] getDemuxIds();
+  android.hardware.tv.tuner.IDemux openDemuxById(in int demuxId);
+  android.hardware.tv.tuner.DemuxInfo getDemuxInfo(in int demuxId);
 }
diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/AudioPreselection.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/AudioPreselection.aidl
new file mode 100644
index 0000000..16ef0dd
--- /dev/null
+++ b/tv/tuner/aidl/android/hardware/tv/tuner/AudioPreselection.aidl
@@ -0,0 +1,63 @@
+/*
+ * Copyright 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.tv.tuner;
+
+import android.hardware.tv.tuner.AudioPreselectionLabel;
+import android.hardware.tv.tuner.AudioPreselectionRenderingIndicationType;
+
+/**
+ * Audio preselection metadata according to ETSI EN 300 468 V1.17.1.
+ * @hide
+ */
+@VintfStability
+parcelable AudioPreselection {
+    /**
+     * Identifies this audio preselection. The value of this field shall match the corresponding
+     * field in the elementary stream.
+     */
+    int preselectionId;
+
+    /**
+     * Collection of audio preselection labels.
+     */
+    AudioPreselectionLabel[] labels;
+
+    /**
+     * ISO 639-2 3-character code.
+     */
+    String language;
+
+    /**
+     * A hint for a preferred reproduction channel layout.
+     */
+    AudioPreselectionRenderingIndicationType renderingIndication;
+
+    /**
+     * Audio preselection contains audio description for the visually impaired.
+     */
+    boolean hasAudioDescription;
+
+    /**
+     * Audio preselection contains spoken subtitles.
+     */
+    boolean hasSpokenSubtitles;
+
+    /**
+     * Audio preselection provides support for dialogue enhancement.
+     */
+    boolean hasDialogueEnhancement;
+}
diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/AudioPreselectionLabel.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/AudioPreselectionLabel.aidl
new file mode 100644
index 0000000..429b026
--- /dev/null
+++ b/tv/tuner/aidl/android/hardware/tv/tuner/AudioPreselectionLabel.aidl
@@ -0,0 +1,34 @@
+/*
+ * Copyright 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.tv.tuner;
+
+/**
+ * Audio preselection label according to ETSI EN 300 468 V1.17.1.
+ * @hide
+ */
+@VintfStability
+parcelable AudioPreselectionLabel {
+    /**
+     * ISO 639-2 3-character code.
+     */
+    String language;
+
+    /**
+     * Text information, written in the language specified, pertaining to the preselection.
+     */
+    String text;
+}
diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/AudioPreselectionRenderingIndicationType.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/AudioPreselectionRenderingIndicationType.aidl
new file mode 100644
index 0000000..963c55a
--- /dev/null
+++ b/tv/tuner/aidl/android/hardware/tv/tuner/AudioPreselectionRenderingIndicationType.aidl
@@ -0,0 +1,50 @@
+/*
+ * Copyright 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.tv.tuner;
+
+/**
+ * Audio preselection audio rendering indication according to ETSI EN 300 468 V1.17.1.
+ * @hide
+ */
+@VintfStability
+@Backing(type="int")
+enum AudioPreselectionRenderingIndicationType {
+    /**
+     * No preference given for the reproduction channel layout.
+     */
+    NOT_INDICATED,
+
+    /**
+     * Preferred reproduction channel layout is stereo.
+     */
+    STEREO,
+
+    /**
+     * Preferred reproduction channel layout is two-dimensional (e.g. 5.1 multi-channel).
+     */
+    TWO_DIMENSIONAL,
+
+    /**
+     * Preferred reproduction channel layout is three-dimensional.
+     */
+    THREE_DIMENSIONAL,
+
+    /**
+     * Content is pre-rendered for consumption with headphones.
+     */
+    HEADPHONE,
+}
diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/AudioPresentation.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/AudioPresentation.aidl
new file mode 100644
index 0000000..50f9d90
--- /dev/null
+++ b/tv/tuner/aidl/android/hardware/tv/tuner/AudioPresentation.aidl
@@ -0,0 +1,38 @@
+/*
+ * Copyright 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.tv.tuner;
+
+import android.hardware.tv.tuner.AudioPreselection;
+
+/**
+ * Audio presentation metadata.
+ * @hide
+ */
+@VintfStability
+parcelable AudioPresentation {
+    /**
+     * Audio preselection.
+     */
+    AudioPreselection preselection;
+
+    /**
+     * Dolby AC-4 short program id specified in ETSI TS 103 190-2. For use in conjunction with
+     * an audio preselection to ensure contininuity of personalized experience during program
+     * transitions.
+     */
+    int ac4ShortProgramId = -1;
+}
diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterMediaEventExtraMetaData.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterMediaEventExtraMetaData.aidl
index f01952b..4ff33a2 100644
--- a/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterMediaEventExtraMetaData.aidl
+++ b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterMediaEventExtraMetaData.aidl
@@ -17,6 +17,7 @@
 package android.hardware.tv.tuner;
 
 import android.hardware.tv.tuner.AudioExtraMetaData;
+import android.hardware.tv.tuner.AudioPresentation;
 
 /**
  * Extra Meta Data for DemuxFilterMediaEvent.
@@ -30,4 +31,9 @@
     boolean noinit;
 
     AudioExtraMetaData audio;
+
+    /**
+     * Audio presentations available for user selection.
+     */
+    AudioPresentation[] audioPresentations = {};
 }
diff --git a/radio/aidl/android/hardware/radio/ims/media/MediaProtocolType.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxInfo.aidl
similarity index 64%
copy from radio/aidl/android/hardware/radio/ims/media/MediaProtocolType.aidl
copy to tv/tuner/aidl/android/hardware/tv/tuner/DemuxInfo.aidl
index 325c6fa..2720e21 100644
--- a/radio/aidl/android/hardware/radio/ims/media/MediaProtocolType.aidl
+++ b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxInfo.aidl
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright 2021 The Android Open Source Project
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -14,13 +14,18 @@
  * limitations under the License.
  */
 
-package android.hardware.radio.ims.media;
+package android.hardware.tv.tuner;
 
+import android.hardware.tv.tuner.DemuxFilterMainType;
+
+/**
+ * Information for the Demux.
+ * @hide
+ */
 @VintfStability
-@Backing(type="int")
-enum MediaProtocolType {
-   /** Real Time Protocol, see RFC 3550 */
-   RTP = 0,
-   /** Real Time Control Protocol, see RFC 3550 */
-   RTCP = 1,
+parcelable DemuxInfo {
+    /**
+     * Bitwise OR of DemuxFilterMainTypes
+     */
+    int filterTypes = DemuxFilterMainType.UNDEFINED;
 }
diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendIptvSettings.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendIptvSettings.aidl
new file mode 100644
index 0000000..782695a
--- /dev/null
+++ b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendIptvSettings.aidl
@@ -0,0 +1,45 @@
+/*
+ * Copyright 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.tv.tuner;
+
+import android.hardware.tv.tuner.DemuxIpAddress;
+import android.hardware.tv.tuner.FrontendIptvSettingsFec;
+import android.hardware.tv.tuner.FrontendIptvSettingsFecType;
+import android.hardware.tv.tuner.FrontendIptvSettingsIgmp;
+import android.hardware.tv.tuner.FrontendIptvSettingsProtocol;
+
+/**
+ * Frontend Settings for IPTV.
+ * @hide
+ */
+@VintfStability
+parcelable FrontendIptvSettings {
+    FrontendIptvSettingsProtocol protocol = FrontendIptvSettingsProtocol.UNDEFINED;
+
+    FrontendIptvSettingsFec fec;
+
+    FrontendIptvSettingsIgmp igmp = FrontendIptvSettingsIgmp.UNDEFINED;
+
+    long bitrate;
+
+    /**
+     * Source and destination IP Address.
+     */
+    DemuxIpAddress ipAddr;
+
+    String contentUrl;
+}
diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendIptvSettingsFec.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendIptvSettingsFec.aidl
new file mode 100644
index 0000000..e12f06f
--- /dev/null
+++ b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendIptvSettingsFec.aidl
@@ -0,0 +1,38 @@
+/*
+ * Copyright 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.tv.tuner;
+
+import android.hardware.tv.tuner.FrontendIptvSettingsFecType;
+
+/**
+ * Configuration details for IPTV FEC.
+ * @hide
+ */
+@VintfStability
+parcelable FrontendIptvSettingsFec {
+    FrontendIptvSettingsFecType type;
+
+    /**
+     * The number of columns in the source block as well as the type of the repair packet.
+     */
+    int fecColNum;
+
+    /**
+     * The number of rows in the source block as well as the type of the repair packet.
+     */
+    int fecRowNum;
+}
diff --git a/radio/aidl/android/hardware/radio/ims/media/MediaProtocolType.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendIptvSettingsFecType.aidl
similarity index 68%
copy from radio/aidl/android/hardware/radio/ims/media/MediaProtocolType.aidl
copy to tv/tuner/aidl/android/hardware/tv/tuner/FrontendIptvSettingsFecType.aidl
index 325c6fa..421cbf8 100644
--- a/radio/aidl/android/hardware/radio/ims/media/MediaProtocolType.aidl
+++ b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendIptvSettingsFecType.aidl
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright 2023 The Android Open Source Project
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -14,13 +14,21 @@
  * limitations under the License.
  */
 
-package android.hardware.radio.ims.media;
+package android.hardware.tv.tuner;
 
+/**
+ * FEC type for IPTV.
+ * TS 102 542-3-2 - V1.3.2
+ * @hide
+ */
 @VintfStability
 @Backing(type="int")
-enum MediaProtocolType {
-   /** Real Time Protocol, see RFC 3550 */
-   RTP = 0,
-   /** Real Time Control Protocol, see RFC 3550 */
-   RTCP = 1,
+enum FrontendIptvSettingsFecType {
+    UNDEFINED = 0,
+
+    COLUMN = 1 << 0,
+
+    ROW = 1 << 1,
+
+    COLUMN_ROW = 1 << 2,
 }
diff --git a/radio/aidl/android/hardware/radio/ims/media/MediaProtocolType.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendIptvSettingsIgmp.aidl
similarity index 71%
rename from radio/aidl/android/hardware/radio/ims/media/MediaProtocolType.aidl
rename to tv/tuner/aidl/android/hardware/tv/tuner/FrontendIptvSettingsIgmp.aidl
index 325c6fa..f6e39c8 100644
--- a/radio/aidl/android/hardware/radio/ims/media/MediaProtocolType.aidl
+++ b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendIptvSettingsIgmp.aidl
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright 2023 The Android Open Source Project
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -14,13 +14,20 @@
  * limitations under the License.
  */
 
-package android.hardware.radio.ims.media;
+package android.hardware.tv.tuner;
 
+/**
+ * IGMP type for IPTV.
+ * @hide
+ */
 @VintfStability
 @Backing(type="int")
-enum MediaProtocolType {
-   /** Real Time Protocol, see RFC 3550 */
-   RTP = 0,
-   /** Real Time Control Protocol, see RFC 3550 */
-   RTCP = 1,
+enum FrontendIptvSettingsIgmp {
+    UNDEFINED = 0,
+
+    V1 = 1 << 0,
+
+    V2 = 1 << 1,
+
+    V3 = 1 << 2,
 }
diff --git a/radio/aidl/android/hardware/radio/ims/media/MediaProtocolType.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendIptvSettingsProtocol.aidl
similarity index 71%
copy from radio/aidl/android/hardware/radio/ims/media/MediaProtocolType.aidl
copy to tv/tuner/aidl/android/hardware/tv/tuner/FrontendIptvSettingsProtocol.aidl
index 325c6fa..0283445 100644
--- a/radio/aidl/android/hardware/radio/ims/media/MediaProtocolType.aidl
+++ b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendIptvSettingsProtocol.aidl
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright 2023 The Android Open Source Project
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -14,13 +14,18 @@
  * limitations under the License.
  */
 
-package android.hardware.radio.ims.media;
+package android.hardware.tv.tuner;
 
+/**
+ * Protocol for IPTV.
+ * @hide
+ */
 @VintfStability
 @Backing(type="int")
-enum MediaProtocolType {
-   /** Real Time Protocol, see RFC 3550 */
-   RTP = 0,
-   /** Real Time Control Protocol, see RFC 3550 */
-   RTCP = 1,
+enum FrontendIptvSettingsProtocol {
+    UNDEFINED = 0,
+
+    UDP = 1 << 0,
+
+    RTP = 1 << 1,
 }
diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendSettings.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendSettings.aidl
index f78b2ae..e5a99e1 100644
--- a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendSettings.aidl
+++ b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendSettings.aidl
@@ -19,13 +19,14 @@
 import android.hardware.tv.tuner.FrontendAnalogSettings;
 import android.hardware.tv.tuner.FrontendAtsc3Settings;
 import android.hardware.tv.tuner.FrontendAtscSettings;
+import android.hardware.tv.tuner.FrontendDtmbSettings;
 import android.hardware.tv.tuner.FrontendDvbcSettings;
 import android.hardware.tv.tuner.FrontendDvbsSettings;
 import android.hardware.tv.tuner.FrontendDvbtSettings;
+import android.hardware.tv.tuner.FrontendIptvSettings;
 import android.hardware.tv.tuner.FrontendIsdbs3Settings;
 import android.hardware.tv.tuner.FrontendIsdbsSettings;
 import android.hardware.tv.tuner.FrontendIsdbtSettings;
-import android.hardware.tv.tuner.FrontendDtmbSettings;
 
 /**
  * Signal Settings for Frontend.
@@ -52,4 +53,6 @@
     FrontendIsdbtSettings isdbt;
 
     FrontendDtmbSettings dtmb;
+
+    @nullable FrontendIptvSettings iptv;
 }
diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendStatus.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendStatus.aidl
index b5d0201..391f29b 100644
--- a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendStatus.aidl
+++ b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendStatus.aidl
@@ -26,8 +26,8 @@
 import android.hardware.tv.tuner.FrontendModulation;
 import android.hardware.tv.tuner.FrontendModulationStatus;
 import android.hardware.tv.tuner.FrontendRollOff;
-import android.hardware.tv.tuner.FrontendSpectralInversion;
 import android.hardware.tv.tuner.FrontendScanAtsc3PlpInfo;
+import android.hardware.tv.tuner.FrontendSpectralInversion;
 import android.hardware.tv.tuner.FrontendStatusAtsc3PlpInfo;
 import android.hardware.tv.tuner.FrontendTransmissionMode;
 import android.hardware.tv.tuner.LnbVoltage;
@@ -247,4 +247,29 @@
      * and not tuned PLPs for currently watching service.
      */
     FrontendScanAtsc3PlpInfo[] allPlpInfo;
+
+    /**
+     * IPTV Content URL
+     */
+    String iptvContentUrl = "";
+
+    /**
+     * Packets Received (IPTV - UDP/RTP).
+     */
+    long iptvPacketsReceived;
+
+    /**
+     * Packets Lost (IPTV - RTP).
+     */
+    long iptvPacketsLost;
+
+    /**
+     * Worst jitter (milliseconds).
+     */
+    int iptvWorstJitterMs;
+
+    /**
+     * Average jitter (milliseconds).
+     */
+    int iptvAverageJitterMs;
 }
diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendStatusType.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendStatusType.aidl
index 8f3f2c5..6804b2d 100644
--- a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendStatusType.aidl
+++ b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendStatusType.aidl
@@ -234,4 +234,29 @@
      * and not tuned PLPs for currently watching service.
      */
     ATSC3_ALL_PLP_INFO,
+
+    /**
+     * IPTV Content URL.
+     */
+    IPTV_CONTENT_URL,
+
+    /**
+     * Number of packets lost.
+     */
+    IPTV_PACKETS_LOST,
+
+    /**
+     * Number of packets received.
+     */
+    IPTV_PACKETS_RECEIVED,
+
+    /**
+     * Worst jitter (milliseconds).
+     */
+    IPTV_WORST_JITTER_MS,
+
+    /**
+     * Average jitter (milliseconds).
+     */
+    IPTV_AVERAGE_JITTER_MS,
 }
diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendType.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendType.aidl
index 8ade389..e8d343e 100644
--- a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendType.aidl
+++ b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendType.aidl
@@ -1,5 +1,5 @@
 /*
- * Copyright 2021 The Android Open Source Project
+ * Copyright 2023 The Android Open Source Project
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -79,4 +79,9 @@
      * DTMB (Digital Terrestrial Multimedia Broadcast) standard.
      */
     DTMB,
+
+    /**
+     * ITU IPTV (ITU-T FG IPTV)
+     */
+    IPTV,
 }
diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/ITuner.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/ITuner.aidl
index 4a0b7a2..9ead7dd 100644
--- a/tv/tuner/aidl/android/hardware/tv/tuner/ITuner.aidl
+++ b/tv/tuner/aidl/android/hardware/tv/tuner/ITuner.aidl
@@ -17,6 +17,7 @@
 package android.hardware.tv.tuner;
 
 import android.hardware.tv.tuner.DemuxCapabilities;
+import android.hardware.tv.tuner.DemuxInfo;
 import android.hardware.tv.tuner.FrontendInfo;
 import android.hardware.tv.tuner.FrontendType;
 import android.hardware.tv.tuner.IDemux;
@@ -65,7 +66,7 @@
     IDemux openDemux(out int[] demuxId);
 
     /**
-     * Retrieve the Demux's Capabilities.
+     * Retrieve the system wide Demux's Capabilities
      *
      * @return the Demux's Capabilities.
      */
@@ -158,4 +159,32 @@
      * @return true if supported, otherwise false
      */
     boolean isLnaSupported();
+
+    /**
+     * Get Demux IDs
+     *
+     * It is used by the client to get all available demuxes' IDs.
+     *
+     * @return an array of IDs for the available Demuxes.
+     */
+    int[] getDemuxIds();
+
+    /**
+     * Create a new instance of Demux given a demuxId.
+     *
+     * It is used by the client to create a demux instance.
+     *
+     * @param demuxId the id of the demux to be opened.
+     *
+     * @return the newly created demux interface.
+     */
+    IDemux openDemuxById(in int demuxId);
+
+    /**
+     * Retrieve the DemuxInfo of the specified Demux.
+     *
+     * @param demuxId the demux ID to query the DemuxInfo for.
+     * @return the DemuxInfo of the specified Demux by demuxId.
+     */
+    DemuxInfo getDemuxInfo(in int demuxId);
 }
diff --git a/tv/tuner/aidl/default/Demux.cpp b/tv/tuner/aidl/default/Demux.cpp
index 60fd899..11e7131 100644
--- a/tv/tuner/aidl/default/Demux.cpp
+++ b/tv/tuner/aidl/default/Demux.cpp
@@ -31,8 +31,12 @@
 
 #define WAIT_TIMEOUT 3000000000
 
-Demux::Demux(int32_t demuxId, std::shared_ptr<Tuner> tuner) {
+Demux::Demux(int32_t demuxId, uint32_t filterTypes) {
     mDemuxId = demuxId;
+    mFilterTypes = filterTypes;
+}
+
+void Demux::setTunerService(std::shared_ptr<Tuner> tuner) {
     mTuner = tuner;
 }
 
@@ -346,6 +350,22 @@
     return mFilters[filterId]->getTpid();
 }
 
+int32_t Demux::getDemuxId() {
+    return mDemuxId;
+}
+
+bool Demux::isInUse() {
+    return mInUse;
+}
+
+void Demux::setInUse(bool inUse) {
+    mInUse = inUse;
+}
+
+void Demux::getDemuxInfo(DemuxInfo* demuxInfo) {
+    *demuxInfo = {.filterTypes = mFilterTypes};
+}
+
 void Demux::startFrontendInputLoop() {
     ALOGD("[Demux] start frontend on demux");
     // Stop current Frontend thread loop first, in case the user starts a new
diff --git a/tv/tuner/aidl/default/Demux.h b/tv/tuner/aidl/default/Demux.h
index 7f0b0a7..7d7aee4 100644
--- a/tv/tuner/aidl/default/Demux.h
+++ b/tv/tuner/aidl/default/Demux.h
@@ -53,7 +53,7 @@
 
 class Demux : public BnDemux {
   public:
-    Demux(int32_t demuxId, std::shared_ptr<Tuner> tuner);
+    Demux(int32_t demuxId, uint32_t filterTypes);
     ~Demux();
 
     ::ndk::ScopedAStatus setFrontendDataSource(int32_t in_frontendId) override;
@@ -98,6 +98,12 @@
     void sendFrontendInputToRecord(vector<int8_t> data, uint16_t pid, uint64_t pts);
     bool startRecordFilterDispatcher();
 
+    void getDemuxInfo(DemuxInfo* demuxInfo);
+    int32_t getDemuxId();
+    bool isInUse();
+    void setInUse(bool inUse);
+    void setTunerService(std::shared_ptr<Tuner> tuner);
+
   private:
     // Tuner service
     std::shared_ptr<Tuner> mTuner;
@@ -183,6 +189,9 @@
     vector<uint8_t> mPesOutput;
 
     const bool DEBUG_DEMUX = false;
+
+    int32_t mFilterTypes;
+    bool mInUse = false;
 };
 
 }  // namespace tuner
diff --git a/tv/tuner/aidl/default/Filter.cpp b/tv/tuner/aidl/default/Filter.cpp
index 59e301d..ba9602e 100644
--- a/tv/tuner/aidl/default/Filter.cpp
+++ b/tv/tuner/aidl/default/Filter.cpp
@@ -329,7 +329,8 @@
     // All the filter event callbacks in start are for testing purpose.
     switch (mType.mainType) {
         case DemuxFilterMainType::TS:
-            createMediaEvent(events);
+            createMediaEvent(events, false);
+            createMediaEvent(events, true);
             createTsRecordEvent(events);
             createTemiEvent(events);
             break;
@@ -1221,15 +1222,7 @@
     return (stat1.st_dev == stat2.st_dev) && (stat1.st_ino == stat2.st_ino);
 }
 
-void Filter::createMediaEvent(vector<DemuxFilterEvent>& events) {
-    AudioExtraMetaData audio;
-    audio.adFade = 1;
-    audio.adPan = 2;
-    audio.versionTextTag = 3;
-    audio.adGainCenter = 4;
-    audio.adGainFront = 5;
-    audio.adGainSurround = 6;
-
+void Filter::createMediaEvent(vector<DemuxFilterEvent>& events, bool isAudioPresentation) {
     DemuxFilterMediaEvent mediaEvent;
     mediaEvent.streamId = 1;
     mediaEvent.isPtsPresent = true;
@@ -1239,7 +1232,43 @@
     mediaEvent.isSecureMemory = true;
     mediaEvent.mpuSequenceNumber = 6;
     mediaEvent.isPesPrivateData = true;
-    mediaEvent.extraMetaData.set<DemuxFilterMediaEventExtraMetaData::Tag::audio>(audio);
+
+    if (isAudioPresentation) {
+        AudioPresentation audioPresentation0{
+                .preselection.preselectionId = 0,
+                .preselection.labels = {{"en", "Commentator"}, {"es", "Comentarista"}},
+                .preselection.language = "en",
+                .preselection.renderingIndication =
+                        AudioPreselectionRenderingIndicationType::THREE_DIMENSIONAL,
+                .preselection.hasAudioDescription = false,
+                .preselection.hasSpokenSubtitles = false,
+                .preselection.hasDialogueEnhancement = true,
+                .ac4ShortProgramId = 42};
+        AudioPresentation audioPresentation1{
+                .preselection.preselectionId = 1,
+                .preselection.labels = {{"en", "Crowd"}, {"es", "Multitud"}},
+                .preselection.language = "en",
+                .preselection.renderingIndication =
+                        AudioPreselectionRenderingIndicationType::THREE_DIMENSIONAL,
+                .preselection.hasAudioDescription = false,
+                .preselection.hasSpokenSubtitles = false,
+                .preselection.hasDialogueEnhancement = false,
+                .ac4ShortProgramId = 42};
+        vector<AudioPresentation> audioPresentations;
+        audioPresentations.push_back(audioPresentation0);
+        audioPresentations.push_back(audioPresentation1);
+        mediaEvent.extraMetaData.set<DemuxFilterMediaEventExtraMetaData::Tag::audioPresentations>(
+                audioPresentations);
+    } else {
+        AudioExtraMetaData audio;
+        audio.adFade = 1;
+        audio.adPan = 2;
+        audio.versionTextTag = 3;
+        audio.adGainCenter = 4;
+        audio.adGainFront = 5;
+        audio.adGainSurround = 6;
+        mediaEvent.extraMetaData.set<DemuxFilterMediaEventExtraMetaData::Tag::audio>(audio);
+    }
 
     int av_fd = createAvIonFd(BUFFER_SIZE);
     if (av_fd == -1) {
diff --git a/tv/tuner/aidl/default/Filter.h b/tv/tuner/aidl/default/Filter.h
index f2d9248..0985296 100644
--- a/tv/tuner/aidl/default/Filter.h
+++ b/tv/tuner/aidl/default/Filter.h
@@ -230,7 +230,7 @@
     ::ndk::ScopedAStatus createShareMemMediaEvents(vector<int8_t>& output);
     bool sameFile(int fd1, int fd2);
 
-    void createMediaEvent(vector<DemuxFilterEvent>&);
+    void createMediaEvent(vector<DemuxFilterEvent>&, bool isAudioPresentation);
     void createTsRecordEvent(vector<DemuxFilterEvent>&);
     void createMmtpRecordEvent(vector<DemuxFilterEvent>&);
     void createSectionEvent(vector<DemuxFilterEvent>&);
diff --git a/tv/tuner/aidl/default/Frontend.cpp b/tv/tuner/aidl/default/Frontend.cpp
index 997d9de..d140b74 100644
--- a/tv/tuner/aidl/default/Frontend.cpp
+++ b/tv/tuner/aidl/default/Frontend.cpp
@@ -875,6 +875,26 @@
                 status.set<FrontendStatus::allPlpInfo>(infos);
                 break;
             }
+            case FrontendStatusType::IPTV_CONTENT_URL: {
+                status.set<FrontendStatus::iptvContentUrl>("");
+                break;
+            }
+            case FrontendStatusType::IPTV_PACKETS_LOST: {
+                status.set<FrontendStatus::iptvPacketsLost>(5);
+                break;
+            }
+            case FrontendStatusType::IPTV_PACKETS_RECEIVED: {
+                status.set<FrontendStatus::iptvPacketsReceived>(5);
+                break;
+            }
+            case FrontendStatusType::IPTV_WORST_JITTER_MS: {
+                status.set<FrontendStatus::iptvWorstJitterMs>(5);
+                break;
+            }
+            case FrontendStatusType::IPTV_AVERAGE_JITTER_MS: {
+                status.set<FrontendStatus::iptvAverageJitterMs>(5);
+                break;
+            }
             default: {
                 continue;
             }
diff --git a/tv/tuner/aidl/default/Tuner.cpp b/tv/tuner/aidl/default/Tuner.cpp
index 8c715a0..197d866 100644
--- a/tv/tuner/aidl/default/Tuner.cpp
+++ b/tv/tuner/aidl/default/Tuner.cpp
@@ -17,6 +17,7 @@
 //#define LOG_NDEBUG 0
 #define LOG_TAG "android.hardware.tv.tuner-service.example-Tuner"
 
+#include <aidl/android/hardware/tv/tuner/DemuxFilterMainType.h>
 #include <aidl/android/hardware/tv/tuner/Result.h>
 #include <utils/Log.h>
 
@@ -37,7 +38,7 @@
 void Tuner::init() {
     // Static Frontends array to maintain local frontends information
     // Array index matches their FrontendId in the default impl
-    mFrontendSize = 10;
+    mFrontendSize = 11;
     mFrontends[0] = ndk::SharedRefBase::make<Frontend>(FrontendType::ISDBS, 0);
     mFrontends[1] = ndk::SharedRefBase::make<Frontend>(FrontendType::ATSC3, 1);
     mFrontends[2] = ndk::SharedRefBase::make<Frontend>(FrontendType::DVBC, 2);
@@ -48,6 +49,7 @@
     mFrontends[7] = ndk::SharedRefBase::make<Frontend>(FrontendType::ATSC, 7);
     mFrontends[8] = ndk::SharedRefBase::make<Frontend>(FrontendType::ISDBS3, 8);
     mFrontends[9] = ndk::SharedRefBase::make<Frontend>(FrontendType::DTMB, 9);
+    mFrontends[10] = ndk::SharedRefBase::make<Frontend>(FrontendType::IPTV, 10);
 
     mMaxUsableFrontends[FrontendType::ISDBS] = 1;
     mMaxUsableFrontends[FrontendType::ATSC3] = 1;
@@ -59,6 +61,17 @@
     mMaxUsableFrontends[FrontendType::ATSC] = 1;
     mMaxUsableFrontends[FrontendType::ISDBS3] = 1;
     mMaxUsableFrontends[FrontendType::DTMB] = 1;
+    mMaxUsableFrontends[FrontendType::IPTV] = 1;
+
+    mDemuxes[0] =
+            ndk::SharedRefBase::make<Demux>(0, (static_cast<int32_t>(DemuxFilterMainType::TS) |
+                                                static_cast<int32_t>(DemuxFilterMainType::MMTP) |
+                                                static_cast<int32_t>(DemuxFilterMainType::TLV)));
+    mDemuxes[1] =
+            ndk::SharedRefBase::make<Demux>(1, (static_cast<int32_t>(DemuxFilterMainType::MMTP) |
+                                                static_cast<int32_t>(DemuxFilterMainType::TLV)));
+    mDemuxes[2] = ndk::SharedRefBase::make<Demux>(2, static_cast<int32_t>(DemuxFilterMainType::IP));
+    mDemuxes[3] = ndk::SharedRefBase::make<Demux>(3, static_cast<int32_t>(DemuxFilterMainType::TS));
 
     mLnbs.resize(2);
     mLnbs[0] = ndk::SharedRefBase::make<Lnb>(0);
@@ -78,6 +91,28 @@
     return ::ndk::ScopedAStatus::ok();
 }
 
+::ndk::ScopedAStatus Tuner::getDemuxInfo(int32_t in_demuxId, DemuxInfo* _aidl_return) {
+    if (mDemuxes.find(in_demuxId) == mDemuxes.end()) {
+        return ::ndk::ScopedAStatus::fromServiceSpecificError(
+                static_cast<int32_t>(Result::INVALID_ARGUMENT));
+    } else {
+        mDemuxes[in_demuxId]->getDemuxInfo(_aidl_return);
+        return ::ndk::ScopedAStatus::ok();
+    }
+}
+
+::ndk::ScopedAStatus Tuner::getDemuxIds(std::vector<int32_t>* _aidl_return) {
+    ALOGV("%s", __FUNCTION__);
+
+    int numOfDemuxes = mDemuxes.size();
+    _aidl_return->resize(numOfDemuxes);
+    int i = 0;
+    for (auto e = mDemuxes.begin(); e != mDemuxes.end(); e++) {
+        (*_aidl_return)[i++] = e->first;
+    }
+    return ::ndk::ScopedAStatus::ok();
+}
+
 ::ndk::ScopedAStatus Tuner::openFrontendById(int32_t in_frontendId,
                                              std::shared_ptr<IFrontend>* _aidl_return) {
     ALOGV("%s", __FUNCTION__);
@@ -94,17 +129,49 @@
     return ::ndk::ScopedAStatus::ok();
 }
 
+::ndk::ScopedAStatus Tuner::openDemuxById(int32_t in_demuxId,
+                                          std::shared_ptr<IDemux>* _aidl_return) {
+    ALOGV("%s", __FUNCTION__);
+
+    if (mDemuxes.find(in_demuxId) == mDemuxes.end()) {
+        ALOGW("[   WARN   ] Demux with id %d isn't available", in_demuxId);
+        *_aidl_return = nullptr;
+        return ::ndk::ScopedAStatus::fromServiceSpecificError(
+                static_cast<int32_t>(Result::INVALID_ARGUMENT));
+    }
+
+    if (mDemuxes[in_demuxId]->isInUse()) {
+        return ::ndk::ScopedAStatus::fromServiceSpecificError(
+                static_cast<int32_t>(Result::UNAVAILABLE));
+    } else {
+        mDemuxes[in_demuxId]->setTunerService(this->ref<Tuner>());
+        mDemuxes[in_demuxId]->setInUse(true);
+
+        *_aidl_return = mDemuxes[in_demuxId];
+        return ::ndk::ScopedAStatus::ok();
+    }
+}
+
 ::ndk::ScopedAStatus Tuner::openDemux(std::vector<int32_t>* out_demuxId,
                                       std::shared_ptr<IDemux>* _aidl_return) {
     ALOGV("%s", __FUNCTION__);
 
-    mLastUsedId += 1;
-    mDemuxes[mLastUsedId] = ndk::SharedRefBase::make<Demux>(mLastUsedId, this->ref<Tuner>());
+    bool found = false;
+    int32_t demuxId = 0;
+    for (auto e = mDemuxes.begin(); e != mDemuxes.end(); e++) {
+        if (!e->second->isInUse()) {
+            found = true;
+            demuxId = e->second->getDemuxId();
+        }
+    }
 
-    out_demuxId->push_back(mLastUsedId);
-    *_aidl_return = mDemuxes[mLastUsedId];
-
-    return ::ndk::ScopedAStatus::ok();
+    if (found) {
+        out_demuxId->push_back(demuxId);
+        return openDemuxById(demuxId, _aidl_return);
+    } else {
+        return ::ndk::ScopedAStatus::fromServiceSpecificError(
+                static_cast<int32_t>(Result::UNAVAILABLE));
+    }
 }
 
 ::ndk::ScopedAStatus Tuner::getDemuxCaps(DemuxCapabilities* _aidl_return) {
@@ -115,6 +182,18 @@
     // Support time filter testing
     _aidl_return->bTimeFilter = true;
 
+    // set filterCaps as the bitwize OR of all the demux' caps
+    std::vector<int32_t> demuxIds;
+    getDemuxIds(&demuxIds);
+    int32_t filterCaps = 0;
+
+    for (int i = 0; i < demuxIds.size(); i++) {
+        DemuxInfo demuxInfo;
+        getDemuxInfo(demuxIds[i], &demuxInfo);
+        filterCaps |= demuxInfo.filterTypes;
+    }
+    _aidl_return->filterCaps = filterCaps;
+
     return ::ndk::ScopedAStatus::ok();
 }
 
@@ -250,13 +329,13 @@
             break;
         }
     }
-    mDemuxes.erase(demuxId);
+    mDemuxes[demuxId]->setInUse(false);
 }
 
 void Tuner::removeFrontend(int32_t frontendId) {
     map<int32_t, int32_t>::iterator it = mFrontendToDemux.find(frontendId);
     if (it != mFrontendToDemux.end()) {
-        mDemuxes.erase(it->second);
+        mDemuxes[it->second]->setInUse(false);
     }
     mFrontendToDemux.erase(frontendId);
 }
diff --git a/tv/tuner/aidl/default/Tuner.h b/tv/tuner/aidl/default/Tuner.h
index a77c930..2656933 100644
--- a/tv/tuner/aidl/default/Tuner.h
+++ b/tv/tuner/aidl/default/Tuner.h
@@ -46,7 +46,11 @@
                                           std::shared_ptr<IFrontend>* _aidl_return) override;
     ::ndk::ScopedAStatus openDemux(std::vector<int32_t>* out_demuxId,
                                    std::shared_ptr<IDemux>* _aidl_return) override;
+    ::ndk::ScopedAStatus openDemuxById(int32_t in_demuxId,
+                                       std::shared_ptr<IDemux>* _aidl_return) override;
     ::ndk::ScopedAStatus getDemuxCaps(DemuxCapabilities* _aidl_return) override;
+    ::ndk::ScopedAStatus getDemuxInfo(int32_t in_demuxId, DemuxInfo* _aidl_return) override;
+    ::ndk::ScopedAStatus getDemuxIds(std::vector<int32_t>* _aidl_return) override;
     ::ndk::ScopedAStatus openDescrambler(std::shared_ptr<IDescrambler>* _aidl_return) override;
     ::ndk::ScopedAStatus getFrontendInfo(int32_t in_frontendId,
                                          FrontendInfo* _aidl_return) override;
@@ -77,12 +81,10 @@
     // Static mFrontends array to maintain local frontends information
     map<int32_t, std::shared_ptr<Frontend>> mFrontends;
     map<int32_t, int32_t> mFrontendToDemux;
-    map<int32_t, std::shared_ptr<Demux>> mDemuxes;
+    map<int32_t, std::shared_ptr<Demux>> mDemuxes;  // use demuxId as the key in
+                                                    // this sample implementation
     // To maintain how many Frontends we have
     int mFrontendSize;
-    // The last used demux id. Initial value is -1.
-    // First used id will be 0.
-    int32_t mLastUsedId = -1;
     vector<std::shared_ptr<Lnb>> mLnbs;
     map<FrontendType, int32_t> mMaxUsableFrontends;
 };
diff --git a/tv/tuner/aidl/default/service.cpp b/tv/tuner/aidl/default/service.cpp
index f980f4a..aa9f796 100644
--- a/tv/tuner/aidl/default/service.cpp
+++ b/tv/tuner/aidl/default/service.cpp
@@ -26,7 +26,7 @@
 using ::aidl::android::hardware::tv::tuner::Tuner;
 
 int main() {
-    ABinderProcess_setThreadPoolMaxThreadCount(8);
+    ABinderProcess_setThreadPoolMaxThreadCount(16);
     std::shared_ptr<Tuner> tuner = ndk::SharedRefBase::make<Tuner>();
     tuner->init();
 
diff --git a/tv/tuner/aidl/vts/functional/DemuxTests.cpp b/tv/tuner/aidl/vts/functional/DemuxTests.cpp
index 9de01e1..b2fca6f 100644
--- a/tv/tuner/aidl/vts/functional/DemuxTests.cpp
+++ b/tv/tuner/aidl/vts/functional/DemuxTests.cpp
@@ -16,6 +16,12 @@
 
 #include "DemuxTests.h"
 
+AssertionResult DemuxTests::getDemuxIds(std::vector<int32_t>& demuxIds) {
+    ndk::ScopedAStatus status;
+    status = mService->getDemuxIds(&demuxIds);
+    return AssertionResult(status.isOk());
+}
+
 AssertionResult DemuxTests::openDemux(std::shared_ptr<IDemux>& demux, int32_t& demuxId) {
     std::vector<int32_t> id;
     auto status = mService->openDemux(&id, &mDemux);
@@ -26,6 +32,14 @@
     return AssertionResult(status.isOk());
 }
 
+AssertionResult DemuxTests::openDemuxById(int32_t demuxId, std::shared_ptr<IDemux>& demux) {
+    auto status = mService->openDemuxById(demuxId, &mDemux);
+    if (status.isOk()) {
+        demux = mDemux;
+    }
+    return AssertionResult(status.isOk());
+}
+
 AssertionResult DemuxTests::setDemuxFrontendDataSource(int32_t frontendId) {
     EXPECT_TRUE(mDemux) << "Test with openDemux first.";
     auto status = mDemux->setFrontendDataSource(frontendId);
@@ -33,14 +47,15 @@
 }
 
 AssertionResult DemuxTests::getDemuxCaps(DemuxCapabilities& demuxCaps) {
-    if (!mDemux) {
-        ALOGW("[vts] Test with openDemux first.");
-        return failure();
-    }
     auto status = mService->getDemuxCaps(&demuxCaps);
     return AssertionResult(status.isOk());
 }
 
+AssertionResult DemuxTests::getDemuxInfo(int32_t demuxId, DemuxInfo& demuxInfo) {
+    auto status = mService->getDemuxInfo(demuxId, &demuxInfo);
+    return AssertionResult(status.isOk());
+}
+
 AssertionResult DemuxTests::getAvSyncId(std::shared_ptr<IFilter> filter, int32_t& avSyncHwId) {
     EXPECT_TRUE(mDemux) << "Demux is not opened yet.";
 
diff --git a/tv/tuner/aidl/vts/functional/DemuxTests.h b/tv/tuner/aidl/vts/functional/DemuxTests.h
index 7698de3..b58cf70 100644
--- a/tv/tuner/aidl/vts/functional/DemuxTests.h
+++ b/tv/tuner/aidl/vts/functional/DemuxTests.h
@@ -17,6 +17,7 @@
 #pragma once
 
 #include <aidl/android/hardware/tv/tuner/DemuxCapabilities.h>
+#include <aidl/android/hardware/tv/tuner/DemuxInfo.h>
 #include <aidl/android/hardware/tv/tuner/IDemux.h>
 #include <aidl/android/hardware/tv/tuner/IFilter.h>
 #include <aidl/android/hardware/tv/tuner/ITuner.h>
@@ -32,11 +33,14 @@
   public:
     void setService(std::shared_ptr<ITuner> tuner) { mService = tuner; }
 
+    AssertionResult getDemuxIds(std::vector<int32_t>& demuxIds);
     AssertionResult openDemux(std::shared_ptr<IDemux>& demux, int32_t& demuxId);
+    AssertionResult openDemuxById(int32_t demuxId, std::shared_ptr<IDemux>& demux);
     AssertionResult setDemuxFrontendDataSource(int32_t frontendId);
     AssertionResult getAvSyncId(std::shared_ptr<IFilter> filter, int32_t& avSyncHwId);
     AssertionResult getAvSyncTime(int32_t avSyncId);
     AssertionResult getDemuxCaps(DemuxCapabilities& demuxCaps);
+    AssertionResult getDemuxInfo(int32_t demuxId, DemuxInfo& demuxInfo);
     AssertionResult closeDemux();
 
   protected:
diff --git a/tv/tuner/aidl/vts/functional/FrontendTests.cpp b/tv/tuner/aidl/vts/functional/FrontendTests.cpp
index 2ff0c3d..b0f614e 100644
--- a/tv/tuner/aidl/vts/functional/FrontendTests.cpp
+++ b/tv/tuner/aidl/vts/functional/FrontendTests.cpp
@@ -434,6 +434,31 @@
                         expectStatuses[i].get<FrontendStatus::Tag::allPlpInfo>().begin()));
                 break;
             }
+            case FrontendStatusType::IPTV_CONTENT_URL: {
+                ASSERT_TRUE(realStatuses[i].get<FrontendStatus::Tag::iptvContentUrl>() ==
+                            expectStatuses[i].get<FrontendStatus::Tag::iptvContentUrl>());
+                break;
+            }
+            case FrontendStatusType::IPTV_PACKETS_LOST: {
+                ASSERT_TRUE(realStatuses[i].get<FrontendStatus::Tag::iptvPacketsLost>() ==
+                            expectStatuses[i].get<FrontendStatus::Tag::iptvPacketsLost>());
+                break;
+            }
+            case FrontendStatusType::IPTV_PACKETS_RECEIVED: {
+                ASSERT_TRUE(realStatuses[i].get<FrontendStatus::Tag::iptvPacketsReceived>() ==
+                            expectStatuses[i].get<FrontendStatus::Tag::iptvPacketsReceived>());
+                break;
+            }
+            case FrontendStatusType::IPTV_WORST_JITTER_MS: {
+                ASSERT_TRUE(realStatuses[i].get<FrontendStatus::Tag::iptvWorstJitterMs>() ==
+                            expectStatuses[i].get<FrontendStatus::Tag::iptvWorstJitterMs>());
+                break;
+            }
+            case FrontendStatusType::IPTV_AVERAGE_JITTER_MS: {
+                ASSERT_TRUE(realStatuses[i].get<FrontendStatus::Tag::iptvAverageJitterMs>() ==
+                            expectStatuses[i].get<FrontendStatus::Tag::iptvAverageJitterMs>());
+                break;
+            }
             default: {
                 continue;
             }
diff --git a/tv/tuner/aidl/vts/functional/VtsHalTvTunerTargetTest.cpp b/tv/tuner/aidl/vts/functional/VtsHalTvTunerTargetTest.cpp
index 6aa1e16..9db82c8 100644
--- a/tv/tuner/aidl/vts/functional/VtsHalTvTunerTargetTest.cpp
+++ b/tv/tuner/aidl/vts/functional/VtsHalTvTunerTargetTest.cpp
@@ -695,6 +695,34 @@
     }
 }
 
+TEST_P(TunerDemuxAidlTest, openDemuxById) {
+    description("Open (with id) and close a Demux.");
+    std::vector<int32_t> demuxIds;
+    ASSERT_TRUE(mDemuxTests.getDemuxIds(demuxIds));
+    for (int i = 0; i < demuxIds.size(); i++) {
+        std::shared_ptr<IDemux> demux;
+        ASSERT_TRUE(mDemuxTests.openDemuxById(demuxIds[i], demux));
+        ASSERT_TRUE(mDemuxTests.closeDemux());
+    }
+}
+
+TEST_P(TunerDemuxAidlTest, getDemuxInfo) {
+    description("Check getDemuxInfo against demux caps");
+    std::vector<int32_t> demuxIds;
+    ASSERT_TRUE(mDemuxTests.getDemuxIds(demuxIds));
+    int32_t combinedFilterTypes = 0;
+    for (int i = 0; i < demuxIds.size(); i++) {
+        DemuxInfo demuxInfo;
+        ASSERT_TRUE(mDemuxTests.getDemuxInfo(demuxIds[i], demuxInfo));
+        combinedFilterTypes |= demuxInfo.filterTypes;
+    }
+    if (demuxIds.size() > 0) {
+        DemuxCapabilities demuxCaps;
+        ASSERT_TRUE(mDemuxTests.getDemuxCaps(demuxCaps));
+        ASSERT_TRUE(demuxCaps.filterCaps == combinedFilterTypes);
+    }
+}
+
 TEST_P(TunerDemuxAidlTest, getAvSyncTime) {
     description("Get the A/V sync time from a PCR filter.");
     if (!live.hasFrontendConnection) {
diff --git a/usb/aidl/aidl_api/android.hardware.usb/current/android/hardware/usb/AltModeData.aidl b/usb/aidl/aidl_api/android.hardware.usb/current/android/hardware/usb/AltModeData.aidl
index 8e9dd00..d25ee84 100644
--- a/usb/aidl/aidl_api/android.hardware.usb/current/android/hardware/usb/AltModeData.aidl
+++ b/usb/aidl/aidl_api/android.hardware.usb/current/android/hardware/usb/AltModeData.aidl
@@ -40,5 +40,7 @@
     android.hardware.usb.DisplayPortAltModeStatus partnerSinkStatus = android.hardware.usb.DisplayPortAltModeStatus.UNKNOWN;
     android.hardware.usb.DisplayPortAltModeStatus cableStatus = android.hardware.usb.DisplayPortAltModeStatus.UNKNOWN;
     android.hardware.usb.DisplayPortAltModePinAssignment pinAssignment = android.hardware.usb.DisplayPortAltModePinAssignment.NONE;
+    boolean hpd = false;
+    android.hardware.usb.LinkTrainingStatus linkTrainingStatus = android.hardware.usb.LinkTrainingStatus.UNKNOWN;
   }
 }
diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/MediaProtocolType.aidl b/usb/aidl/aidl_api/android.hardware.usb/current/android/hardware/usb/LinkTrainingStatus.aidl
similarity index 90%
copy from radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/MediaProtocolType.aidl
copy to usb/aidl/aidl_api/android.hardware.usb/current/android/hardware/usb/LinkTrainingStatus.aidl
index 1a290d4..1f0b2dc 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/MediaProtocolType.aidl
+++ b/usb/aidl/aidl_api/android.hardware.usb/current/android/hardware/usb/LinkTrainingStatus.aidl
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright (C) 2023 The Android Open Source Project
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -31,9 +31,10 @@
 // with such a backward incompatible change, it has a high risk of breaking
 // later when a module using the interface is updated, e.g., Mainline modules.
 
-package android.hardware.radio.ims.media;
+package android.hardware.usb;
 @Backing(type="int") @VintfStability
-enum MediaProtocolType {
-  RTP = 0,
-  RTCP = 1,
+enum LinkTrainingStatus {
+  UNKNOWN = 0,
+  SUCCESS = 1,
+  FAILURE = 2,
 }
diff --git a/usb/aidl/android/hardware/usb/AltModeData.aidl b/usb/aidl/android/hardware/usb/AltModeData.aidl
index e103ff9..0b1e06a 100644
--- a/usb/aidl/android/hardware/usb/AltModeData.aidl
+++ b/usb/aidl/android/hardware/usb/AltModeData.aidl
@@ -18,6 +18,7 @@
 
 import android.hardware.usb.DisplayPortAltModePinAssignment;
 import android.hardware.usb.DisplayPortAltModeStatus;
+import android.hardware.usb.LinkTrainingStatus;
 
 @VintfStability
 union AltModeData {
@@ -42,6 +43,18 @@
          * negotiated between the device, port partner, and cable.
          */
         DisplayPortAltModePinAssignment pinAssignment = DisplayPortAltModePinAssignment.NONE;
+        /**
+         * Indicates DisplayPort Hot Plug Detection (HPD) status for a partner
+         * sink device. If true, then a DisplayPort Alt Mode partner sink is
+         * connected and powered on, and if false, the partner sink is not
+         * powered or no partner sink is connected.
+         */
+        boolean hpd = false;
+        /**
+         * Indicates the current status of DisplayPort link training over USB-C
+         * for the attached DisplayPort Alt Mode partner sink.
+         */
+        LinkTrainingStatus linkTrainingStatus = LinkTrainingStatus.UNKNOWN;
     }
     DisplayPortAltModeData displayPortAltModeData;
 }
diff --git a/usb/aidl/android/hardware/usb/LinkTrainingStatus.aidl b/usb/aidl/android/hardware/usb/LinkTrainingStatus.aidl
new file mode 100644
index 0000000..9f3b3c3
--- /dev/null
+++ b/usb/aidl/android/hardware/usb/LinkTrainingStatus.aidl
@@ -0,0 +1,43 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.usb;
+
+@VintfStability
+@Backing(type="int")
+/**
+ * Indicates the current status of DisplayPort link training over USB-C for the
+ * attached DisplayPort Alt Mode partner sink as described in DisplayPort
+ * v1.4/2.1.
+ */
+enum LinkTrainingStatus {
+    /*
+     * Indicates the link training result is not available because link training
+     * has not completed or initiated yet.
+     */
+    UNKNOWN = 0,
+    /*
+     * Indicates that link training has completed and optimal settings for data
+     * transmission between the sink and source device have successfully been
+     * negotiated.
+     */
+    SUCCESS = 1,
+    /*
+     * Indicates that link training has failed and the link initialization has
+     * terminated.
+     */
+    FAILURE = 2,
+}
diff --git a/usb/aidl/vts/VtsAidlUsbTargetTest.cpp b/usb/aidl/vts/VtsAidlUsbTargetTest.cpp
index 2ec5a2c..e9aa65b 100644
--- a/usb/aidl/vts/VtsAidlUsbTargetTest.cpp
+++ b/usb/aidl/vts/VtsAidlUsbTargetTest.cpp
@@ -49,6 +49,7 @@
 using ::aidl::android::hardware::usb::DisplayPortAltModeStatus;
 using ::aidl::android::hardware::usb::IUsb;
 using ::aidl::android::hardware::usb::IUsbCallback;
+using ::aidl::android::hardware::usb::LinkTrainingStatus;
 using ::aidl::android::hardware::usb::PlugOrientation;
 using ::aidl::android::hardware::usb::PortDataRole;
 using ::aidl::android::hardware::usb::PortMode;
@@ -253,6 +254,9 @@
   std::mutex usb_mtx;
   std::condition_variable usb_cv;
   int usb_count = 0;
+
+  // Stores usb version
+  int32_t usb_version;
 };
 
 /*
@@ -295,6 +299,12 @@
   int disabledCount = 0;
 
   ALOGI("UsbAidlTest DataStatusCheck  start");
+  auto retVersion = usb->getInterfaceVersion(&usb_version);
+  ASSERT_TRUE(retVersion.isOk()) << retVersion;
+  if (usb_version < 2) {
+    ALOGI("UsbAidlTest skipping DataStatusCheck on older interface versions");
+    GTEST_SKIP();
+  }
   int64_t transactionId = rand() % 10000;
   const auto& ret = usb->queryPortStatus(transactionId);
   ASSERT_TRUE(ret.isOk());
@@ -603,19 +613,25 @@
  * supportsComplianceWarning is false.
  */
 TEST_P(UsbAidlTest, nonCompliantChargerStatus) {
-    ALOGI("UsbAidlTest nonCompliantChargerStatus start");
-    int64_t transactionId = rand() % 10000;
-    const auto& ret = usb->queryPortStatus(transactionId);
-    ASSERT_TRUE(ret.isOk());
-    EXPECT_EQ(std::cv_status::no_timeout, wait());
-    EXPECT_EQ(2, usb_last_cookie);
-    EXPECT_EQ(transactionId, last_transactionId);
+  ALOGI("UsbAidlTest nonCompliantChargerStatus start");
+  auto retVersion = usb->getInterfaceVersion(&usb_version);
+  ASSERT_TRUE(retVersion.isOk()) << retVersion;
+  if (usb_version < 2) {
+    ALOGI("UsbAidlTest skipping nonCompliantChargerStatus on older interface versions");
+    GTEST_SKIP();
+  }
+  int64_t transactionId = rand() % 10000;
+  const auto& ret = usb->queryPortStatus(transactionId);
+  ASSERT_TRUE(ret.isOk());
+  EXPECT_EQ(std::cv_status::no_timeout, wait());
+  EXPECT_EQ(2, usb_last_cookie);
+  EXPECT_EQ(transactionId, last_transactionId);
 
-    if (!usb_last_port_status.supportsComplianceWarnings) {
-      EXPECT_TRUE(usb_last_port_status.complianceWarnings.empty());
-    }
+  if (!usb_last_port_status.supportsComplianceWarnings) {
+    EXPECT_TRUE(usb_last_port_status.complianceWarnings.empty());
+  }
 
-    ALOGI("UsbAidlTest nonCompliantChargerStatus end");
+  ALOGI("UsbAidlTest nonCompliantChargerStatus end");
 }
 
 /*
@@ -624,39 +640,51 @@
  * are valid.
  */
 TEST_P(UsbAidlTest, nonCompliantChargerValues) {
-    ALOGI("UsbAidlTest nonCompliantChargerValues start");
-    int64_t transactionId = rand() % 10000;
-    const auto& ret = usb->queryPortStatus(transactionId);
-    ASSERT_TRUE(ret.isOk());
-    EXPECT_EQ(std::cv_status::no_timeout, wait());
-    EXPECT_EQ(2, usb_last_cookie);
-    EXPECT_EQ(transactionId, last_transactionId);
+  ALOGI("UsbAidlTest nonCompliantChargerValues start");
+  auto retVersion = usb->getInterfaceVersion(&usb_version);
+  ASSERT_TRUE(retVersion.isOk()) << retVersion;
+  if (usb_version < 2) {
+    ALOGI("UsbAidlTest skipping nonCompliantChargerValues on older interface versions");
+    GTEST_SKIP();
+  }
+  int64_t transactionId = rand() % 10000;
+  const auto& ret = usb->queryPortStatus(transactionId);
+  ASSERT_TRUE(ret.isOk());
+  EXPECT_EQ(std::cv_status::no_timeout, wait());
+  EXPECT_EQ(2, usb_last_cookie);
+  EXPECT_EQ(transactionId, last_transactionId);
 
-    // Current compliance values range from [1, 4]
-    if (usb_last_port_status.supportsComplianceWarnings) {
-      for (auto warning : usb_last_port_status.complianceWarnings) {
-        EXPECT_TRUE((int)warning >= (int)ComplianceWarning::OTHER);
-        EXPECT_TRUE((int)warning <= (int)ComplianceWarning::MISSING_RP);
-      }
+  // Current compliance values range from [1, 4]
+  if (usb_last_port_status.supportsComplianceWarnings) {
+    for (auto warning : usb_last_port_status.complianceWarnings) {
+      EXPECT_TRUE((int)warning >= (int)ComplianceWarning::OTHER);
+      EXPECT_TRUE((int)warning <= (int)ComplianceWarning::MISSING_RP);
     }
+  }
 
-    ALOGI("UsbAidlTest nonCompliantChargerValues end");
+  ALOGI("UsbAidlTest nonCompliantChargerValues end");
 }
 
 /*
  * Test PlugOrientation Values are within range in PortStatus
  */
 TEST_P(UsbAidlTest, plugOrientationValues) {
-    ALOGI("UsbAidlTest plugOrientationValues start");
-    int64_t transactionId = rand() % 10000;
-    const auto& ret = usb->queryPortStatus(transactionId);
-    ASSERT_TRUE(ret.isOk());
-    EXPECT_EQ(std::cv_status::no_timeout, wait());
-    EXPECT_EQ(2, usb_last_cookie);
-    EXPECT_EQ(transactionId, last_transactionId);
+  ALOGI("UsbAidlTest plugOrientationValues start");
+  auto retVersion = usb->getInterfaceVersion(&usb_version);
+  ASSERT_TRUE(retVersion.isOk()) << retVersion;
+  if (usb_version < 2) {
+    ALOGI("UsbAidlTest skipping plugOrientationValues on older interface versions");
+    GTEST_SKIP();
+  }
+  int64_t transactionId = rand() % 10000;
+  const auto& ret = usb->queryPortStatus(transactionId);
+  ASSERT_TRUE(ret.isOk());
+  EXPECT_EQ(std::cv_status::no_timeout, wait());
+  EXPECT_EQ(2, usb_last_cookie);
+  EXPECT_EQ(transactionId, last_transactionId);
 
-    EXPECT_TRUE((int)usb_last_port_status.plugOrientation >= (int)PlugOrientation::UNKNOWN);
-    EXPECT_TRUE((int)usb_last_port_status.plugOrientation <= (int)PlugOrientation::PLUGGED_FLIPPED);
+  EXPECT_TRUE((int)usb_last_port_status.plugOrientation >= (int)PlugOrientation::UNKNOWN);
+  EXPECT_TRUE((int)usb_last_port_status.plugOrientation <= (int)PlugOrientation::PLUGGED_FLIPPED);
 }
 
 /*
@@ -664,37 +692,47 @@
  * is active.
  */
 TEST_P(UsbAidlTest, dpAltModeValues) {
-    ALOGI("UsbAidlTest dpAltModeValues start");
-    int64_t transactionId = rand() % 10000;
-    const auto& ret = usb->queryPortStatus(transactionId);
-    ASSERT_TRUE(ret.isOk());
-    EXPECT_EQ(std::cv_status::no_timeout, wait());
-    EXPECT_EQ(2, usb_last_cookie);
-    EXPECT_EQ(transactionId, last_transactionId);
+  ALOGI("UsbAidlTest dpAltModeValues start");
+  auto retVersion = usb->getInterfaceVersion(&usb_version);
+  ASSERT_TRUE(retVersion.isOk()) << retVersion;
+  if (usb_version < 2) {
+    ALOGI("UsbAidlTest skipping dpAltModeValues on older interface versions");
+    GTEST_SKIP();
+  }
+  int64_t transactionId = rand() % 10000;
+  const auto& ret = usb->queryPortStatus(transactionId);
+  ASSERT_TRUE(ret.isOk());
+  EXPECT_EQ(std::cv_status::no_timeout, wait());
+  EXPECT_EQ(2, usb_last_cookie);
+  EXPECT_EQ(transactionId, last_transactionId);
 
-    // Discover DisplayPort Alt Mode
-    for (AltModeData altMode : usb_last_port_status.supportedAltModes) {
-      if (altMode.getTag() == AltModeData::displayPortAltModeData) {
-        AltModeData::DisplayPortAltModeData displayPortAltModeData =
-                altMode.get<AltModeData::displayPortAltModeData>();
-        EXPECT_TRUE((int)displayPortAltModeData.partnerSinkStatus >=
-                    (int)DisplayPortAltModeStatus::UNKNOWN);
-        EXPECT_TRUE((int)displayPortAltModeData.partnerSinkStatus <=
-                    (int)DisplayPortAltModeStatus::ENABLED);
+  // Discover DisplayPort Alt Mode
+  for (AltModeData altMode : usb_last_port_status.supportedAltModes) {
+    if (altMode.getTag() == AltModeData::displayPortAltModeData) {
+      AltModeData::DisplayPortAltModeData displayPortAltModeData =
+              altMode.get<AltModeData::displayPortAltModeData>();
+      EXPECT_TRUE((int)displayPortAltModeData.partnerSinkStatus >=
+                  (int)DisplayPortAltModeStatus::UNKNOWN);
+      EXPECT_TRUE((int)displayPortAltModeData.partnerSinkStatus <=
+                  (int)DisplayPortAltModeStatus::ENABLED);
 
-        EXPECT_TRUE((int)displayPortAltModeData.cableStatus >=
-                    (int)DisplayPortAltModeStatus::UNKNOWN);
-        EXPECT_TRUE((int)displayPortAltModeData.cableStatus <=
-                    (int)DisplayPortAltModeStatus::ENABLED);
+      EXPECT_TRUE((int)displayPortAltModeData.cableStatus >=
+                  (int)DisplayPortAltModeStatus::UNKNOWN);
+      EXPECT_TRUE((int)displayPortAltModeData.cableStatus <=
+                  (int)DisplayPortAltModeStatus::ENABLED);
 
-        EXPECT_TRUE((int)displayPortAltModeData.pinAssignment >=
-                    (int)DisplayPortAltModePinAssignment::NONE);
-        EXPECT_TRUE((int)displayPortAltModeData.pinAssignment <=
-                    (int)DisplayPortAltModePinAssignment::F);
-      }
+      EXPECT_TRUE((int)displayPortAltModeData.pinAssignment >=
+                  (int)DisplayPortAltModePinAssignment::NONE);
+      EXPECT_TRUE((int)displayPortAltModeData.pinAssignment <=
+                  (int)DisplayPortAltModePinAssignment::F);
+
+      EXPECT_TRUE((int)displayPortAltModeData.linkTrainingStatus >=
+                  (int)LinkTrainingStatus::UNKNOWN);
+      EXPECT_TRUE((int)displayPortAltModeData.pinAssignment <= (int)LinkTrainingStatus::FAILURE);
     }
+  }
 
-    ALOGI("UsbAidlTest dpAltModeValues end");
+  ALOGI("UsbAidlTest dpAltModeValues end");
 }
 
 GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(UsbAidlTest);
diff --git a/usb/gadget/aidl/aidl_api/android.hardware.usb.gadget/current/android/hardware/usb/gadget/IUsbGadgetCallback.aidl b/usb/gadget/aidl/aidl_api/android.hardware.usb.gadget/current/android/hardware/usb/gadget/IUsbGadgetCallback.aidl
index 8672a0c..9de68de 100644
--- a/usb/gadget/aidl/aidl_api/android.hardware.usb.gadget/current/android/hardware/usb/gadget/IUsbGadgetCallback.aidl
+++ b/usb/gadget/aidl/aidl_api/android.hardware.usb.gadget/current/android/hardware/usb/gadget/IUsbGadgetCallback.aidl
@@ -34,7 +34,7 @@
 package android.hardware.usb.gadget;
 @VintfStability
 interface IUsbGadgetCallback {
+  oneway void setCurrentUsbFunctionsCb(in long functions, in android.hardware.usb.gadget.Status status, long transactionId);
   oneway void getCurrentUsbFunctionsCb(in long functions, in android.hardware.usb.gadget.Status status, long transactionId);
   oneway void getUsbSpeedCb(in android.hardware.usb.gadget.UsbSpeed speed, long transactionId);
-  oneway void setCurrentUsbFunctionsCb(in long functions, in android.hardware.usb.gadget.Status status, long transactionId);
 }
diff --git a/usb/gadget/aidl/aidl_api/android.hardware.usb.gadget/current/android/hardware/usb/gadget/UsbSpeed.aidl b/usb/gadget/aidl/aidl_api/android.hardware.usb.gadget/current/android/hardware/usb/gadget/UsbSpeed.aidl
index 0f54ee5..7d4fa17 100644
--- a/usb/gadget/aidl/aidl_api/android.hardware.usb.gadget/current/android/hardware/usb/gadget/UsbSpeed.aidl
+++ b/usb/gadget/aidl/aidl_api/android.hardware.usb.gadget/current/android/hardware/usb/gadget/UsbSpeed.aidl
@@ -34,11 +34,15 @@
 package android.hardware.usb.gadget;
 @Backing(type="int") @VintfStability
 enum UsbSpeed {
-  UNKNOWN = 0,
-  LOWSPEED = 1,
-  FULLSPEED = 2,
-  HIGHSPEED = 3,
-  SUPERSPEED = 4,
-  SUPERSPEED_10Gb = 5,
-  SUPERSPEED_20Gb = 6,
+  UNKNOWN = (-1),
+  LOWSPEED = 0,
+  FULLSPEED = 1,
+  HIGHSPEED = 2,
+  SUPERSPEED = 3,
+  SUPERSPEED_10Gb = 4,
+  SUPERSPEED_20Gb = 5,
+  USB4_GEN2_10Gb = 6,
+  USB4_GEN2_20Gb = 7,
+  USB4_GEN3_20Gb = 8,
+  USB4_GEN3_40Gb = 9,
 }
diff --git a/usb/gadget/aidl/android/hardware/usb/gadget/GadgetFunction.aidl b/usb/gadget/aidl/android/hardware/usb/gadget/GadgetFunction.aidl
index 18b31b8..d82b427 100644
--- a/usb/gadget/aidl/android/hardware/usb/gadget/GadgetFunction.aidl
+++ b/usb/gadget/aidl/android/hardware/usb/gadget/GadgetFunction.aidl
@@ -29,29 +29,29 @@
     /**
      * Android open accessory protocol function.
      */
-    const long ACCESSORY = 2;
+    const long ACCESSORY = 1 << 1;
     /**
      * Media Transfer protocol function.
      */
-    const long MTP = 4;
+    const long MTP = 1 << 2;
     /**
      * Peripheral mode USB Midi function.
      */
-    const long MIDI = 8;
+    const long MIDI = 1 << 3;
     /**
      * Picture transfer protocol function.
      */
-    const long PTP = 16;
+    const long PTP = 1 << 4;
     /**
      * Tethering function.
      */
-    const long RNDIS = 32;
+    const long RNDIS = 1 << 5;
     /**
      * AOAv2.0 - Audio Source function.
      */
-    const long AUDIO_SOURCE = 64;
+    const long AUDIO_SOURCE = 1 << 6;
     /**
      * NCM - NCM function.
      */
-    const long NCM = 1024;
+    const long NCM = 1 << 10;
 }
diff --git a/usb/gadget/aidl/android/hardware/usb/gadget/IUsbGadget.aidl b/usb/gadget/aidl/android/hardware/usb/gadget/IUsbGadget.aidl
index d187993..9c3f0d4 100644
--- a/usb/gadget/aidl/android/hardware/usb/gadget/IUsbGadget.aidl
+++ b/usb/gadget/aidl/android/hardware/usb/gadget/IUsbGadget.aidl
@@ -16,15 +16,13 @@
 
 package android.hardware.usb.gadget;
 
-import android.hardware.usb.gadget.GadgetFunction;
 import android.hardware.usb.gadget.IUsbGadgetCallback;
 
 @VintfStability
 oneway interface IUsbGadget {
     /**
      * This function is used to set the current USB gadget configuration.
-     * Usb gadget needs to teared down if an USB configuration is already
-     * active.
+     * Usb gadget needs to be reset if an USB configuration is already.
      *
      * @param functions The GadgetFunction bitmap. See GadgetFunction for
      *                  the value of each bit.
@@ -36,7 +34,7 @@
      *
      */
     void setCurrentUsbFunctions(in long functions, in IUsbGadgetCallback callback,
-        in long timeoutMs, long transactionId);
+            in long timeoutMs, long transactionId);
 
     /**
      * This function is used to query the USB functions included in the
diff --git a/usb/gadget/aidl/android/hardware/usb/gadget/IUsbGadgetCallback.aidl b/usb/gadget/aidl/android/hardware/usb/gadget/IUsbGadgetCallback.aidl
index 75ff02b..b4945a0 100644
--- a/usb/gadget/aidl/android/hardware/usb/gadget/IUsbGadgetCallback.aidl
+++ b/usb/gadget/aidl/android/hardware/usb/gadget/IUsbGadgetCallback.aidl
@@ -16,13 +16,26 @@
 
 package android.hardware.usb.gadget;
 
-import android.hardware.usb.gadget.GadgetFunction;
 import android.hardware.usb.gadget.Status;
 import android.hardware.usb.gadget.UsbSpeed;
 
 @VintfStability
 oneway interface IUsbGadgetCallback {
     /**
+     * Callback function used to propagate the status of configuration
+     * switch to the caller.
+     *
+     * @param functions list of functions defined by GadgetFunction
+     *                  included in the current USB gadget composition.
+     * @param status SUCCESS when the functions are applied.
+     *               FUNCTIONS_NOT_SUPPORTED when the configuration is
+     *                                       not supported.
+     *               ERROR otherwise.
+     * @param transactionId ID to be used when invoking the callback.
+     */
+    void setCurrentUsbFunctionsCb(in long functions, in Status status, long transactionId);
+
+    /**
      * Callback function used to propagate the current USB gadget
      * configuration.
      * @param functions The GadgetFunction bitmap. See GadgetFunction for
@@ -46,18 +59,4 @@
      * @param transactionId ID to be used when invoking the callback.
      */
     void getUsbSpeedCb(in UsbSpeed speed, long transactionId);
-
-    /**
-     * Callback function used to propagate the status of configuration
-     * switch to the caller.
-     *
-     * @param functions list of functions defined by GadgetFunction
-     *                  included in the current USB gadget composition.
-     * @param status SUCCESS when the functions are applied.
-     *               FUNCTIONS_NOT_SUPPORTED when the configuration is
-     *                                       not supported.
-     *               ERROR otherwise.
-     * @param transactionId ID to be used when invoking the callback.
-     */
-    void setCurrentUsbFunctionsCb(in long functions, in Status status, long transactionId);
 }
diff --git a/usb/gadget/aidl/android/hardware/usb/gadget/UsbSpeed.aidl b/usb/gadget/aidl/android/hardware/usb/gadget/UsbSpeed.aidl
index 0492757..2a3fb93 100644
--- a/usb/gadget/aidl/android/hardware/usb/gadget/UsbSpeed.aidl
+++ b/usb/gadget/aidl/android/hardware/usb/gadget/UsbSpeed.aidl
@@ -22,29 +22,55 @@
     /**
      * UNKNOWN - Not Connected or Unsupported Speed
      */
-    UNKNOWN = 0,
+    UNKNOWN = -1,
+
     /**
      * USB Low Speed
      */
-    LOWSPEED = 1,
+    LOWSPEED = 0,
+
     /**
      * USB Full Speed
      */
-    FULLSPEED = 2,
+    FULLSPEED = 1,
+
     /**
      * USB High Speed
      */
-    HIGHSPEED = 3,
+    HIGHSPEED = 2,
+
     /**
      * USB Super Speed
      */
-    SUPERSPEED = 4,
+    SUPERSPEED = 3,
+
     /**
      * USB Super Speed 10Gbps
      */
-    SUPERSPEED_10Gb = 5,
+    SUPERSPEED_10Gb = 4,
+
     /**
      * USB Super Speed 20Gbps
      */
-    SUPERSPEED_20Gb = 6,
+    SUPERSPEED_20Gb = 5,
+
+    /**
+     * USB4 Gen2 x 1 (10Gbps)
+     */
+    USB4_GEN2_10Gb = 6,
+
+    /**
+     * USB4 Gen2 x 2 (20Gbps)
+     */
+    USB4_GEN2_20Gb = 7,
+
+    /**
+     * USB4 Gen3 x 1 (20Gbps)
+     */
+    USB4_GEN3_20Gb = 8,
+
+    /**
+     * USB4 Gen3 x 2 (40Gbps)
+     */
+    USB4_GEN3_40Gb = 9,
 }
diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/IWifiNanIface.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/IWifiNanIface.aidl
index 3dff5bf..b20f505 100644
--- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/IWifiNanIface.aidl
+++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/IWifiNanIface.aidl
@@ -49,6 +49,8 @@
   void stopPublishRequest(in char cmdId, in byte sessionId);
   void stopSubscribeRequest(in char cmdId, in byte sessionId);
   void terminateDataPathRequest(in char cmdId, in int ndpInstanceId);
+  void suspendRequest(in char cmdId, in byte sessionId);
+  void resumeRequest(in char cmdId, in byte sessionId);
   void transmitFollowupRequest(in char cmdId, in android.hardware.wifi.NanTransmitFollowupRequest msg);
   void initiatePairingRequest(in char cmdId, in android.hardware.wifi.NanPairingRequest msg);
   void respondToPairingIndicationRequest(in char cmdId, in android.hardware.wifi.NanRespondToPairingIndicationRequest msg);
diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/IWifiNanIfaceEventCallback.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/IWifiNanIfaceEventCallback.aidl
index b6c9d1f..dfb28aa 100644
--- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/IWifiNanIfaceEventCallback.aidl
+++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/IWifiNanIfaceEventCallback.aidl
@@ -59,6 +59,8 @@
   oneway void notifyStopPublishResponse(in char id, in android.hardware.wifi.NanStatus status);
   oneway void notifyStopSubscribeResponse(in char id, in android.hardware.wifi.NanStatus status);
   oneway void notifyTerminateDataPathResponse(in char id, in android.hardware.wifi.NanStatus status);
+  oneway void notifySuspendResponse(in char id, in android.hardware.wifi.NanStatus status);
+  oneway void notifyResumeResponse(in char id, in android.hardware.wifi.NanStatus status);
   oneway void notifyTransmitFollowupResponse(in char id, in android.hardware.wifi.NanStatus status);
   oneway void eventPairingRequest(in android.hardware.wifi.NanPairingRequestInd event);
   oneway void eventPairingConfirm(in android.hardware.wifi.NanPairingConfirmInd event);
diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/IWifiStaIface.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/IWifiStaIface.aidl
index ac5b93b..9a4c050 100644
--- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/IWifiStaIface.aidl
+++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/IWifiStaIface.aidl
@@ -64,20 +64,20 @@
   void setDtimMultiplier(in int multiplier);
   @Backing(type="int") @VintfStability
   enum StaIfaceCapabilityMask {
-    APF = 1,
-    BACKGROUND_SCAN = 2,
-    LINK_LAYER_STATS = 4,
-    RSSI_MONITOR = 8,
-    CONTROL_ROAMING = 16,
-    PROBE_IE_ALLOWLIST = 32,
-    SCAN_RAND = 64,
-    STA_5G = 128,
-    HOTSPOT = 256,
-    PNO = 512,
-    TDLS = 1024,
-    TDLS_OFFCHANNEL = 2048,
-    ND_OFFLOAD = 4096,
-    KEEP_ALIVE = 8192,
-    DEBUG_PACKET_FATE = 16384,
+    APF = (1 << 0),
+    BACKGROUND_SCAN = (1 << 1),
+    LINK_LAYER_STATS = (1 << 2),
+    RSSI_MONITOR = (1 << 3),
+    CONTROL_ROAMING = (1 << 4),
+    PROBE_IE_ALLOWLIST = (1 << 5),
+    SCAN_RAND = (1 << 6),
+    STA_5G = (1 << 7),
+    HOTSPOT = (1 << 8),
+    PNO = (1 << 9),
+    TDLS = (1 << 10),
+    TDLS_OFFCHANNEL = (1 << 11),
+    ND_OFFLOAD = (1 << 12),
+    KEEP_ALIVE = (1 << 13),
+    DEBUG_PACKET_FATE = (1 << 14),
   }
 }
diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/IfaceConcurrencyType.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/IfaceConcurrencyType.aidl
index 0a3ad1a..d584423 100644
--- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/IfaceConcurrencyType.aidl
+++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/IfaceConcurrencyType.aidl
@@ -34,9 +34,9 @@
 package android.hardware.wifi;
 @Backing(type="int") @VintfStability
 enum IfaceConcurrencyType {
-  STA = 0,
-  AP = 1,
-  AP_BRIDGED = 2,
-  P2P = 3,
-  NAN_IFACE = 4,
+  STA,
+  AP,
+  AP_BRIDGED,
+  P2P,
+  NAN_IFACE,
 }
diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/IfaceType.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/IfaceType.aidl
index dbdc439..67022df 100644
--- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/IfaceType.aidl
+++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/IfaceType.aidl
@@ -34,8 +34,8 @@
 package android.hardware.wifi;
 @Backing(type="int") @VintfStability
 enum IfaceType {
-  STA = 0,
-  AP = 1,
-  P2P = 2,
-  NAN_IFACE = 3,
+  STA,
+  AP,
+  P2P,
+  NAN_IFACE,
 }
diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanBandIndex.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanBandIndex.aidl
index ca6c910..3f1ea5e 100644
--- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanBandIndex.aidl
+++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanBandIndex.aidl
@@ -35,6 +35,6 @@
 @Backing(type="int") @VintfStability
 enum NanBandIndex {
   NAN_BAND_24GHZ = 0,
-  NAN_BAND_5GHZ = 1,
+  NAN_BAND_5GHZ,
   NAN_BAND_6GHZ = 2,
 }
diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanBootstrappingMethod.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanBootstrappingMethod.aidl
index e5f0975..1504534 100644
--- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanBootstrappingMethod.aidl
+++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanBootstrappingMethod.aidl
@@ -34,15 +34,15 @@
 package android.hardware.wifi;
 @Backing(type="int") @VintfStability
 enum NanBootstrappingMethod {
-  BOOTSTRAPPING_OPPORTUNISTIC_MASK = 1,
-  BOOTSTRAPPING_PIN_CODE_DISPLAY_MASK = 2,
-  BOOTSTRAPPING_PASSPHRASE_DISPLAY_MASK = 4,
-  BOOTSTRAPPING_QR_DISPLAY_MASK = 8,
-  BOOTSTRAPPING_NFC_TAG_MASK = 16,
-  BOOTSTRAPPING_PIN_CODE_KEYPAD_MASK = 32,
-  BOOTSTRAPPING_PASSPHRASE_KEYPAD_MASK = 64,
-  BOOTSTRAPPING_QR_SCAN_MASK = 128,
-  BOOTSTRAPPING_NFC_READER_MASK = 256,
-  BOOTSTRAPPING_SERVICE_MANAGED_MASK = 16384,
-  BOOTSTRAPPING_HANDSHAKE_SHIP_MASK = 32768,
+  BOOTSTRAPPING_OPPORTUNISTIC_MASK = (1 << 0),
+  BOOTSTRAPPING_PIN_CODE_DISPLAY_MASK = (1 << 1),
+  BOOTSTRAPPING_PASSPHRASE_DISPLAY_MASK = (1 << 2),
+  BOOTSTRAPPING_QR_DISPLAY_MASK = (1 << 3),
+  BOOTSTRAPPING_NFC_TAG_MASK = (1 << 4),
+  BOOTSTRAPPING_PIN_CODE_KEYPAD_MASK = (1 << 5),
+  BOOTSTRAPPING_PASSPHRASE_KEYPAD_MASK = (1 << 6),
+  BOOTSTRAPPING_QR_SCAN_MASK = (1 << 7),
+  BOOTSTRAPPING_NFC_READER_MASK = (1 << 8),
+  BOOTSTRAPPING_SERVICE_MANAGED_MASK = (1 << 14),
+  BOOTSTRAPPING_HANDSHAKE_SHIP_MASK = (1 << 15),
 }
diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanCapabilities.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanCapabilities.aidl
index cb5a95c..bb44679 100644
--- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanCapabilities.aidl
+++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanCapabilities.aidl
@@ -53,4 +53,5 @@
   boolean supportsHe;
   boolean supportsPairing;
   boolean supportsSetClusterId;
+  boolean supportsSuspension;
 }
diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanCipherSuiteType.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanCipherSuiteType.aidl
index 4450956..e98122d 100644
--- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanCipherSuiteType.aidl
+++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanCipherSuiteType.aidl
@@ -35,8 +35,8 @@
 @Backing(type="int") @VintfStability
 enum NanCipherSuiteType {
   NONE = 0,
-  SHARED_KEY_128_MASK = 1,
-  SHARED_KEY_256_MASK = 2,
-  PUBLIC_KEY_128_MASK = 4,
-  PUBLIC_KEY_256_MASK = 8,
+  SHARED_KEY_128_MASK = (1 << 0),
+  SHARED_KEY_256_MASK = (1 << 1),
+  PUBLIC_KEY_128_MASK = (1 << 2),
+  PUBLIC_KEY_256_MASK = (1 << 3),
 }
diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanClusterEventType.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanClusterEventType.aidl
index 1dfa45f..6c20543 100644
--- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanClusterEventType.aidl
+++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanClusterEventType.aidl
@@ -35,6 +35,6 @@
 @Backing(type="int") @VintfStability
 enum NanClusterEventType {
   DISCOVERY_MAC_ADDRESS_CHANGED = 0,
-  STARTED_CLUSTER = 1,
-  JOINED_CLUSTER = 2,
+  STARTED_CLUSTER,
+  JOINED_CLUSTER,
 }
diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanDataPathChannelCfg.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanDataPathChannelCfg.aidl
index ce75288..4233c32 100644
--- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanDataPathChannelCfg.aidl
+++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanDataPathChannelCfg.aidl
@@ -35,6 +35,6 @@
 @Backing(type="int") @VintfStability
 enum NanDataPathChannelCfg {
   CHANNEL_NOT_REQUESTED = 0,
-  REQUEST_CHANNEL_SETUP = 1,
-  FORCE_CHANNEL_SETUP = 2,
+  REQUEST_CHANNEL_SETUP,
+  FORCE_CHANNEL_SETUP,
 }
diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanDataPathSecurityType.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanDataPathSecurityType.aidl
index 64288ca..cb7904d 100644
--- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanDataPathSecurityType.aidl
+++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanDataPathSecurityType.aidl
@@ -34,7 +34,7 @@
 package android.hardware.wifi;
 @Backing(type="int") @VintfStability
 enum NanDataPathSecurityType {
-  OPEN = 0,
-  PMK = 1,
-  PASSPHRASE = 2,
+  OPEN,
+  PMK,
+  PASSPHRASE,
 }
diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanDiscoveryCommonConfig.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanDiscoveryCommonConfig.aidl
index 761cdbb..e84cabf 100644
--- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanDiscoveryCommonConfig.aidl
+++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanDiscoveryCommonConfig.aidl
@@ -54,4 +54,5 @@
   android.hardware.wifi.NanRangingIndication configRangingIndications;
   char distanceIngressCm;
   char distanceEgressCm;
+  boolean enableSessionSuspendability;
 }
diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanMatchAlg.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanMatchAlg.aidl
index dab33ad..93ac26b 100644
--- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanMatchAlg.aidl
+++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanMatchAlg.aidl
@@ -35,6 +35,6 @@
 @Backing(type="int") @VintfStability
 enum NanMatchAlg {
   MATCH_ONCE = 0,
-  MATCH_CONTINUOUS = 1,
-  MATCH_NEVER = 2,
+  MATCH_CONTINUOUS,
+  MATCH_NEVER,
 }
diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanPairingRequestType.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanPairingRequestType.aidl
index 9e73e80..3488340 100644
--- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanPairingRequestType.aidl
+++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanPairingRequestType.aidl
@@ -35,5 +35,5 @@
 @Backing(type="int") @VintfStability
 enum NanPairingRequestType {
   NAN_PAIRING_SETUP = 0,
-  NAN_PAIRING_VERIFICATION = 1,
+  NAN_PAIRING_VERIFICATION,
 }
diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanPairingSecurityType.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanPairingSecurityType.aidl
index a08a00f..9f6c774 100644
--- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanPairingSecurityType.aidl
+++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanPairingSecurityType.aidl
@@ -34,7 +34,7 @@
 package android.hardware.wifi;
 @Backing(type="int") @VintfStability
 enum NanPairingSecurityType {
-  OPPORTUNISTIC = 0,
-  PMK = 1,
-  PASSPHRASE = 2,
+  OPPORTUNISTIC,
+  PMK,
+  PASSPHRASE,
 }
diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanPublishType.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanPublishType.aidl
index fc9b7a0..30dffb2 100644
--- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanPublishType.aidl
+++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanPublishType.aidl
@@ -35,6 +35,6 @@
 @Backing(type="int") @VintfStability
 enum NanPublishType {
   UNSOLICITED = 0,
-  SOLICITED = 1,
-  UNSOLICITED_SOLICITED = 2,
+  SOLICITED,
+  UNSOLICITED_SOLICITED,
 }
diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanRangingIndication.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanRangingIndication.aidl
index d03dffc..4d33c10 100644
--- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanRangingIndication.aidl
+++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanRangingIndication.aidl
@@ -34,7 +34,7 @@
 package android.hardware.wifi;
 @Backing(type="int") @VintfStability
 enum NanRangingIndication {
-  CONTINUOUS_INDICATION_MASK = 1,
-  INGRESS_MET_MASK = 2,
-  EGRESS_MET_MASK = 4,
+  CONTINUOUS_INDICATION_MASK = (1 << 0),
+  INGRESS_MET_MASK = (1 << 1),
+  EGRESS_MET_MASK = (1 << 2),
 }
diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanSrfType.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanSrfType.aidl
index 3c0583c..82409fd 100644
--- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanSrfType.aidl
+++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanSrfType.aidl
@@ -35,5 +35,5 @@
 @Backing(type="int") @VintfStability
 enum NanSrfType {
   BLOOM_FILTER = 0,
-  PARTIAL_MAC_ADDR = 1,
+  PARTIAL_MAC_ADDR,
 }
diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanStatusCode.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanStatusCode.aidl
index 0fe2245..40844cc 100644
--- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanStatusCode.aidl
+++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanStatusCode.aidl
@@ -49,4 +49,5 @@
   UNSUPPORTED_CONCURRENCY_NAN_DISABLED = 12,
   INVALID_PAIRING_ID = 13,
   INVALID_BOOTSTRAPPING_ID = 14,
+  INVALID_STATE = 15,
 }
diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanSubscribeType.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanSubscribeType.aidl
index 325e40b..4f06df9 100644
--- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanSubscribeType.aidl
+++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanSubscribeType.aidl
@@ -35,5 +35,5 @@
 @Backing(type="int") @VintfStability
 enum NanSubscribeType {
   PASSIVE = 0,
-  ACTIVE = 1,
+  ACTIVE,
 }
diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanTxType.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanTxType.aidl
index 6f7696f..798d3a2 100644
--- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanTxType.aidl
+++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanTxType.aidl
@@ -35,5 +35,5 @@
 @Backing(type="int") @VintfStability
 enum NanTxType {
   BROADCAST = 0,
-  UNICAST = 1,
+  UNICAST,
 }
diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/RttBw.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/RttBw.aidl
index f5bf894..7cc7002 100644
--- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/RttBw.aidl
+++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/RttBw.aidl
@@ -34,12 +34,12 @@
 package android.hardware.wifi;
 @Backing(type="int") @VintfStability
 enum RttBw {
-  BW_UNSPECIFIED = 0,
-  BW_5MHZ = 1,
-  BW_10MHZ = 2,
-  BW_20MHZ = 4,
-  BW_40MHZ = 8,
-  BW_80MHZ = 16,
-  BW_160MHZ = 32,
-  BW_320MHZ = 64,
+  BW_UNSPECIFIED = 0x0,
+  BW_5MHZ = 0x01,
+  BW_10MHZ = 0x02,
+  BW_20MHZ = 0x04,
+  BW_40MHZ = 0x08,
+  BW_80MHZ = 0x10,
+  BW_160MHZ = 0x20,
+  BW_320MHZ = 0x40,
 }
diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/RttPreamble.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/RttPreamble.aidl
index 02e6479..de26f28 100644
--- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/RttPreamble.aidl
+++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/RttPreamble.aidl
@@ -34,9 +34,9 @@
 package android.hardware.wifi;
 @Backing(type="int") @VintfStability
 enum RttPreamble {
-  LEGACY = 1,
-  HT = 2,
-  VHT = 4,
-  HE = 8,
-  EHT = 16,
+  LEGACY = 0x1,
+  HT = 0x2,
+  VHT = 0x4,
+  HE = 0x8,
+  EHT = 0x10,
 }
diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/StaBackgroundScanBucketEventReportSchemeMask.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/StaBackgroundScanBucketEventReportSchemeMask.aidl
index 1041dd7..93e337e 100644
--- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/StaBackgroundScanBucketEventReportSchemeMask.aidl
+++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/StaBackgroundScanBucketEventReportSchemeMask.aidl
@@ -34,7 +34,7 @@
 package android.hardware.wifi;
 @Backing(type="int") @VintfStability
 enum StaBackgroundScanBucketEventReportSchemeMask {
-  EACH_SCAN = 1,
-  FULL_RESULTS = 2,
-  NO_BATCH = 4,
+  EACH_SCAN = (1 << 0),
+  FULL_RESULTS = (1 << 1),
+  NO_BATCH = (1 << 2),
 }
diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/StaScanDataFlagMask.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/StaScanDataFlagMask.aidl
index dc8f2f1..fbd2d75 100644
--- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/StaScanDataFlagMask.aidl
+++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/StaScanDataFlagMask.aidl
@@ -34,5 +34,5 @@
 package android.hardware.wifi;
 @Backing(type="int") @VintfStability
 enum StaScanDataFlagMask {
-  INTERRUPTED = 1,
+  INTERRUPTED = (1 << 0),
 }
diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/WifiChannelWidthInMhz.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/WifiChannelWidthInMhz.aidl
index 8c45044..22327e5 100644
--- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/WifiChannelWidthInMhz.aidl
+++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/WifiChannelWidthInMhz.aidl
@@ -34,7 +34,7 @@
 package android.hardware.wifi;
 @Backing(type="int") @VintfStability
 enum WifiChannelWidthInMhz {
-  WIDTH_INVALID = -1,
+  WIDTH_INVALID = (-1),
   WIDTH_20 = 0,
   WIDTH_40 = 1,
   WIDTH_80 = 2,
diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/WifiDebugPacketFateFrameType.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/WifiDebugPacketFateFrameType.aidl
index ee26f2e..6db96ef 100644
--- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/WifiDebugPacketFateFrameType.aidl
+++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/WifiDebugPacketFateFrameType.aidl
@@ -34,7 +34,7 @@
 package android.hardware.wifi;
 @Backing(type="int") @VintfStability
 enum WifiDebugPacketFateFrameType {
-  UNKNOWN = 0,
-  ETHERNET_II = 1,
-  MGMT_80211 = 2,
+  UNKNOWN,
+  ETHERNET_II,
+  MGMT_80211,
 }
diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/WifiDebugRingBufferFlags.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/WifiDebugRingBufferFlags.aidl
index f210e82..9eac85d 100644
--- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/WifiDebugRingBufferFlags.aidl
+++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/WifiDebugRingBufferFlags.aidl
@@ -34,7 +34,7 @@
 package android.hardware.wifi;
 @Backing(type="int") @VintfStability
 enum WifiDebugRingBufferFlags {
-  HAS_BINARY_ENTRIES = 1,
-  HAS_ASCII_ENTRIES = 2,
-  HAS_PER_PACKET_ENTRIES = 4,
+  HAS_BINARY_ENTRIES = (1 << 0),
+  HAS_ASCII_ENTRIES = (1 << 1),
+  HAS_PER_PACKET_ENTRIES = (1 << 2),
 }
diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/WifiDebugRxPacketFate.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/WifiDebugRxPacketFate.aidl
index 75abb4e..f638c4f 100644
--- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/WifiDebugRxPacketFate.aidl
+++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/WifiDebugRxPacketFate.aidl
@@ -34,15 +34,15 @@
 package android.hardware.wifi;
 @Backing(type="int") @VintfStability
 enum WifiDebugRxPacketFate {
-  SUCCESS = 0,
-  FW_QUEUED = 1,
-  FW_DROP_FILTER = 2,
-  FW_DROP_INVALID = 3,
-  FW_DROP_NOBUFS = 4,
-  FW_DROP_OTHER = 5,
-  DRV_QUEUED = 6,
-  DRV_DROP_FILTER = 7,
-  DRV_DROP_INVALID = 8,
-  DRV_DROP_NOBUFS = 9,
-  DRV_DROP_OTHER = 10,
+  SUCCESS,
+  FW_QUEUED,
+  FW_DROP_FILTER,
+  FW_DROP_INVALID,
+  FW_DROP_NOBUFS,
+  FW_DROP_OTHER,
+  DRV_QUEUED,
+  DRV_DROP_FILTER,
+  DRV_DROP_INVALID,
+  DRV_DROP_NOBUFS,
+  DRV_DROP_OTHER,
 }
diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/WifiDebugTxPacketFate.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/WifiDebugTxPacketFate.aidl
index e360c2c..778ca5d 100644
--- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/WifiDebugTxPacketFate.aidl
+++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/WifiDebugTxPacketFate.aidl
@@ -34,14 +34,14 @@
 package android.hardware.wifi;
 @Backing(type="int") @VintfStability
 enum WifiDebugTxPacketFate {
-  ACKED = 0,
-  SENT = 1,
-  FW_QUEUED = 2,
-  FW_DROP_INVALID = 3,
-  FW_DROP_NOBUFS = 4,
-  FW_DROP_OTHER = 5,
-  DRV_QUEUED = 6,
-  DRV_DROP_INVALID = 7,
-  DRV_DROP_NOBUFS = 8,
-  DRV_DROP_OTHER = 9,
+  ACKED,
+  SENT,
+  FW_QUEUED,
+  FW_DROP_INVALID,
+  FW_DROP_NOBUFS,
+  FW_DROP_OTHER,
+  DRV_QUEUED,
+  DRV_DROP_INVALID,
+  DRV_DROP_NOBUFS,
+  DRV_DROP_OTHER,
 }
diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/WifiIfaceMode.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/WifiIfaceMode.aidl
index e2fe57a..2ac0c2d 100644
--- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/WifiIfaceMode.aidl
+++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/WifiIfaceMode.aidl
@@ -34,12 +34,12 @@
 package android.hardware.wifi;
 @Backing(type="int") @VintfStability
 enum WifiIfaceMode {
-  IFACE_MODE_STA = 1,
-  IFACE_MODE_SOFTAP = 2,
-  IFACE_MODE_IBSS = 4,
-  IFACE_MODE_P2P_CLIENT = 8,
-  IFACE_MODE_P2P_GO = 16,
-  IFACE_MODE_NAN = 32,
-  IFACE_MODE_MESH = 64,
-  IFACE_MODE_TDLS = 128,
+  IFACE_MODE_STA = (1 << 0),
+  IFACE_MODE_SOFTAP = (1 << 1),
+  IFACE_MODE_IBSS = (1 << 2),
+  IFACE_MODE_P2P_CLIENT = (1 << 3),
+  IFACE_MODE_P2P_GO = (1 << 4),
+  IFACE_MODE_NAN = (1 << 5),
+  IFACE_MODE_MESH = (1 << 6),
+  IFACE_MODE_TDLS = (1 << 7),
 }
diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/WifiStatusCode.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/WifiStatusCode.aidl
index f27661c..9a15fa1 100644
--- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/WifiStatusCode.aidl
+++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/WifiStatusCode.aidl
@@ -34,14 +34,14 @@
 package android.hardware.wifi;
 @Backing(type="int") @VintfStability
 enum WifiStatusCode {
-  SUCCESS = 0,
-  ERROR_WIFI_CHIP_INVALID = 1,
-  ERROR_WIFI_IFACE_INVALID = 2,
-  ERROR_WIFI_RTT_CONTROLLER_INVALID = 3,
-  ERROR_NOT_SUPPORTED = 4,
-  ERROR_NOT_AVAILABLE = 5,
-  ERROR_NOT_STARTED = 6,
-  ERROR_INVALID_ARGS = 7,
-  ERROR_BUSY = 8,
-  ERROR_UNKNOWN = 9,
+  SUCCESS,
+  ERROR_WIFI_CHIP_INVALID,
+  ERROR_WIFI_IFACE_INVALID,
+  ERROR_WIFI_RTT_CONTROLLER_INVALID,
+  ERROR_NOT_SUPPORTED,
+  ERROR_NOT_AVAILABLE,
+  ERROR_NOT_STARTED,
+  ERROR_INVALID_ARGS,
+  ERROR_BUSY,
+  ERROR_UNKNOWN,
 }
diff --git a/wifi/aidl/android/hardware/wifi/IWifiNanIface.aidl b/wifi/aidl/android/hardware/wifi/IWifiNanIface.aidl
index 31c7ece..870c3d8 100644
--- a/wifi/aidl/android/hardware/wifi/IWifiNanIface.aidl
+++ b/wifi/aidl/android/hardware/wifi/IWifiNanIface.aidl
@@ -241,6 +241,32 @@
     void terminateDataPathRequest(in char cmdId, in int ndpInstanceId);
 
     /**
+     * Start the suspension of a discovery service.
+     * Asynchronous response is with |IWifiNanIfaceEventCallback.notifySuspendResponse|.
+     *
+     * @param cmdId Command Id to use for this invocation.
+     * @param sessionId ID of the publish/subscribe discovery session to be suspended.
+     * @throws ServiceSpecificException with one of the following values:
+     *         |WifiStatusCode.ERROR_NOT_SUPPORTED|,
+     *         |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|,
+     *         |WifiStatusCode.ERROR_UNKNOWN|
+     */
+    void suspendRequest(in char cmdId, in byte sessionId);
+
+    /**
+     * Stop the suspension of a discovery service.
+     * Asynchronous response is with |IWifiNanIfaceEventCallback.notifyResumeResponse|.
+     *
+     * @param cmdId Command Id to use for this invocation.
+     * @param sessionId ID of the publish/subscribe discovery session to be resumed.
+     * @throws ServiceSpecificException with one of the following values:
+     *         |WifiStatusCode.ERROR_NOT_SUPPORTED|,
+     *         |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|,
+     *         |WifiStatusCode.ERROR_UNKNOWN|
+     */
+    void resumeRequest(in char cmdId, in byte sessionId);
+
+    /**
      * NAN transmit follow up message request.
      * Asynchronous response is with |IWifiNanIfaceEventCallback.notifyTransmitFollowupResponse|.
      *
diff --git a/wifi/aidl/android/hardware/wifi/IWifiNanIfaceEventCallback.aidl b/wifi/aidl/android/hardware/wifi/IWifiNanIfaceEventCallback.aidl
index 6b06def..3fd37a7 100644
--- a/wifi/aidl/android/hardware/wifi/IWifiNanIfaceEventCallback.aidl
+++ b/wifi/aidl/android/hardware/wifi/IWifiNanIfaceEventCallback.aidl
@@ -310,6 +310,32 @@
     void notifyTerminateDataPathResponse(in char id, in NanStatus status);
 
     /**
+     * Callback invoked in response to a suspension request
+     * |IWifiNanIface.suspendRequest|.
+     *
+     * @param cmdId Command Id corresponding to the original request.
+     * @param status NanStatus of the operation. Possible status codes are:
+     *        |NanStatusCode.SUCCESS|
+     *        |NanStatusCode.INVALID_SESSION_ID|
+     *        |NanStatusCode.INVALID_STATE|
+     *        |NanStatusCode.INTERNAL_FAILURE|
+     */
+    void notifySuspendResponse(in char id, in NanStatus status);
+
+    /**
+     * Callback invoked in response to a resume request
+     * |IWifiNanIface.resumeRequest|.
+     *
+     * @param cmdId Command Id corresponding to the original request.
+     * @param status NanStatus of the operation. Possible status codes are:
+     *        |NanStatusCode.SUCCESS|
+     *        |NanStatusCode.INVALID_SESSION_ID|
+     *        |NanStatusCode.INVALID_STATE|
+     *        |NanStatusCode.INTERNAL_FAILURE|
+     */
+    void notifyResumeResponse(in char id, in NanStatus status);
+
+    /**
      * Callback invoked in response to a transmit followup request
      * |IWifiNanIface.transmitFollowupRequest|.
      *
diff --git a/wifi/aidl/android/hardware/wifi/NanCapabilities.aidl b/wifi/aidl/android/hardware/wifi/NanCapabilities.aidl
index 4160176..c1d6201 100644
--- a/wifi/aidl/android/hardware/wifi/NanCapabilities.aidl
+++ b/wifi/aidl/android/hardware/wifi/NanCapabilities.aidl
@@ -98,7 +98,11 @@
      */
     boolean supportsPairing;
     /**
-     * Flag to indicate if NAN setting cluster ID is supported.
+     * Flag to indicate if setting NAN cluster ID is supported.
      */
     boolean supportsSetClusterId;
+    /**
+     * Flag to indicate if NAN suspension is supported.
+     */
+    boolean supportsSuspension;
 }
diff --git a/wifi/aidl/android/hardware/wifi/NanDiscoveryCommonConfig.aidl b/wifi/aidl/android/hardware/wifi/NanDiscoveryCommonConfig.aidl
index ca1e016..e98658b 100644
--- a/wifi/aidl/android/hardware/wifi/NanDiscoveryCommonConfig.aidl
+++ b/wifi/aidl/android/hardware/wifi/NanDiscoveryCommonConfig.aidl
@@ -155,4 +155,10 @@
      */
     char distanceIngressCm;
     char distanceEgressCm;
+    /**
+     * Specifies whether suspension can be possible in this discovery session.
+     * The request would fail if |enableSessionSuspendability| is true but
+     * |NanCapabilities.supportsSuspension| is false.
+     */
+    boolean enableSessionSuspendability;
 }
diff --git a/wifi/aidl/android/hardware/wifi/NanStatusCode.aidl b/wifi/aidl/android/hardware/wifi/NanStatusCode.aidl
index efce867..d609797 100644
--- a/wifi/aidl/android/hardware/wifi/NanStatusCode.aidl
+++ b/wifi/aidl/android/hardware/wifi/NanStatusCode.aidl
@@ -78,5 +78,9 @@
     /**
      * If the bootstrapping id is invalid
      */
-    INVALID_BOOTSTRAPPING_ID = 14
+    INVALID_BOOTSTRAPPING_ID = 14,
+    /**
+     * If the system is not in a valid state for the given request.
+     */
+    INVALID_STATE = 15
 }
diff --git a/wifi/aidl/default/aidl_struct_util.cpp b/wifi/aidl/default/aidl_struct_util.cpp
index 07ce60b..68fe2e6 100644
--- a/wifi/aidl/default/aidl_struct_util.cpp
+++ b/wifi/aidl/default/aidl_struct_util.cpp
@@ -1853,6 +1853,7 @@
         LOG(ERROR) << "convertAidlNanPublishRequestToLegacy: invalid pairing config";
         return false;
     }
+    legacy_request->enable_suspendability = aidl_request.baseConfigs.enableSessionSuspendability;
 
     return true;
 }
@@ -1999,6 +2000,8 @@
         LOG(ERROR) << "convertAidlNanSubscribeRequestToLegacy: invalid pairing config";
         return false;
     }
+    legacy_request->enable_suspendability = aidl_request.baseConfigs.enableSessionSuspendability;
+
     return true;
 }
 
@@ -2251,6 +2254,8 @@
     aidl_response->supportsHe = legacy_response.is_he_supported;
     aidl_response->supportsPairing = legacy_response.is_pairing_supported;
     aidl_response->supportsSetClusterId = legacy_response.is_set_cluster_id_supported;
+    aidl_response->supportsSuspension = legacy_response.is_suspension_supported;
+
     return true;
 }
 
diff --git a/wifi/aidl/default/tests/wifi_nan_iface_unit_tests.cpp b/wifi/aidl/default/tests/wifi_nan_iface_unit_tests.cpp
index f81cab3..878c29b 100644
--- a/wifi/aidl/default/tests/wifi_nan_iface_unit_tests.cpp
+++ b/wifi/aidl/default/tests/wifi_nan_iface_unit_tests.cpp
@@ -134,6 +134,8 @@
                  ndk::ScopedAStatus(char16_t, const NanStatus&, int32_t));
     MOCK_METHOD2(notifyRespondToBootstrappingIndicationResponse,
                  ndk::ScopedAStatus(char16_t, const NanStatus&));
+    MOCK_METHOD2(notifySuspendResponse, ndk::ScopedAStatus(char16_t, const NanStatus&));
+    MOCK_METHOD2(notifyResumeResponse, ndk::ScopedAStatus(char16_t, const NanStatus&));
 };
 
 class WifiNanIfaceTest : public Test {
diff --git a/wifi/aidl/default/wifi_chip.cpp b/wifi/aidl/default/wifi_chip.cpp
index 6f43e06..541de16 100644
--- a/wifi/aidl/default/wifi_chip.cpp
+++ b/wifi/aidl/default/wifi_chip.cpp
@@ -1146,8 +1146,7 @@
                    << legacyErrorToString(legacy_status);
         return {nullptr, createWifiStatusFromLegacyError(legacy_status)};
     }
-    std::shared_ptr<WifiStaIface> iface =
-            ndk::SharedRefBase::make<WifiStaIface>(ifname, legacy_hal_, iface_util_);
+    std::shared_ptr<WifiStaIface> iface = WifiStaIface::create(ifname, legacy_hal_, iface_util_);
     sta_ifaces_.push_back(iface);
     for (const auto& callback : event_cb_handler_.getCallbacks()) {
         if (!callback->onIfaceAdded(IfaceType::STA, ifname).isOk()) {
diff --git a/wifi/aidl/default/wifi_legacy_hal.cpp b/wifi/aidl/default/wifi_legacy_hal.cpp
index f03835f..43a71cc 100644
--- a/wifi/aidl/default/wifi_legacy_hal.cpp
+++ b/wifi/aidl/default/wifi_legacy_hal.cpp
@@ -1559,6 +1559,22 @@
     return status;
 }
 
+wifi_error WifiLegacyHal::nanSuspendRequest(const std::string& iface_name, transaction_id id,
+                                            const NanSuspendRequest& msg) {
+    NanSuspendRequest msg_internal(msg);
+    wifi_error status = global_func_table_.wifi_nan_suspend_request(id, getIfaceHandle(iface_name),
+                                                                    &msg_internal);
+    return status;
+}
+
+wifi_error WifiLegacyHal::nanResumeRequest(const std::string& iface_name, transaction_id id,
+                                           const NanResumeRequest& msg) {
+    NanResumeRequest msg_internal(msg);
+    wifi_error status = global_func_table_.wifi_nan_resume_request(id, getIfaceHandle(iface_name),
+                                                                   &msg_internal);
+    return status;
+}
+
 wifi_error WifiLegacyHal::setCountryCode(const std::string& iface_name,
                                          const std::array<uint8_t, 2> code) {
     std::string code_str(code.data(), code.data() + code.size());
@@ -1750,6 +1766,10 @@
     return global_func_table_.wifi_twt_clear_stats(getIfaceHandle(iface_name), configId);
 }
 
+wifi_error WifiLegacyHal::setScanMode(const std::string& iface_name, bool enable) {
+    return global_func_table_.wifi_set_scan_mode(iface_name.c_str(), enable);
+}
+
 wifi_error WifiLegacyHal::setDtimConfig(const std::string& iface_name, uint32_t multiplier) {
     return global_func_table_.wifi_set_dtim_config(getIfaceHandle(iface_name), multiplier);
 }
diff --git a/wifi/aidl/default/wifi_legacy_hal.h b/wifi/aidl/default/wifi_legacy_hal.h
index 2300cb7..a066ea6 100644
--- a/wifi/aidl/default/wifi_legacy_hal.h
+++ b/wifi/aidl/default/wifi_legacy_hal.h
@@ -165,12 +165,14 @@
 using ::NanRangeReportInd;
 using ::NanRangeRequestInd;
 using ::NanResponseMsg;
+using ::NanResumeRequest;
 using ::NanSRFType;
 using ::NanStatusType;
 using ::NanSubscribeCancelRequest;
 using ::NanSubscribeRequest;
 using ::NanSubscribeTerminatedInd;
 using ::NanSubscribeType;
+using ::NanSuspendRequest;
 using ::NanTransmitFollowupInd;
 using ::NanTransmitFollowupRequest;
 using ::NanTxType;
@@ -701,6 +703,10 @@
     wifi_error nanBootstrappingIndicationResponse(const std::string& iface_name, transaction_id id,
                                                   const NanBootstrappingIndicationResponse& msg);
     wifi_error nanDataEnd(const std::string& iface_name, transaction_id id, uint32_t ndpInstanceId);
+    wifi_error nanSuspendRequest(const std::string& iface_name, transaction_id id,
+                                 const NanSuspendRequest& msg);
+    wifi_error nanResumeRequest(const std::string& iface_name, transaction_id id,
+                                const NanResumeRequest& msg);
     // AP functions.
     wifi_error setCountryCode(const std::string& iface_name, const std::array<uint8_t, 2> code);
 
@@ -735,6 +741,8 @@
 
     wifi_error twtClearStats(const std::string& iface_name, uint8_t configId);
 
+    wifi_error setScanMode(const std::string& iface_name, bool enable);
+
     wifi_error setDtimConfig(const std::string& iface_name, uint32_t multiplier);
 
     // Retrieve the list of usable channels in the requested bands
diff --git a/wifi/aidl/default/wifi_legacy_hal_stubs.cpp b/wifi/aidl/default/wifi_legacy_hal_stubs.cpp
index 11da373..fa87772 100644
--- a/wifi/aidl/default/wifi_legacy_hal_stubs.cpp
+++ b/wifi/aidl/default/wifi_legacy_hal_stubs.cpp
@@ -173,6 +173,9 @@
     populateStubFor(&hal_fn->wifi_get_cached_scan_results);
     populateStubFor(&hal_fn->wifi_get_chip_capabilities);
     populateStubFor(&hal_fn->wifi_enable_sta_channel_for_peer_network);
+    populateStubFor(&hal_fn->wifi_nan_suspend_request);
+    populateStubFor(&hal_fn->wifi_nan_resume_request);
+    populateStubFor(&hal_fn->wifi_set_scan_mode);
     return true;
 }
 
diff --git a/wifi/aidl/default/wifi_nan_iface.cpp b/wifi/aidl/default/wifi_nan_iface.cpp
index ce6902d..7138e41 100644
--- a/wifi/aidl/default/wifi_nan_iface.cpp
+++ b/wifi/aidl/default/wifi_nan_iface.cpp
@@ -756,6 +756,16 @@
                            in_msg);
 }
 
+ndk::ScopedAStatus WifiNanIface::suspendRequest(char16_t in_cmdId, int8_t in_sessionId) {
+    return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID,
+                           &WifiNanIface::suspendRequestInternal, in_cmdId, in_sessionId);
+}
+
+ndk::ScopedAStatus WifiNanIface::resumeRequest(char16_t in_cmdId, int8_t in_sessionId) {
+    return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID,
+                           &WifiNanIface::resumeRequestInternal, in_cmdId, in_sessionId);
+}
+
 std::pair<std::string, ndk::ScopedAStatus> WifiNanIface::getNameInternal() {
     return {ifname_, ndk::ScopedAStatus::ok()};
 }
@@ -930,7 +940,20 @@
             legacy_hal_.lock()->nanBootstrappingIndicationResponse(ifname_, cmd_id, legacy_msg);
     return createWifiStatusFromLegacyError(legacy_status);
 }
-
+ndk::ScopedAStatus WifiNanIface::suspendRequestInternal(char16_t cmd_id, int8_t sessionId) {
+    legacy_hal::NanSuspendRequest legacy_msg;
+    legacy_msg.publish_subscribe_id = sessionId;
+    legacy_hal::wifi_error legacy_status =
+            legacy_hal_.lock()->nanSuspendRequest(ifname_, cmd_id, legacy_msg);
+    return createWifiStatusFromLegacyError(legacy_status);
+}
+ndk::ScopedAStatus WifiNanIface::resumeRequestInternal(char16_t cmd_id, int8_t sessionId) {
+    legacy_hal::NanResumeRequest legacy_msg;
+    legacy_msg.publish_subscribe_id = sessionId;
+    legacy_hal::wifi_error legacy_status =
+            legacy_hal_.lock()->nanResumeRequest(ifname_, cmd_id, legacy_msg);
+    return createWifiStatusFromLegacyError(legacy_status);
+}
 }  // namespace wifi
 }  // namespace hardware
 }  // namespace android
diff --git a/wifi/aidl/default/wifi_nan_iface.h b/wifi/aidl/default/wifi_nan_iface.h
index 591eca9..3b93c28 100644
--- a/wifi/aidl/default/wifi_nan_iface.h
+++ b/wifi/aidl/default/wifi_nan_iface.h
@@ -86,6 +86,8 @@
                                                     const NanBootstrappingRequest& in_msg) override;
     ndk::ScopedAStatus respondToBootstrappingIndicationRequest(
             char16_t in_cmdId, const NanBootstrappingResponse& in_msg) override;
+    ndk::ScopedAStatus suspendRequest(char16_t in_cmdId, int8_t sessionId) override;
+    ndk::ScopedAStatus resumeRequest(char16_t in_cmdId, int8_t sessionId) override;
 
   protected:
     // Accessible to child class in the gTest suite.
@@ -127,6 +129,8 @@
                                                             const NanBootstrappingRequest& msg);
     ndk::ScopedAStatus respondToBootstrappingIndicationRequestInternal(
             char16_t cmd_id, const NanBootstrappingResponse& msg);
+    ndk::ScopedAStatus suspendRequestInternal(char16_t in_cmdId, int8_t sessionId);
+    ndk::ScopedAStatus resumeRequestInternal(char16_t in_cmdId, int8_t sessionId);
 
     // Overridden in the gTest suite.
     virtual std::set<std::shared_ptr<IWifiNanIfaceEventCallback>> getEventCallbacks();
diff --git a/wifi/aidl/default/wifi_sta_iface.cpp b/wifi/aidl/default/wifi_sta_iface.cpp
index 08ed9d2..96dc809 100644
--- a/wifi/aidl/default/wifi_sta_iface.cpp
+++ b/wifi/aidl/default/wifi_sta_iface.cpp
@@ -561,9 +561,8 @@
 }
 
 ndk::ScopedAStatus WifiStaIface::setScanModeInternal(bool enable) {
-    // OEM's need to implement this on their devices if needed.
-    LOG(WARNING) << "setScanModeInternal(" << enable << ") not supported";
-    return createWifiStatus(WifiStatusCode::ERROR_NOT_SUPPORTED);
+    legacy_hal::wifi_error legacy_status = legacy_hal_.lock()->setScanMode(ifname_, enable);
+    return createWifiStatusFromLegacyError(legacy_status);
 }
 
 ndk::ScopedAStatus WifiStaIface::setDtimMultiplierInternal(const int multiplier) {
diff --git a/wifi/aidl/vts/functional/wifi_chip_aidl_test.cpp b/wifi/aidl/vts/functional/wifi_chip_aidl_test.cpp
index 0806ed2..fec9122 100644
--- a/wifi/aidl/vts/functional/wifi_chip_aidl_test.cpp
+++ b/wifi/aidl/vts/functional/wifi_chip_aidl_test.cpp
@@ -583,6 +583,9 @@
  * CreateNanIface
  */
 TEST_P(WifiChipAidlTest, CreateNanIface) {
+    if (!::testing::deviceSupportsFeature("android.hardware.wifi.aware")) {
+        GTEST_SKIP() << "Skipping this test since NAN is not supported.";
+    }
     configureChipForNanAndGetIface();
 }
 
@@ -590,7 +593,7 @@
  * CreateP2pIface
  */
 TEST_P(WifiChipAidlTest, CreateP2pIface) {
-    configureChipForNanAndGetIface();
+    configureChipForP2pAndGetIface();
 }
 
 /*
@@ -672,6 +675,9 @@
  * GetNanIfaceNames
  */
 TEST_P(WifiChipAidlTest, GetNanIfaceNames) {
+    if (!::testing::deviceSupportsFeature("android.hardware.wifi.aware")) {
+        GTEST_SKIP() << "Skipping this test since NAN is not supported.";
+    }
     configureChipForConcurrencyType(IfaceConcurrencyType::NAN_IFACE);
 
     std::vector<std::string> iface_names;
@@ -753,6 +759,9 @@
  * GetNanIface
  */
 TEST_P(WifiChipAidlTest, GetNanIface) {
+    if (!::testing::deviceSupportsFeature("android.hardware.wifi.aware")) {
+        GTEST_SKIP() << "Skipping this test since NAN is not supported.";
+    }
     std::shared_ptr<IWifiNanIface> iface = configureChipForNanAndGetIface();
     std::string iface_name = getNanIfaceName(iface);
 
@@ -822,6 +831,9 @@
  * RemoveNanIface
  */
 TEST_P(WifiChipAidlTest, RemoveNanIface) {
+    if (!::testing::deviceSupportsFeature("android.hardware.wifi.aware")) {
+        GTEST_SKIP() << "Skipping this test since NAN is not supported.";
+    }
     std::shared_ptr<IWifiNanIface> iface = configureChipForNanAndGetIface();
     std::string iface_name = getNanIfaceName(iface);
 
diff --git a/wifi/aidl/vts/functional/wifi_nan_iface_aidl_test.cpp b/wifi/aidl/vts/functional/wifi_nan_iface_aidl_test.cpp
index 654eb02..ae5040f 100644
--- a/wifi/aidl/vts/functional/wifi_nan_iface_aidl_test.cpp
+++ b/wifi/aidl/vts/functional/wifi_nan_iface_aidl_test.cpp
@@ -104,6 +104,8 @@
         NOTIFY_RESPOND_TO_PAIRING_INDICATION_RESPONSE,
         NOTIFY_INITIATE_BOOTSTRAPPING_RESPONSE,
         NOTIFY_RESPOND_TO_BOOTSTRAPPING_INDICATION_RESPONSE,
+        NOTIFY_SUSPEND_RESPONSE,
+        NOTIFY_RESUME_RESPONSE,
 
         EVENT_CLUSTER_EVENT,
         EVENT_DISABLED,
@@ -358,6 +360,20 @@
             parent_.notify();
             return ndk::ScopedAStatus::ok();
         }
+        ::ndk::ScopedAStatus notifySuspendResponse(char16_t id, const NanStatus& status) override {
+            parent_.callback_type_ = NOTIFY_SUSPEND_RESPONSE;
+            parent_.id_ = id;
+            parent_.status_ = status;
+            parent_.notify();
+            return ndk::ScopedAStatus::ok();
+        }
+        ::ndk::ScopedAStatus notifyResumeResponse(char16_t id, const NanStatus& status) override {
+            parent_.callback_type_ = NOTIFY_RESUME_RESPONSE;
+            parent_.id_ = id;
+            parent_.status_ = status;
+            parent_.notify();
+            return ndk::ScopedAStatus::ok();
+        }
         ::ndk::ScopedAStatus notifyTransmitFollowupResponse(char16_t id,
                                                             const NanStatus& status) override {
             parent_.callback_type_ = NOTIFY_TRANSMIT_FOLLOWUP_RESPONSE;
diff --git a/wifi/apex/Android.bp b/wifi/apex/Android.bp
index e1fefb9..f8ba5c4 100644
--- a/wifi/apex/Android.bp
+++ b/wifi/apex/Android.bp
@@ -30,6 +30,7 @@
     name: "com.android.hardware.wifi.xml",
     src: ":default-android.hardware.wifi-service.xml",
     installable: false,
+    sub_dir: "vintf",
 }
 
 apex {
@@ -38,7 +39,6 @@
     key: "com.android.hardware.wifi.key",
     certificate: ":com.android.hardware.wifi.certificate",
     file_contexts: "file_contexts",
-    vintf_fragments: [":com.android.hardware.wifi.xml"],
     use_vndk_as_stable: true,
     updatable: false,
     soc_specific: true,
diff --git a/wifi/apex/file_contexts b/wifi/apex/file_contexts
index 6368729..d932fac 100644
--- a/wifi/apex/file_contexts
+++ b/wifi/apex/file_contexts
@@ -1,3 +1,3 @@
-(/.*)? 								u:object_r:vendor_file:s0
+(/.*)?                                          u:object_r:vendor_file:s0
+/etc(/.*)?                                      u:object_r:vendor_configs_file:s0
 /bin/hw/android\.hardware\.wifi-service			u:object_r:hal_wifi_default_exec:s0
-
diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantStaIface.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantStaIface.aidl
index 3740a10..f617975 100644
--- a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantStaIface.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantStaIface.aidl
@@ -96,4 +96,8 @@
   void stopDppResponder(in int ownBootstrapId);
   void stopRxFilter();
   android.hardware.wifi.supplicant.SignalPollResult[] getSignalPollResults();
+  android.hardware.wifi.supplicant.QosPolicyScsRequestStatus[] addQosPolicyRequestForScs(in android.hardware.wifi.supplicant.QosPolicyScsData[] qosPolicyData);
+  android.hardware.wifi.supplicant.QosPolicyScsRequestStatus[] removeQosPolicyForScs(in byte[] scsPolicyIds);
+  android.hardware.wifi.supplicant.QosPolicyScsRequestStatus[] removeAllQosPoliciesForScs();
+  const int MAX_POLICIES_PER_QOS_SCS_REQUEST = 16;
 }
diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantStaIfaceCallback.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantStaIfaceCallback.aidl
index b54f04d..cabe167 100644
--- a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantStaIfaceCallback.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantStaIfaceCallback.aidl
@@ -74,6 +74,7 @@
   oneway void onDppConnectionStatusResultSent(in android.hardware.wifi.supplicant.DppStatusErrorCode code);
   oneway void onBssFrequencyChanged(in int frequencyMhz);
   oneway void onSupplicantStateChanged(in android.hardware.wifi.supplicant.SupplicantStateChangeData stateChangeData);
+  oneway void onQosPolicyResponseForScs(in android.hardware.wifi.supplicant.QosPolicyScsResponseStatus[] qosPolicyScsResponseStatus);
   @Backing(type="int") @VintfStability
   enum MloLinkInfoChangeReason {
     TID_TO_LINK_MAP = 0,
diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyClassifierParams.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyClassifierParams.aidl
index 8bf5fd8..156d57a 100644
--- a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyClassifierParams.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyClassifierParams.aidl
@@ -43,4 +43,5 @@
   android.hardware.wifi.supplicant.ProtocolNextHeader protocolNextHdr;
   byte[] flowLabelIpv6;
   String domainName;
+  byte dscp;
 }
diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyClassifierParamsMask.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyClassifierParamsMask.aidl
index 280ddbe..9c0c0b6 100644
--- a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyClassifierParamsMask.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyClassifierParamsMask.aidl
@@ -41,4 +41,5 @@
   PROTOCOL_NEXT_HEADER = 16,
   FLOW_LABEL = 32,
   DOMAIN_NAME = 64,
+  DSCP = 128,
 }
diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyScsData.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyScsData.aidl
new file mode 100644
index 0000000..4e5e8ae
--- /dev/null
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyScsData.aidl
@@ -0,0 +1,25 @@
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE.                          //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+//     the interface (from the latest frozen version), the build system will
+//     prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.wifi.supplicant;
+@VintfStability
+parcelable QosPolicyScsData {
+  byte policyId;
+  byte userPriority;
+  android.hardware.wifi.supplicant.QosPolicyClassifierParams classifierParams;
+}
diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyScsRequestStatus.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyScsRequestStatus.aidl
new file mode 100644
index 0000000..d5573af
--- /dev/null
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyScsRequestStatus.aidl
@@ -0,0 +1,24 @@
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE.                          //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+//     the interface (from the latest frozen version), the build system will
+//     prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.wifi.supplicant;
+@VintfStability
+parcelable QosPolicyScsRequestStatus {
+  byte policyId;
+  android.hardware.wifi.supplicant.QosPolicyScsRequestStatusCode qosPolicyScsRequestStatusCode;
+}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/MediaProtocolType.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyScsRequestStatusCode.aidl
similarity index 60%
copy from radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/MediaProtocolType.aidl
copy to wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyScsRequestStatusCode.aidl
index 1a290d4..4d81566 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/MediaProtocolType.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyScsRequestStatusCode.aidl
@@ -1,18 +1,3 @@
-/*
- * Copyright (C) 2021 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
 ///////////////////////////////////////////////////////////////////////////////
 // THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE.                          //
 ///////////////////////////////////////////////////////////////////////////////
@@ -31,9 +16,11 @@
 // with such a backward incompatible change, it has a high risk of breaking
 // later when a module using the interface is updated, e.g., Mainline modules.
 
-package android.hardware.radio.ims.media;
+package android.hardware.wifi.supplicant;
 @Backing(type="int") @VintfStability
-enum MediaProtocolType {
-  RTP = 0,
-  RTCP = 1,
+enum QosPolicyScsRequestStatusCode {
+  SENT = 0,
+  ALREADY_ACTIVE = 1,
+  NOT_EXIST = 2,
+  INVALID = 3,
 }
diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyScsResponseStatus.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyScsResponseStatus.aidl
new file mode 100644
index 0000000..2737f1a
--- /dev/null
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyScsResponseStatus.aidl
@@ -0,0 +1,24 @@
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE.                          //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+//     the interface (from the latest frozen version), the build system will
+//     prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.wifi.supplicant;
+@VintfStability
+parcelable QosPolicyScsResponseStatus {
+  byte policyId;
+  android.hardware.wifi.supplicant.QosPolicyScsResponseStatusCode qosPolicyScsResponseStatusCode;
+}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/MediaProtocolType.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyScsResponseStatusCode.aidl
similarity index 60%
copy from radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/MediaProtocolType.aidl
copy to wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyScsResponseStatusCode.aidl
index 1a290d4..693d3e0 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/MediaProtocolType.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyScsResponseStatusCode.aidl
@@ -1,18 +1,3 @@
-/*
- * Copyright (C) 2021 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
 ///////////////////////////////////////////////////////////////////////////////
 // THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE.                          //
 ///////////////////////////////////////////////////////////////////////////////
@@ -31,9 +16,16 @@
 // with such a backward incompatible change, it has a high risk of breaking
 // later when a module using the interface is updated, e.g., Mainline modules.
 
-package android.hardware.radio.ims.media;
+package android.hardware.wifi.supplicant;
 @Backing(type="int") @VintfStability
-enum MediaProtocolType {
-  RTP = 0,
-  RTCP = 1,
+enum QosPolicyScsResponseStatusCode {
+  SUCCESS = 0,
+  TCLAS_REQUEST_DECLINED = 1,
+  TCLAS_NOT_SUPPORTED_BY_AP = 2,
+  TCLAS_INSUFFICIENT_RESOURCES = 3,
+  TCLAS_RESOURCES_EXHAUSTED = 4,
+  TCLAS_PROCESSING_TERMINATED_INSUFFICIENT_QOS = 5,
+  TCLAS_PROCESSING_TERMINATED_POLICY_CONFLICT = 6,
+  TCLAS_PROCESSING_TERMINATED = 7,
+  TIMEOUT = 8,
 }
diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/SupplicantStatusCode.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/SupplicantStatusCode.aidl
index 32d71a3..d84ff95 100644
--- a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/SupplicantStatusCode.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/SupplicantStatusCode.aidl
@@ -45,4 +45,5 @@
   FAILURE_NETWORK_INVALID = 8,
   FAILURE_NETWORK_UNKNOWN = 9,
   FAILURE_UNSUPPORTED = 10,
+  FAILURE_ONGOING_REQUEST = 11,
 }
diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaIface.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaIface.aidl
index 9ceb3c0..e006048 100644
--- a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaIface.aidl
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaIface.aidl
@@ -29,6 +29,8 @@
 import android.hardware.wifi.supplicant.IfaceType;
 import android.hardware.wifi.supplicant.KeyMgmtMask;
 import android.hardware.wifi.supplicant.MloLinksInfo;
+import android.hardware.wifi.supplicant.QosPolicyScsData;
+import android.hardware.wifi.supplicant.QosPolicyScsRequestStatus;
 import android.hardware.wifi.supplicant.QosPolicyStatus;
 import android.hardware.wifi.supplicant.RxFilterType;
 import android.hardware.wifi.supplicant.SignalPollResult;
@@ -793,4 +795,75 @@
      *         |SupplicantStatusCode.FAILURE_UNSUPPORTED|
      */
     SignalPollResult[] getSignalPollResults();
+
+    /**
+     * Maximum number of policies that can be included in a QoS SCS add/remove request.
+     */
+    const int MAX_POLICIES_PER_QOS_SCS_REQUEST = 16;
+
+    /**
+     * Send a set of QoS SCS policy add requests to the AP.
+     *
+     * This is a request to the AP (if it supports the feature) to apply the QoS policies
+     * on traffic in the downlink.
+     *
+     * Synchronous response will indicate which policies were sent to the AP, and which
+     * were rejected immediately by supplicant. Caller will also receive an asynchronous
+     * response in |ISupplicantStaIfaceCallback.onQosPolicyResponseForScs| indicating
+     * the response from the AP for each policy that was sent.
+     *
+     * @param  qosPolicyScsData QoS policies info provided by STA.
+     * @return QosPolicyScsRequestStatus[] synchronously corresponding to all
+     *         the scs policies. Size of the result array will be the same as
+     *         the size of the input array.
+     * @throws ServiceSpecificException with one of the following values:
+     *         |SupplicantStatusCode.FAILURE_UNKNOWN| if the number of policies in the
+     *          request is greater than |MAX_POLICIES_PER_QOS_SCS_REQUEST|
+     *
+     *         |SupplicantStatusCode.FAILURE_UNSUPPORTED| if the AP does not support
+     *          the feature.
+     *
+     *         |SupplicantStatusCode.FAILURE_ONGOING_REQUEST| if a request is currently
+     *          being processed. Supplicant will only handle one request at a time.
+     */
+    QosPolicyScsRequestStatus[] addQosPolicyRequestForScs(in QosPolicyScsData[] qosPolicyData);
+
+    /**
+     * Request the removal of specific QoS policies for SCS configured by the STA.
+     *
+     * Synchronous response will indicate which policies were sent to the AP, and which
+     * were rejected immediately by supplicant. Caller will also receive an asynchronous
+     * response in |ISupplicantStaIfaceCallback.onQosPolicyResponseForScs| indicating
+     * the response from the AP for each policy that was sent.
+     *
+     * @param  scsPolicyIds policy id's to be removed.
+     * @return QosPolicyScsRequestStatus[] synchronously corresponding to all
+     *         the scs policies.
+     * @throws ServiceSpecificException with one of the following values:
+     *         |SupplicantStatusCode.FAILURE_UNKNOWN| if the number of policies in the
+     *          request is greater than |MAX_POLICIES_PER_QOS_SCS_REQUEST|
+     *
+     *         |SupplicantStatusCode.FAILURE_UNSUPPORTED| if the AP does not support
+     *          the feature.
+     *
+     *         |SupplicantStatusCode.FAILURE_ONGOING_REQUEST| if a request is currently
+     *          being processed. Supplicant will only handle one request at a time.
+     */
+    QosPolicyScsRequestStatus[] removeQosPolicyForScs(in byte[] scsPolicyIds);
+
+    /**
+     * Request the removal of all QoS policies for SCS configured by the STA.
+     *
+     * @return QosPolicyScsRequestStatus[] synchronously corresponding to all
+     *         the scs policies.
+     * @throws ServiceSpecificException with one of the following values:
+     *         |SupplicantStatusCode.FAILURE_UNKNOWN| if there are no policies to remove.
+     *
+     *         |SupplicantStatusCode.FAILURE_UNSUPPORTED| if the AP does not support
+     *          the feature.
+     *
+     *         |SupplicantStatusCode.FAILURE_ONGOING_REQUEST| if a request is currently
+     *          being processed. Supplicant will only handle one request at a time.
+     */
+    QosPolicyScsRequestStatus[] removeAllQosPoliciesForScs();
 }
diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaIfaceCallback.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaIfaceCallback.aidl
index 5001800..398bb36 100644
--- a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaIfaceCallback.aidl
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaIfaceCallback.aidl
@@ -31,6 +31,7 @@
 import android.hardware.wifi.supplicant.Hs20AnqpData;
 import android.hardware.wifi.supplicant.OsuMethod;
 import android.hardware.wifi.supplicant.QosPolicyData;
+import android.hardware.wifi.supplicant.QosPolicyScsResponseStatus;
 import android.hardware.wifi.supplicant.StaIfaceCallbackState;
 import android.hardware.wifi.supplicant.StaIfaceReasonCode;
 import android.hardware.wifi.supplicant.SupplicantStateChangeData;
@@ -378,4 +379,17 @@
      * @param stateChangeData Supplicant state change related information.
      */
     void onSupplicantStateChanged(in SupplicantStateChangeData stateChangeData);
+
+    /**
+     * Indicates an SCS response from the AP.
+     *
+     * If the AP does not send a response within the timeout period (1 sec),
+     * supplicant will call this API with the TIMEOUT status for each policy.
+     *
+     * The AP can trigger an unsolicited scs response to indicate the removal of
+     * previously requested policies.
+     *
+     * @param qosPolicyScsResponseStatus[] status for each SCS id.
+     */
+    void onQosPolicyResponseForScs(in QosPolicyScsResponseStatus[] qosPolicyScsResponseStatus);
 }
diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/QosPolicyClassifierParams.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/QosPolicyClassifierParams.aidl
index d95d18d..478b09d 100644
--- a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/QosPolicyClassifierParams.aidl
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/QosPolicyClassifierParams.aidl
@@ -62,4 +62,10 @@
      * "reg-name" in RFC 3986.
      */
     String domainName;
+
+    /**
+     * Differentiated Services Code Point (DSCP) value.
+     * Used by AP for mapping the data streams to apply the user priority.
+     */
+    byte dscp;
 }
diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/QosPolicyClassifierParamsMask.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/QosPolicyClassifierParamsMask.aidl
index 51bc14c..c15fec0 100644
--- a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/QosPolicyClassifierParamsMask.aidl
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/QosPolicyClassifierParamsMask.aidl
@@ -29,4 +29,5 @@
     PROTOCOL_NEXT_HEADER = 1 << 4,
     FLOW_LABEL = 1 << 5,
     DOMAIN_NAME = 1 << 6,
+    DSCP = 1 << 7,
 }
diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/QosPolicyScsData.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/QosPolicyScsData.aidl
new file mode 100644
index 0000000..86a4dac
--- /dev/null
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/QosPolicyScsData.aidl
@@ -0,0 +1,24 @@
+package android.hardware.wifi.supplicant;
+
+import android.hardware.wifi.supplicant.QosPolicyClassifierParams;
+
+/**
+ * QoS policy information in SCS request.
+ * TCLAS Processing element is always set to 0.
+ */
+@VintfStability
+parcelable QosPolicyScsData {
+    /** SCS QoS Policy identifier. */
+    byte policyId;
+
+    /**
+     * User Priority (UP) which the AP should apply to streams that match
+     * the classifier parameters.
+     */
+    byte userPriority;
+
+    /**
+     * QoS policy SCS classifier type information.
+     */
+    QosPolicyClassifierParams classifierParams;
+}
diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/QosPolicyScsRequestStatus.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/QosPolicyScsRequestStatus.aidl
new file mode 100644
index 0000000..e233f32
--- /dev/null
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/QosPolicyScsRequestStatus.aidl
@@ -0,0 +1,13 @@
+package android.hardware.wifi.supplicant;
+
+import android.hardware.wifi.supplicant.QosPolicyScsRequestStatusCode;
+
+/**
+ * QoS policy status info per scsId. Returned immediately by supplicant
+ * upon SCS request.
+ */
+@VintfStability
+parcelable QosPolicyScsRequestStatus {
+    byte policyId;
+    QosPolicyScsRequestStatusCode qosPolicyScsRequestStatusCode;
+}
diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/QosPolicyScsRequestStatusCode.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/QosPolicyScsRequestStatusCode.aidl
new file mode 100644
index 0000000..daf1578
--- /dev/null
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/QosPolicyScsRequestStatusCode.aidl
@@ -0,0 +1,25 @@
+package android.hardware.wifi.supplicant;
+
+/**
+ * Enum values for QoS policy request status.
+ */
+@VintfStability
+@Backing(type="int")
+enum QosPolicyScsRequestStatusCode {
+    /**
+     * SCS request was sent to the AP.
+     */
+    SENT,
+    /**
+     * Add request conflicts with an existing policy ID.
+     */
+    ALREADY_ACTIVE,
+    /**
+     * Remove request is for a policy ID that does not exist.
+     */
+    NOT_EXIST,
+    /**
+     * QoS policy params are invalid.
+     */
+    INVALID,
+}
diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/QosPolicyScsResponseStatus.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/QosPolicyScsResponseStatus.aidl
new file mode 100644
index 0000000..846a0e2
--- /dev/null
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/QosPolicyScsResponseStatus.aidl
@@ -0,0 +1,13 @@
+package android.hardware.wifi.supplicant;
+
+import android.hardware.wifi.supplicant.QosPolicyScsResponseStatusCode;
+
+/**
+ * QoS policy status info per scsId. Returned in a callback once replies are
+ * received from the AP.
+ */
+@VintfStability
+parcelable QosPolicyScsResponseStatus {
+    byte policyId;
+    QosPolicyScsResponseStatusCode qosPolicyScsResponseStatusCode;
+}
diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/QosPolicyScsResponseStatusCode.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/QosPolicyScsResponseStatusCode.aidl
new file mode 100644
index 0000000..f4ecd2a
--- /dev/null
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/QosPolicyScsResponseStatusCode.aidl
@@ -0,0 +1,46 @@
+package android.hardware.wifi.supplicant;
+
+/**
+ * Enum values for QoS policy response status.
+ */
+@VintfStability
+@Backing(type="int")
+enum QosPolicyScsResponseStatusCode {
+    SUCCESS,
+    /**
+     * Network policy does not permit the stream to be assigned the requested
+     * user priority (UP), but the AP might accept another request from the STA
+     * with the same TCLAS classifier(s) but a different user priority (UP).
+     */
+    TCLAS_REQUEST_DECLINED,
+    /**
+     * Requested TCLAS processing is not supported by the AP.
+     */
+    TCLAS_NOT_SUPPORTED_BY_AP,
+    /**
+     * The AP has insufficient TCLAS processing resources to satisfy the request
+     * (i.e. to classify and process the traffic).
+     */
+    TCLAS_INSUFFICIENT_RESOURCES,
+    /**
+     * Sufficient TCLAS processing resources were available when the SCS
+     * stream was created, but are no longer available.
+     */
+    TCLAS_RESOURCES_EXHAUSTED,
+    /**
+     * Insufficient capacity to sustain the current QoS treatment.
+     */
+    TCLAS_PROCESSING_TERMINATED_INSUFFICIENT_QOS,
+    /**
+     * Conflict with a (new or dynamic) network policy.
+     */
+    TCLAS_PROCESSING_TERMINATED_POLICY_CONFLICT,
+    /**
+     * Other reason for decline.
+     */
+    TCLAS_PROCESSING_TERMINATED,
+    /**
+     * AP did not send a response within the timeout period (1 sec).
+     */
+    TIMEOUT,
+}
diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/SupplicantStatusCode.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/SupplicantStatusCode.aidl
index c7b7ffd..e97d6ee 100644
--- a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/SupplicantStatusCode.aidl
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/SupplicantStatusCode.aidl
@@ -63,4 +63,8 @@
      */
     FAILURE_NETWORK_UNKNOWN,
     FAILURE_UNSUPPORTED,
+    /**
+     * A different request is currently being processed.
+     */
+    FAILURE_ONGOING_REQUEST,
 }
diff --git a/wifi/supplicant/aidl/vts/functional/supplicant_sta_iface_aidl_test.cpp b/wifi/supplicant/aidl/vts/functional/supplicant_sta_iface_aidl_test.cpp
index d536618..d0daf96 100644
--- a/wifi/supplicant/aidl/vts/functional/supplicant_sta_iface_aidl_test.cpp
+++ b/wifi/supplicant/aidl/vts/functional/supplicant_sta_iface_aidl_test.cpp
@@ -228,6 +228,12 @@
     ::ndk::ScopedAStatus onBssFrequencyChanged(int32_t /* frequencyMhz */) override {
         return ndk::ScopedAStatus::ok();
     }
+    ::ndk::ScopedAStatus onQosPolicyResponseForScs(
+            const std::vector<::aidl::android::hardware::wifi::supplicant::
+                                      QosPolicyScsResponseStatus>& /* qosPolicyScsResponseStatus */)
+            override {
+        return ndk::ScopedAStatus::ok();
+    }
 };
 
 class SupplicantStaIfaceAidlTest : public testing::TestWithParam<std::string> {