Merge "Fix quantized LSTM doc"
diff --git a/audio/6.0/IDevice.hal b/audio/6.0/IDevice.hal
index 122c550..2347696 100644
--- a/audio/6.0/IDevice.hal
+++ b/audio/6.0/IDevice.hal
@@ -295,4 +295,28 @@
      */
     @exit
     close() generates (Result retval);
+
+    /**
+     * Applies an audio effect to an audio device.
+     *
+     * @param device identifies the sink or source device this effect must be applied to.
+     *               "device" is the AudioPortHandle indicated for the device when the audio
+     *                patch connecting that device was created.
+     * @param effectId effect ID (obtained from IEffectsFactory.createEffect) of
+     *                 the effect to add.
+     * @return retval operation completion status.
+     */
+    addDeviceEffect(AudioPortHandle device, uint64_t effectId) generates (Result retval);
+
+    /**
+     * Stops applying an audio effect to an audio device.
+     *
+     * @param device identifies the sink or source device this effect was applied to.
+     *               "device" is the AudioPortHandle indicated for the device when the audio
+     *               patch is created at the audio HAL.
+     * @param effectId effect ID (obtained from IEffectsFactory.createEffect) of
+     *                 the effect.
+     * @return retval operation completion status.
+     */
+    removeDeviceEffect(AudioPortHandle device, uint64_t effectId) generates (Result retval);
 };
diff --git a/audio/common/6.0/types.hal b/audio/common/6.0/types.hal
index c76f678..da506d6 100644
--- a/audio/common/6.0/types.hal
+++ b/audio/common/6.0/types.hal
@@ -157,6 +157,11 @@
 @export(name="audio_session_t", value_prefix="AUDIO_SESSION_")
 enum AudioSessionConsts : int32_t {
     /**
+     * Session for effects attached to a particular sink or source audio device
+     * (e.g an effect only applied to a speaker)
+     */
+    DEVICE = -2,
+    /**
      * Session for effects attached to a particular output stream
      * (value must be less than 0)
      */
diff --git a/audio/core/all-versions/default/Device.cpp b/audio/core/all-versions/default/Device.cpp
index c6c9464..ad841ca 100644
--- a/audio/core/all-versions/default/Device.cpp
+++ b/audio/core/all-versions/default/Device.cpp
@@ -18,6 +18,7 @@
 
 #include "core/default/Device.h"
 #include <HidlUtils.h>
+#include "common/all-versions/default/EffectMap.h"
 #include "core/default/Conversions.h"
 #include "core/default/StreamIn.h"
 #include "core/default/StreamOut.h"
@@ -25,6 +26,7 @@
 
 //#define LOG_NDEBUG 0
 
+#include <inttypes.h>
 #include <memory.h>
 #include <string.h>
 #include <algorithm>
@@ -403,6 +405,39 @@
 Return<Result> Device::close() {
     return doClose();
 }
+
+Return<Result> Device::addDeviceEffect(AudioPortHandle device, uint64_t effectId) {
+    if (version() < AUDIO_DEVICE_API_VERSION_3_1 || mDevice->add_device_effect == nullptr) {
+        return Result::NOT_SUPPORTED;
+    }
+
+    effect_handle_t halEffect = EffectMap::getInstance().get(effectId);
+    if (halEffect != NULL) {
+        return analyzeStatus("add_device_effect",
+                             mDevice->add_device_effect(
+                                     mDevice, static_cast<audio_port_handle_t>(device), halEffect));
+    } else {
+        ALOGW("%s Invalid effect ID passed from client: %" PRIu64 "", __func__, effectId);
+        return Result::INVALID_ARGUMENTS;
+    }
+}
+
+Return<Result> Device::removeDeviceEffect(AudioPortHandle device, uint64_t effectId) {
+    if (version() < AUDIO_DEVICE_API_VERSION_3_1 || mDevice->remove_device_effect == nullptr) {
+        return Result::NOT_SUPPORTED;
+    }
+
+    effect_handle_t halEffect = EffectMap::getInstance().get(effectId);
+    if (halEffect != NULL) {
+        return analyzeStatus("remove_device_effect",
+                             mDevice->remove_device_effect(
+                                     mDevice, static_cast<audio_port_handle_t>(device), halEffect));
+    } else {
+        ALOGW("%s Invalid effect ID passed from client: %" PRIu64 "", __func__, effectId);
+        return Result::INVALID_ARGUMENTS;
+    }
+}
+
 #endif
 
 }  // namespace implementation
diff --git a/audio/core/all-versions/default/PrimaryDevice.cpp b/audio/core/all-versions/default/PrimaryDevice.cpp
index 3cf0932..0f1aba0 100644
--- a/audio/core/all-versions/default/PrimaryDevice.cpp
+++ b/audio/core/all-versions/default/PrimaryDevice.cpp
@@ -168,6 +168,14 @@
 Return<Result> PrimaryDevice::close() {
     return mDevice->close();
 }
+
+Return<Result> PrimaryDevice::addDeviceEffect(AudioPortHandle device, uint64_t effectId) {
+    return mDevice->addDeviceEffect(device, effectId);
+}
+
+Return<Result> PrimaryDevice::removeDeviceEffect(AudioPortHandle device, uint64_t effectId) {
+    return mDevice->removeDeviceEffect(device, effectId);
+}
 #endif
 
 // Methods from ::android::hardware::audio::CPP_VERSION::IPrimaryDevice follow.
diff --git a/audio/core/all-versions/default/include/core/default/Device.h b/audio/core/all-versions/default/include/core/default/Device.h
index 11ab607..80a9638 100644
--- a/audio/core/all-versions/default/include/core/default/Device.h
+++ b/audio/core/all-versions/default/include/core/default/Device.h
@@ -116,8 +116,9 @@
 #endif
 #if MAJOR_VERSION >= 6
     Return<Result> close() override;
+    Return<Result> addDeviceEffect(AudioPortHandle device, uint64_t effectId) override;
+    Return<Result> removeDeviceEffect(AudioPortHandle device, uint64_t effectId) override;
 #endif
-
     Return<void> debug(const hidl_handle& fd, const hidl_vec<hidl_string>& options) override;
 
     // Utility methods for extending interfaces.
diff --git a/audio/core/all-versions/default/include/core/default/PrimaryDevice.h b/audio/core/all-versions/default/include/core/default/PrimaryDevice.h
index f5f3848..9fc90c3 100644
--- a/audio/core/all-versions/default/include/core/default/PrimaryDevice.h
+++ b/audio/core/all-versions/default/include/core/default/PrimaryDevice.h
@@ -98,6 +98,8 @@
 #endif
 #if MAJOR_VERSION >= 6
     Return<Result> close() override;
+    Return<Result> addDeviceEffect(AudioPortHandle device, uint64_t effectId) override;
+    Return<Result> removeDeviceEffect(AudioPortHandle device, uint64_t effectId) override;
 #endif
 
     Return<void> debug(const hidl_handle& fd, const hidl_vec<hidl_string>& options) override;
diff --git a/audio/effect/6.0/IEffectsFactory.hal b/audio/effect/6.0/IEffectsFactory.hal
index e08b2de..4c37bad 100644
--- a/audio/effect/6.0/IEffectsFactory.hal
+++ b/audio/effect/6.0/IEffectsFactory.hal
@@ -48,11 +48,15 @@
      *                stream.
      * @param ioHandle identifies the output or input stream this effect is
      *                 directed to in audio HAL.
+     * @param device identifies the sink or source device this effect is directed to in the
+     *               audio HAL. Must be specified if session is AudioSessionConsts.DEVICE.
+     *               "device" is the AudioPortHandle used for the device when the audio
+     *               patch is created at the audio HAL.
      * @return retval operation completion status.
      * @return result the interface for the created effect.
      * @return effectId the unique ID of the effect to be used with
      *                  IStream::addEffect and IStream::removeEffect methods.
      */
-    createEffect(Uuid uid, AudioSession session, AudioIoHandle ioHandle)
+    createEffect(Uuid uid, AudioSession session, AudioIoHandle ioHandle, AudioPortHandle device)
         generates (Result retval, IEffect result, uint64_t effectId);
 };
diff --git a/audio/effect/all-versions/default/EffectsFactory.cpp b/audio/effect/all-versions/default/EffectsFactory.cpp
index 6283e7b..acce7de 100644
--- a/audio/effect/all-versions/default/EffectsFactory.cpp
+++ b/audio/effect/all-versions/default/EffectsFactory.cpp
@@ -133,9 +133,9 @@
     return Void();
 }
 
-Return<void> EffectsFactory::getDescriptor(const Uuid& uid, getDescriptor_cb _hidl_cb) {
+Return<void> EffectsFactory::getDescriptor(const Uuid& uuid, getDescriptor_cb _hidl_cb) {
     effect_uuid_t halUuid;
-    HidlUtils::uuidToHal(uid, &halUuid);
+    HidlUtils::uuidToHal(uuid, &halUuid);
     effect_descriptor_t halDescriptor;
     status_t status = EffectGetDescriptor(&halUuid, &halDescriptor);
     EffectDescriptor descriptor;
@@ -154,13 +154,31 @@
     return Void();
 }
 
-Return<void> EffectsFactory::createEffect(const Uuid& uid, int32_t session, int32_t ioHandle,
-                                          createEffect_cb _hidl_cb) {
+#if MAJOR_VERSION <= 5
+Return<void> EffectsFactory::createEffect(const Uuid& uuid, int32_t session, int32_t ioHandle,
+                                          EffectsFactory::createEffect_cb _hidl_cb) {
+    return createEffectImpl(uuid, session, ioHandle, AUDIO_PORT_HANDLE_NONE, _hidl_cb);
+}
+#else
+Return<void> EffectsFactory::createEffect(const Uuid& uuid, int32_t session, int32_t ioHandle,
+                                          int32_t device,
+                                          EffectsFactory::createEffect_cb _hidl_cb) {
+    return createEffectImpl(uuid, session, ioHandle, device, _hidl_cb);
+}
+#endif
+
+Return<void> EffectsFactory::createEffectImpl(const Uuid& uuid, int32_t session, int32_t ioHandle,
+                                              int32_t device, createEffect_cb _hidl_cb) {
     effect_uuid_t halUuid;
-    HidlUtils::uuidToHal(uid, &halUuid);
+    HidlUtils::uuidToHal(uuid, &halUuid);
     effect_handle_t handle;
     Result retval(Result::OK);
-    status_t status = EffectCreate(&halUuid, session, ioHandle, &handle);
+    status_t status;
+    if (session == AUDIO_SESSION_DEVICE) {
+        status = EffectCreateOnDevice(&halUuid, device, ioHandle, &handle);
+    } else {
+        status = EffectCreate(&halUuid, session, ioHandle, &handle);
+    }
     sp<IEffect> effect;
     uint64_t effectId = EffectMap::INVALID_ID;
     if (status == OK) {
diff --git a/audio/effect/all-versions/default/EffectsFactory.h b/audio/effect/all-versions/default/EffectsFactory.h
index f0d09ec..0b86836 100644
--- a/audio/effect/all-versions/default/EffectsFactory.h
+++ b/audio/effect/all-versions/default/EffectsFactory.h
@@ -47,9 +47,15 @@
 struct EffectsFactory : public IEffectsFactory {
     // Methods from ::android::hardware::audio::effect::CPP_VERSION::IEffectsFactory follow.
     Return<void> getAllDescriptors(getAllDescriptors_cb _hidl_cb) override;
-    Return<void> getDescriptor(const Uuid& uid, getDescriptor_cb _hidl_cb) override;
-    Return<void> createEffect(const Uuid& uid, int32_t session, int32_t ioHandle,
+    Return<void> getDescriptor(const Uuid& uuid, getDescriptor_cb _hidl_cb) override;
+#if MAJOR_VERSION <= 5
+    Return<void> createEffect(const Uuid& uuid, int32_t session, int32_t ioHandle,
                               createEffect_cb _hidl_cb) override;
+#else
+    Return<void> createEffect(const Uuid& uuid, int32_t session, int32_t ioHandle, int32_t device,
+                              createEffect_cb _hidl_cb) override;
+#endif
+
     Return<void> debugDump(
         const hidl_handle& fd);  //< in CPP_VERSION::IEffectsFactory only, alias of debug
     Return<void> debug(const hidl_handle& fd, const hidl_vec<hidl_string>& options) override;
@@ -57,6 +63,8 @@
    private:
     static sp<IEffect> dispatchEffectInstanceCreation(const effect_descriptor_t& halDescriptor,
                                                       effect_handle_t handle);
+    Return<void> createEffectImpl(const Uuid& uuid, int32_t session, int32_t ioHandle,
+                                  int32_t device, createEffect_cb _hidl_cb);
 };
 
 extern "C" IEffectsFactory* HIDL_FETCH_IEffectsFactory(const char* name);
diff --git a/audio/effect/all-versions/vts/functional/VtsHalAudioEffectTargetTest.cpp b/audio/effect/all-versions/vts/functional/VtsHalAudioEffectTargetTest.cpp
index a7fc35d..390d4ee 100644
--- a/audio/effect/all-versions/vts/functional/VtsHalAudioEffectTargetTest.cpp
+++ b/audio/effect/all-versions/vts/functional/VtsHalAudioEffectTargetTest.cpp
@@ -96,13 +96,16 @@
     Result retval = Result::NOT_INITIALIZED;
     sp<IEffect> effect;
     ret = effectsFactory->createEffect(
-        effectUuid, 1 /*session*/, 1 /*ioHandle*/,
-        [&](Result r, const sp<IEffect>& result, uint64_t /*effectId*/) {
-            retval = r;
-            if (r == Result::OK) {
-                effect = result;
-            }
-        });
+            effectUuid, 1 /*session*/, 1 /*ioHandle*/,
+#if MAJOR_VERSION >= 6
+            0 /*device*/,
+#endif
+            [&](Result r, const sp<IEffect>& result, uint64_t /*effectId*/) {
+                retval = r;
+                if (r == Result::OK) {
+                    effect = result;
+                }
+            });
     EXPECT_TRUE(ret.isOk());
     EXPECT_EQ(Result::OK, retval);
     EXPECT_NE(nullptr, effect.get());
@@ -191,12 +194,15 @@
     Uuid effectUuid;
     findEffectInstance(type, &effectUuid);
     Return<void> ret = effectsFactory->createEffect(
-        effectUuid, 1 /*session*/, 1 /*ioHandle*/,
-        [&](Result r, const sp<IEffect>& result, uint64_t /*effectId*/) {
-            if (r == Result::OK) {
-                effect = result;
-            }
-        });
+            effectUuid, 1 /*session*/, 1 /*ioHandle*/,
+#if MAJOR_VERSION >= 6
+            0 /*device*/,
+#endif
+            [&](Result r, const sp<IEffect>& result, uint64_t /*effectId*/) {
+                if (r == Result::OK) {
+                    effect = result;
+                }
+            });
     ASSERT_TRUE(ret.isOk());
 }
 
diff --git a/current.txt b/current.txt
index 66aa7e9..cc9337c 100644
--- a/current.txt
+++ b/current.txt
@@ -585,14 +585,14 @@
 
 # HALs released in Android R
 e966a3437d6a98d9d9e14e9d672088771716031900c0deb55a0946c751a03a44 android.hardware.audio@6.0::types
-2736c59abaccacac407ebe80c5e48d446edf015051d05632fb679ba471779e6e android.hardware.audio@6.0::IDevice
+4540d12fe1cea996f21bd1712d4ae0906dcbd58177dac494efc605b004902d43 android.hardware.audio@6.0::IDevice
 2402876cbc23c0de3690a665eca84fd3857d1808dba5cad25ce272f81ecef8c9 android.hardware.audio@6.0::IDevicesFactory
 bca5379d5065e2e08b6ad7308ffc8a71a972fc0698bec678ea32eea786d01cb5 android.hardware.audio@6.0::IPrimaryDevice
 7318b521ea12fdd4b6e3f381085c71784c810d1ec7a8d701ec2250f3f86712e4 android.hardware.audio@6.0::IStream
 2df5d5866b37776f25079c0e54b54350a2abe4e025a59c9e02a7d3abe8ca00e8 android.hardware.audio@6.0::IStreamIn
 78e4138cc8307c11fc777c3bd376e581ba4ba48196b05ca1d7cdfa515c87b48a android.hardware.audio@6.0::IStreamOut
 997fdaad7a9d17ee7e01feb7031a753e2365e72ad30b11d950e9183fabdf3844 android.hardware.audio@6.0::IStreamOutCallback
-996a930734d2875471d49972ab0117071831f5e6504e1b63a9664c9634da7687 android.hardware.audio.common@6.0::types
+b495a43bd6ff0c34a391824b0ba1a3f3f34b4a869690611a9a0afc404d75aa84 android.hardware.audio.common@6.0::types
 817930d58412d662cb45e641c50cb62c727e4a3e3ffe7029a53cad9677b97d58 android.hardware.audio.effect@6.0::types
 525bec6b44f1103869c269a128d51b8dccd73af5340ba863c8886c68357c7faf android.hardware.audio.effect@6.0::IAcousticEchoCancelerEffect
 8d76bbe3719d051a8e9a1dcf9244f37f5b0a491feb249fa48391edf7cb4f3131 android.hardware.audio.effect@6.0::IAutomaticGainControlEffect
@@ -600,7 +600,7 @@
 8bc597d166e07e9eba633267fc2872c4c53d13d3f0025b778c98e13324a165de android.hardware.audio.effect@6.0::IDownmixEffect
 9ee022c81e79da6051fde0836c1c1c4d5414e0c9a6cccc0ce17a90346ceb1391 android.hardware.audio.effect@6.0::IEffect
 75c99a70577d543359910a0b378bcbf5a0d6076712e58e6864cd8803f76c8684 android.hardware.audio.effect@6.0::IEffectBufferProviderCallback
-5910bdd600fc6501a67233a9a3f4f21dda86af08c05497322712600131d1fa8f android.hardware.audio.effect@6.0::IEffectsFactory
+b138d519696f23af2c7cb92c532178c35f4b3a5c1b689260b1c308fe00249f8b android.hardware.audio.effect@6.0::IEffectsFactory
 dd377f404a8e71f6191d295e10067db629b0f0c28e594af906f2bea5d87fe2cc android.hardware.audio.effect@6.0::IEnvironmentalReverbEffect
 455e085e136767302ec34d02b51a085c310e79bf500b76dda7c96a7f3637f11a android.hardware.audio.effect@6.0::IEqualizerEffect
 24b5e107a0cbd2b322f764a4d5f7fb8b5d8c337a060b9a4a26b9af050c57b5d0 android.hardware.audio.effect@6.0::ILoudnessEnhancerEffect
@@ -631,10 +631,10 @@
 ##
 # BEGIN Radio HAL Merge Conflict Avoidance Buffer - STOPSHIP if present
 ##
-2c0587a1e83facba604949c31163486f21eb5b47a29c8f29119a47d3bd052103 android.hardware.radio@1.5::types
-b5cfa87882b416105fe01e8a40a856d36c93d64f1103d77e12b1281cea13b0bd android.hardware.radio@1.5::IRadio
-bc59237dbd93949238081f762710552e76670cb648c0e198138551460ac54b1e android.hardware.radio@1.5::IRadioIndication
-ef10e15cdbe8ba63925302a95962d5679bbda6a4351400cc23e1589ca0e9f94b android.hardware.radio@1.5::IRadioResponse
+73b5418353fe52721267d64592d4d4c1b77fbd1ef4261d964865de88e62ee0be android.hardware.radio@1.5::types
+996f98ffe508a2f6f1755c1511b50067f7883f7c445dea9f3e931385f020b7ab android.hardware.radio@1.5::IRadio
+20d52e66fd548f89bcb98cda42749a591ce8f439a2a7148617adac0c967ad937 android.hardware.radio@1.5::IRadioIndication
+1512f6e1198e1aa0ebcbdb1694d0ed500a3e7791d6f305327866112331d82b66 android.hardware.radio@1.5::IRadioResponse
 55f0a15642869ec98a55ea0a5ac049d3e1a6245ff7750deb6bcb7182057eee83 android.hardware.radio.config@1.3::types
 b27ab0cd40b0b078cdcd024bfe1061c4c4c065f3519eeb9347fa359a3268a5ae android.hardware.radio.config@1.3::IRadioConfig
 742360c775313438b0f82256eac62fb5bbc76a6ae6f388573f3aa142fb2c1eea android.hardware.radio.config@1.3::IRadioConfigIndication
diff --git a/radio/1.5/IRadio.hal b/radio/1.5/IRadio.hal
index d0c5b0d..e41989c 100644
--- a/radio/1.5/IRadio.hal
+++ b/radio/1.5/IRadio.hal
@@ -20,6 +20,7 @@
 import @1.4::IRadio;
 import @1.4::DataProfileInfo;
 import @1.5::AccessNetwork;
+import @1.5::BarringInfo;
 import @1.5::DataProfileInfo;
 import @1.5::IndicationFilter;
 import @1.5::LinkAddress;
@@ -235,4 +236,13 @@
      * Response callback is IRadioResponse.setIndicationFilterResponse()
      */
     oneway setIndicationFilter_1_5(int32_t serial, bitfield<IndicationFilter> indicationFilter);
+
+    /**
+     * Get all the barring info for the current camped cell applicable to the current user.
+     *
+     * @param serial Serial number of request.
+     *
+     * Response callback is IRadioResponse.getBarringInfoResponse()
+     */
+    oneway getBarringInfo(int32_t serial);
 };
diff --git a/radio/1.5/IRadioIndication.hal b/radio/1.5/IRadioIndication.hal
index 879e9ad..cafecbc 100644
--- a/radio/1.5/IRadioIndication.hal
+++ b/radio/1.5/IRadioIndication.hal
@@ -59,4 +59,21 @@
     oneway registrationFailed(
             RadioIndicationType type, CellIdentity cellIdentity, string chosenPlmn,
             bitfield<Domain> domain, int32_t causeCode, int32_t additionalCauseCode);
+
+    /**
+     * Indicate barring information for the user’s access category / access class and PLMN.
+     *
+     * <p>Provide information about the barring status of the cell for the user. The information
+     * provided should describe all barring configurations that are applicable to the current user,
+     * even if the user is not currently barred (due to conditional barring). This informs Android
+     * of likely future (statistical) barring for specific services.
+     *
+     * <p>This indication should be sent whenever the cell’s barring config changes for the current
+     * user, or if the user’s conditional barring status changes due to re-evaluation of the
+     * barring conditions. Barring status will likely change when the device camps for service,
+     * when PLMN selection is completed, when the device attempts to access a conditionally barred
+     * service, and when the System Information including barring info for a camped cell is updated.
+     */
+    oneway barringInfoChanged(
+            RadioIndicationType type, CellIdentity cellIdentity, vec<BarringInfo> barringInfos);
 };
diff --git a/radio/1.5/IRadioResponse.hal b/radio/1.5/IRadioResponse.hal
index f1b7e71..2ed789a 100644
--- a/radio/1.5/IRadioResponse.hal
+++ b/radio/1.5/IRadioResponse.hal
@@ -18,6 +18,7 @@
 
 import @1.0::RadioResponseInfo;
 import @1.4::IRadioResponse;
+import @1.5::BarringInfo;
 import @1.5::SetupDataCallResult;
 
 /**
@@ -157,4 +158,16 @@
      *   RadioError:SYSTEM_ERR
      */
     oneway setIndicationFilterResponse_1_5(RadioResponseInfo info);
+
+    /**
+     * @param info Response info struct containing response type, serial no. and error
+     * @param barringInfos a vector of barring info for all barring service types
+     *
+     * Valid errors returned:
+     *   RadioError:NONE
+     *   RadioError:RADIO_NOT_AVAILABLE
+     *   RadioError:INTERNAL_ERR
+     *   RadioError:MODEM_ERR
+     */
+    oneway getBarringInfoResponse(RadioResponseInfo info, vec<BarringInfo> barringInfos);
 };
diff --git a/radio/1.5/types.hal b/radio/1.5/types.hal
index 12c27d0..724d014 100644
--- a/radio/1.5/types.hal
+++ b/radio/1.5/types.hal
@@ -426,7 +426,130 @@
     CellIdentityNr nr;
 };
 
+/**
+ * Combined list of barring services for UTRAN, EUTRAN, and NGRAN.
+ *
+ * Barring information is defined in:
+ * -UTRAN - 3gpp 25.331 Sec 10.2.48.8.6.
+ * -EUTRAN - 3gpp 36.331 Sec 6.3.1 SystemInformationBlockType2
+ * -NGRAN - 3gpp 38.331 Sec 6.3.2 UAC-BarringInfo and 22.261 Sec 6.22.2.[2-3]
+ */
+enum BarringServiceType : int32_t {
+    /** Applicabe to UTRAN */
+    /** Barring for all CS services, including registration */
+    CS_SERVICE,
+    /** Barring for all PS services, including registration */
+    PS_SERVICE,
+    /** Barring for mobile-originated circuit-switched voice calls */
+    CS_VOICE,
+
+    /** Applicable to EUTRAN, NGRAN */
+    /** Barring for mobile-originated signalling for any purpose */
+    MO_SIGNALLING,
+    /** Barring for mobile-originated internet or other interactive data */
+    MO_DATA,
+    /** Barring for circuit-switched fallback calling */
+    CS_FALLBACK,
+    /** Barring for IMS voice calling */
+    MMTEL_VOICE,
+    /** Barring for IMS video calling */
+    MMTEL_VIDEO,
+
+    /** Applicable to UTRAN, EUTRAN, NGRAN */
+    /** Barring for emergency services, either CS or emergency MMTEL */
+    EMERGENCY,
+    /** Barring for short message services */
+    SMS,
+
+    /** Operator-specific barring codes; applicable to NGRAN */
+    OPERATOR_1 = 1001,
+    OPERATOR_2 = 1002,
+    OPERATOR_3 = 1003,
+    OPERATOR_4 = 1004,
+    OPERATOR_5 = 1005,
+    OPERATOR_6 = 1006,
+    OPERATOR_7 = 1007,
+    OPERATOR_8 = 1008,
+    OPERATOR_9 = 1009,
+    OPERATOR_10 = 1010,
+    OPERATOR_11 = 1011,
+    OPERATOR_12 = 1012,
+    OPERATOR_13 = 1013,
+    OPERATOR_14 = 1014,
+    OPERATOR_15 = 1015,
+    OPERATOR_16 = 1016,
+    OPERATOR_17 = 1017,
+    OPERATOR_18 = 1018,
+    OPERATOR_19 = 1019,
+    OPERATOR_20 = 1020,
+    OPERATOR_21 = 1021,
+    OPERATOR_22 = 1022,
+    OPERATOR_23 = 1023,
+    OPERATOR_24 = 1024,
+    OPERATOR_25 = 1025,
+    OPERATOR_26 = 1026,
+    OPERATOR_27 = 1027,
+    OPERATOR_28 = 1028,
+    OPERATOR_29 = 1029,
+    OPERATOR_30 = 1030,
+    OPERATOR_31 = 1031,
+    OPERATOR_32 = 1032,
+};
+
+enum BarringType : int32_t {
+    /** Device is not barred for the given service */
+    NONE,
+    /** Device may be barred based on time and probability factors */
+    CONDITIONAL,
+    /* Device is unconditionally barred */
+    UNCONDITIONAL,
+};
+
+struct ConditionalBarringInfo {
+    /** The barring factor as a percentage 0-100 */
+    int32_t barringFactor;
+
+    /** The number of seconds between re-evaluations of barring */
+    int32_t barringTimeSeconds;
+
+    /**
+     * Indicates whether barring is currently being applied.
+     *
+     * <p>True if the UE applies barring to a conditionally barred
+     * service based on the conditional barring parameters.
+     *
+     * <p>False if the service is conditionally barred but barring
+     * is not currently applied, which could be due to either the
+     * barring criteria not having been evaluated (if the UE has not
+     * attempted to use the service) or due to the criteria being
+     * evaluated and the UE being permitted to use the service
+     * despite conditional barring.
+     */
+    bool isBarred;
+};
+
+safe_union BarringTypeSpecificInfo {
+    /** Barring type is either none or unconditional */
+    Monostate noinit;
+
+    /** Must be included if barring is conditional */
+    ConditionalBarringInfo conditionalBarringInfo;
+};
+
+struct BarringInfo {
+    /** Barring service */
+    BarringServiceType service;
+
+    /** The type of barring applied to the service */
+    BarringType type;
+
+    /** Type-specific barring info if applicable */
+    BarringTypeSpecificInfo typeSpecificInfo;
+};
+
 enum IndicationFilter : @1.2::IndicationFilter {
     /** Control the unsolicited sending of registration failure reports via onRegistrationFailed */
     REGISTRATION_FAILURE = 1 << 5,
+    /** Control the unsolicited sending of barring info updates via onBarringInfo */
+    BARRING_INFO = 1 << 6,
 };
diff --git a/radio/1.5/vts/functional/radio_hidl_hal_utils_v1_5.h b/radio/1.5/vts/functional/radio_hidl_hal_utils_v1_5.h
index c3c9f54..217caf5 100644
--- a/radio/1.5/vts/functional/radio_hidl_hal_utils_v1_5.h
+++ b/radio/1.5/vts/functional/radio_hidl_hal_utils_v1_5.h
@@ -553,6 +553,11 @@
     Return<void> setRadioPowerResponse_1_5(const RadioResponseInfo& info);
 
     Return<void> setIndicationFilterResponse_1_5(const RadioResponseInfo& info);
+
+    Return<void> getBarringInfoResponse(
+            const RadioResponseInfo& info,
+            const ::android::hardware::hidl_vec<::android::hardware::radio::V1_5::BarringInfo>&
+                    barringInfos);
 };
 
 /* Callback class for radio indication */
@@ -748,6 +753,12 @@
             const ::android::hardware::hidl_string& chosenPlmn,
             ::android::hardware::hidl_bitfield<::android::hardware::radio::V1_5::Domain> domain,
             int32_t causeCode, int32_t additionalCauseCode);
+
+    Return<void> barringInfoChanged(
+            RadioIndicationType /*type*/,
+            const ::android::hardware::radio::V1_5::CellIdentity& /*cellIdentity*/,
+            const ::android::hardware::hidl_vec<::android::hardware::radio::V1_5::BarringInfo>&
+            /*barringInfos*/);
 };
 
 // Test environment for Radio HIDL HAL.
diff --git a/radio/1.5/vts/functional/radio_indication.cpp b/radio/1.5/vts/functional/radio_indication.cpp
index 2416605..1483907 100644
--- a/radio/1.5/vts/functional/radio_indication.cpp
+++ b/radio/1.5/vts/functional/radio_indication.cpp
@@ -342,3 +342,11 @@
         int32_t /*causeCode*/, int32_t /*additionalCauseCode*/) {
     return Void();
 }
+
+Return<void> RadioIndication_v1_5::barringInfoChanged(
+        RadioIndicationType /*type*/,
+        const ::android::hardware::radio::V1_5::CellIdentity& /*cellIdentity*/,
+        const ::android::hardware::hidl_vec<::android::hardware::radio::V1_5::BarringInfo>&
+        /*barringInfos*/) {
+    return Void();
+}
diff --git a/radio/1.5/vts/functional/radio_response.cpp b/radio/1.5/vts/functional/radio_response.cpp
index 877945f..644a262 100644
--- a/radio/1.5/vts/functional/radio_response.cpp
+++ b/radio/1.5/vts/functional/radio_response.cpp
@@ -960,3 +960,12 @@
     parent_v1_5.notify(info.serial);
     return Void();
 }
+
+Return<void> RadioResponse_v1_5::getBarringInfoResponse(
+        const RadioResponseInfo& info,
+        const ::android::hardware::hidl_vec<::android::hardware::radio::V1_5::BarringInfo>&
+        /*barringInfos*/) {
+    rspInfo = info;
+    parent_v1_5.notify(info.serial);
+    return Void();
+}
diff --git a/vibrator/aidl/TEST_MAPPING b/vibrator/aidl/TEST_MAPPING
new file mode 100644
index 0000000..5ae32e7
--- /dev/null
+++ b/vibrator/aidl/TEST_MAPPING
@@ -0,0 +1,7 @@
+{
+  "presubmit": [
+    {
+      "name": "VtsHalVibratorTargetTest"
+    }
+  ]
+}
diff --git a/vibrator/aidl/vts/Android.bp b/vibrator/aidl/vts/Android.bp
index a01e432..d1e135e 100644
--- a/vibrator/aidl/vts/Android.bp
+++ b/vibrator/aidl/vts/Android.bp
@@ -12,6 +12,7 @@
         "android.hardware.vibrator-cpp",
     ],
     test_suites: [
+        "general-tests",
         "vts-core",
     ],
 }
diff --git a/vibrator/aidl/vts/VtsHalVibratorTargetTest.cpp b/vibrator/aidl/vts/VtsHalVibratorTargetTest.cpp
index 0e2b3e1..f197763 100644
--- a/vibrator/aidl/vts/VtsHalVibratorTargetTest.cpp
+++ b/vibrator/aidl/vts/VtsHalVibratorTargetTest.cpp
@@ -49,14 +49,9 @@
         static_cast<EffectStrength>(static_cast<int8_t>(kEffectStrengths.back()) + 1),
 };
 
-// TODO(b/143992652): autogenerate
-const std::vector<CompositePrimitive> kCompositePrimitives = {
-        CompositePrimitive::NOOP,       CompositePrimitive::CLICK,
-        CompositePrimitive::THUD,       CompositePrimitive::SPIN,
-        CompositePrimitive::QUICK_RISE, CompositePrimitive::SLOW_RISE,
-        CompositePrimitive::QUICK_FALL,
-};
-// TODO(b/143992652): autogenerate
+const std::vector<CompositePrimitive> kCompositePrimitives{
+        android::enum_range<CompositePrimitive>().begin(),
+        android::enum_range<CompositePrimitive>().end()};
 
 const std::vector<CompositePrimitive> kInvalidPrimitives = {
         static_cast<CompositePrimitive>(static_cast<int32_t>(kCompositePrimitives.front()) - 1),