diff --git a/hardware.c b/hardware.c
index 7907331..94b5d5d 100644
--- a/hardware.c
+++ b/hardware.c
@@ -179,20 +179,20 @@
                             const char *subname)
 {
 #ifdef __ANDROID_APEX__
-    // When used in APEX, it should look only into the same APEX because
+    // When used in VAPEX, it should look only into the same APEX because
     // libhardware modules don't provide ABI stability.
-    if (__builtin_available(android AAPEXSUPPORT_API, *)) {
-        AApexInfo *apex_info;
-        if (AApexInfo_create(&apex_info) == AAPEXINFO_OK) {
-            snprintf(path, path_len, "/apex/%s/%s/%s.%s.so",
-                     AApexInfo_getName(apex_info), HAL_LIBRARY_SUBDIR, name, subname);
-            AApexInfo_destroy(apex_info);
-            if (access(path, R_OK) == 0)
-                return 0;
-        }
-    } else {
-        ALOGE("hw_module_exists: libapexsupport is not supported in %d.", __ANDROID_API__);
+#if __ANDROID_VENDOR_API__ >= 202404
+    AApexInfo *apex_info;
+    if (AApexInfo_create(&apex_info) == AAPEXINFO_OK) {
+        snprintf(path, path_len, "/apex/%s/%s/%s.%s.so",
+                 AApexInfo_getName(apex_info), HAL_LIBRARY_SUBDIR, name, subname);
+        AApexInfo_destroy(apex_info);
+        if (access(path, R_OK) == 0)
+            return 0;
     }
+#else  // __ANDROID_VENDOR_API__
+    ALOGE("hw_module_exists: libapexsupport is not supported in %d.", __ANDROID_VENDOR_API__);
+#endif // __ANDROID_VENDOR_API__
 #else // __ANDROID_APEX__
     snprintf(path, path_len, "%s/%s.%s.so",
              HAL_LIBRARY_PATH3, name, subname);
diff --git a/include_all/hardware/sensors.h b/include_all/hardware/sensors.h
index 7b844b8..5f490b5 100644
--- a/include_all/hardware/sensors.h
+++ b/include_all/hardware/sensors.h
@@ -481,7 +481,7 @@
 
     uint32_t reserved1[3];
 } sensors_event_t;
-// LINT.ThenChange (frameworks/native/include/android/sensor.h)
+// LINT.ThenChange(frameworks/native/include/android/sensor.h)
 
 
 /* see SENSOR_TYPE_META_DATA */
diff --git a/modules/audio_remote_submix/audio_hw.cpp b/modules/audio_remote_submix/audio_hw.cpp
index 5019ae5..d6c8c7b 100644
--- a/modules/audio_remote_submix/audio_hw.cpp
+++ b/modules/audio_remote_submix/audio_hw.cpp
@@ -199,9 +199,9 @@
 // Determine whether the specified sample rate is supported by the submix module.
 static bool sample_rate_supported(const uint32_t sample_rate)
 {
-    // Set of sample rates supported by Format_from_SR_C() frameworks/av/media/libnbaio/NAIO.cpp.
     static const unsigned int supported_sample_rates[] = {
         8000, 11025, 12000, 16000, 22050, 24000, 32000, 44100, 48000,
+        192000 /* for IEC 61937 encapsulated E-AC-3(-JOC) */
     };
     bool return_value;
     SUBMIX_VALUE_IN_SET(sample_rate, supported_sample_rates, &return_value);
@@ -1240,6 +1240,10 @@
     *stream_out = NULL;
 
     // Make sure it's possible to open the device given the current audio config.
+    if (!audio_is_linear_pcm(config->format)) {
+        ALOGD("adev_open_output_stream(): not supported for audio format %#x", config->format);
+        return -EINVAL;
+    }
     submix_sanitize_config(config, false);
 
     int route_idx = -1;
@@ -1455,6 +1459,11 @@
 
     *stream_in = NULL;
 
+    if (!audio_is_linear_pcm(config->format)) {
+        ALOGD("adev_open_input_stream(): not supported for audio format %#x", config->format);
+        return -EINVAL;
+    }
+
     // Do we already have a route for this address
     int route_idx = -1;
 
diff --git a/modules/sensors/dynamic_sensor/Android.bp b/modules/sensors/dynamic_sensor/Android.bp
index b6e0020..1ede955 100644
--- a/modules/sensors/dynamic_sensor/Android.bp
+++ b/modules/sensors/dynamic_sensor/Android.bp
@@ -194,6 +194,7 @@
 aconfig_declarations {
     name: "dynamic_sensors_flags",
     package: "com.android.libhardware.dynamic.sensors.flags",
+    container: "system",
     srcs: ["dynamic_sensors.aconfig"],
 }
 
@@ -202,4 +203,4 @@
     aconfig_declarations: "dynamic_sensors_flags",
     host_supported: true,
     vendor: true,
-}
\ No newline at end of file
+}
diff --git a/modules/sensors/dynamic_sensor/DynamicSensorsSubHal.cpp b/modules/sensors/dynamic_sensor/DynamicSensorsSubHal.cpp
index 101b983..8df91c2 100644
--- a/modules/sensors/dynamic_sensor/DynamicSensorsSubHal.cpp
+++ b/modules/sensors/dynamic_sensor/DynamicSensorsSubHal.cpp
@@ -20,6 +20,7 @@
 #include <convertV2_1.h>
 #include <hardware/sensors-base.h>
 #include <log/log.h>
+#include <com_android_libhardware_dynamic_sensors_flags.h>
 
 #include <chrono>
 #include <thread>
@@ -32,6 +33,8 @@
 template<class T> using Return = ::android::hardware::Return<T>;
 using ::android::hardware::Void;
 
+namespace dynamic_sensors_flags = com::android::libhardware::dynamic::sensors::flags;
+
 namespace android {
 namespace SensorHalExt {
 
@@ -165,6 +168,8 @@
     std::vector<Event> events;
     Event hal_event;
     bool wakeup;
+    bool disconnectDynamicSensorFlag =
+        dynamic_sensors_flags::dynamic_sensors_hal_disconnect_dynamic_sensor();
 
     if (e.type == SENSOR_TYPE_DYNAMIC_SENSOR_META) {
         const dynamic_sensor_meta_event_t* sensor_meta;
@@ -172,21 +177,25 @@
         sensor_meta = static_cast<const dynamic_sensor_meta_event_t*>(
                 &(e.dynamic_sensor_meta));
         if (sensor_meta->connected != 0) {
-            // The sensor framework must be notified of the connected sensor
-            // through the callback before handling the sensor added event. If
-            // it isn't, it will assert when looking up the sensor handle when
-            // processing the sensor added event.
-            //
-            // TODO (b/201529167): Fix dynamic sensors addition / removal when
-            //                     converting to AIDL.
-            // The sensor framework runs in a separate process from the sensor
-            // HAL, and it processes events in a dedicated thread, so it's
-            // possible the event handling can be done before the callback is
-            // run. Thus, a delay is added after sending notification of the
-            // connected sensor.
             onSensorConnected(sensor_meta->handle, sensor_meta->sensor);
+        } else if (disconnectDynamicSensorFlag) {
+            onSensorDisconnected(sensor_meta->handle);
+        }
+        // The sensor framework must be notified of the connected sensor
+        // through the callback before handling the sensor added event. If
+        // it isn't, it will assert when looking up the sensor handle when
+        // processing the sensor added event.
+        //
+        // TODO (b/201529167): Fix dynamic sensors addition / removal when
+        //                     converting to AIDL.
+        // The sensor framework runs in a separate process from the sensor
+        // HAL, and it processes events in a dedicated thread, so it's
+        // possible the event handling can be done before the callback is
+        // run. Thus, a delay is added after sending notification of the
+        // connected sensor.
+        if (disconnectDynamicSensorFlag || sensor_meta->connected != 0) {
             std::this_thread::sleep_for(std::chrono::milliseconds(1000));
-       }
+        }
     }
 
     convertFromSensorEvent(e, &hal_event);
@@ -226,6 +235,14 @@
     mHalProxyCallback->onDynamicSensorsConnected_2_1(sensor_list);
 }
 
+void DynamicSensorsSubHal::onSensorDisconnected(int handle) {
+    hidl_vec<int32_t> handleList;
+    handleList.resize(1);
+    handleList[0] = handle;
+
+    mHalProxyCallback->onDynamicSensorsDisconnected(handleList);
+}
+
 } // namespace SensorHalExt
 } // namespace android
 
diff --git a/modules/sensors/dynamic_sensor/DynamicSensorsSubHal.h b/modules/sensors/dynamic_sensor/DynamicSensorsSubHal.h
index f59b00a..0d90dc0 100644
--- a/modules/sensors/dynamic_sensor/DynamicSensorsSubHal.h
+++ b/modules/sensors/dynamic_sensor/DynamicSensorsSubHal.h
@@ -77,6 +77,7 @@
                                                       kDynamicHandleBase;
 
     void onSensorConnected(int handle, const sensor_t* sensor_info);
+    void onSensorDisconnected(int handle);
 
     std::unique_ptr<DynamicSensorManager> mDynamicSensorManager;
     sp<IHalProxyCallback> mHalProxyCallback;
diff --git a/modules/sensors/dynamic_sensor/HidRawSensor.cpp b/modules/sensors/dynamic_sensor/HidRawSensor.cpp
index 939b58d..b61185d 100644
--- a/modules/sensors/dynamic_sensor/HidRawSensor.cpp
+++ b/modules/sensors/dynamic_sensor/HidRawSensor.cpp
@@ -988,18 +988,33 @@
     SP(HidDevice) device = PROMOTE(mDevice);
 
     if (device == nullptr) {
+        LOG_E << "enable: no device" << LOG_ENDL;
         return NO_INIT;
     }
 
     if (enable == mEnabled) {
+        LOG_D << "enable: already in desired state" << LOG_ENDL;
         return NO_ERROR;
     }
 
+    bool setLeAudioTransportOk = setLeAudioTransport(device, enable);
+    bool setPowerOk = setPower(device, enable);
+    bool setReportingOk = setReportingState(device, enable);
+    if (setPowerOk && setReportingOk && setLeAudioTransportOk) {
+        mEnabled = enable;
+        LOG_I << "enable: success" << LOG_ENDL;
+        return NO_ERROR;
+    } else {
+        LOG_E << "enable: set feature failed" << LOG_ENDL;
+        return INVALID_OPERATION;
+    }
+}
+
+bool HidRawSensor::setLeAudioTransport(const SP(HidDevice) &device, bool enable) {
     std::vector<uint8_t> buffer;
-    // TODO(b/298450041): Refactor the operations below in a separate function.
-    bool setLeAudioTransportOk = true;
+    bool success = true;
     if (mLeTransportId >= 0 && enable) {
-        setLeAudioTransportOk = false;
+        success = false;
         uint8_t id = static_cast<uint8_t>(mLeTransportId);
         if (device->getFeature(id, &buffer)
                 && (8 * buffer.size()) >=
@@ -1030,18 +1045,22 @@
 
             HidUtil::copyBits(&index, &(buffer[0]), buffer.size(), 0,
                               mLeTransportBitOffset, mLeTransportBitSize);
-            setLeAudioTransportOk = device->setFeature(id, buffer);
-            if (!setLeAudioTransportOk) {
+            success = device->setFeature(id, buffer);
+            if (!success) {
               LOG_E << "enable: setFeature VENDOR LE TRANSPORT failed" << LOG_ENDL;
             }
         } else {
             LOG_E << "enable: changing VENDOR LE TRANSPORT failed" << LOG_ENDL;
         }
     }
+    return success;
+}
 
-    bool setPowerOk = true;
+bool HidRawSensor::setPower(const SP(HidDevice) &device, bool enable) {
+    std::vector<uint8_t> buffer;
+    bool success = true;
     if (mPowerStateId >= 0) {
-        setPowerOk = false;
+        success = false;
         uint8_t id = static_cast<uint8_t>(mPowerStateId);
         if (device->getFeature(id, &buffer)
                 && (8 * buffer.size()) >=
@@ -1049,18 +1068,22 @@
             uint8_t index = enable ? mPowerStateOnIndex : mPowerStateOffIndex;
             HidUtil::copyBits(&index, &(buffer[0]), buffer.size(),
                               0, mPowerStateBitOffset, mPowerStateBitSize);
-            setPowerOk = device->setFeature(id, buffer);
-            if (!setPowerOk) {
+            success = device->setFeature(id, buffer);
+            if (!success) {
               LOG_E << "enable: setFeature POWER STATE failed" << LOG_ENDL;
             }
         } else {
             LOG_E << "enable: changing POWER STATE failed" << LOG_ENDL;
         }
     }
+    return success;
+}
 
-    bool setReportingOk = true;
+bool HidRawSensor::setReportingState(const SP(HidDevice) &device, bool enable) {
+    std::vector<uint8_t> buffer;
+    bool success = true;
     if (mReportingStateId >= 0) {
-        setReportingOk = false;
+        success = false;
         uint8_t id = static_cast<uint8_t>(mReportingStateId);
         if (device->getFeature(id, &buffer)
                 && (8 * buffer.size()) >
@@ -1069,21 +1092,15 @@
                                      mReportingStateDisableIndex;
             HidUtil::copyBits(&index, &(buffer[0]), buffer.size(),0,
                               mReportingStateBitOffset, mReportingStateBitSize);
-            setReportingOk = device->setFeature(id, buffer);
-            if (!setReportingOk) {
+            success = device->setFeature(id, buffer);
+            if (!success) {
               LOG_E << "enable: setFeature REPORTING STATE failed" << LOG_ENDL;
             }
         } else {
             LOG_E << "enable: changing REPORTING STATE failed" << LOG_ENDL;
         }
     }
-
-    if (setPowerOk && setReportingOk && setLeAudioTransportOk) {
-        mEnabled = enable;
-        return NO_ERROR;
-    } else {
-        return INVALID_OPERATION;
-    }
+    return success;
 }
 
 int HidRawSensor::batch(int64_t samplingPeriod, int64_t batchingPeriod) {
diff --git a/modules/sensors/dynamic_sensor/HidRawSensor.h b/modules/sensors/dynamic_sensor/HidRawSensor.h
index a9847c8..71d80b1 100644
--- a/modules/sensors/dynamic_sensor/HidRawSensor.h
+++ b/modules/sensors/dynamic_sensor/HidRawSensor.h
@@ -149,6 +149,10 @@
     // process HID snesor spec defined orientation(quaternion) sensor usages.
     bool processQuaternionUsage(const std::vector<HidParser::ReportPacket> &packets);
 
+    bool setLeAudioTransport(const SP(HidDevice) &device, bool enable);
+    bool setPower(const SP(HidDevice) &device, bool enable);
+    bool setReportingState(const SP(HidDevice) &device, bool enable);
+
     // get the value of a report field
     template<typename ValueType>
     bool getReportFieldValue(const std::vector<uint8_t> &message,
diff --git a/modules/sensors/dynamic_sensor/HidRawSensorDaemon.cpp b/modules/sensors/dynamic_sensor/HidRawSensorDaemon.cpp
index 4b447ac..0d561b1 100644
--- a/modules/sensors/dynamic_sensor/HidRawSensorDaemon.cpp
+++ b/modules/sensors/dynamic_sensor/HidRawSensorDaemon.cpp
@@ -59,7 +59,7 @@
         ALOGE("failed to create HidRawSensorDevice object");
     }
 
-    ALOGE("return %zu sensors", ret.size());
+    ALOGI("return %zu sensors", ret.size());
     return ret;
 }
 
diff --git a/modules/sensors/dynamic_sensor/dynamic_sensors.aconfig b/modules/sensors/dynamic_sensor/dynamic_sensors.aconfig
index dc312c0..fe9c145 100644
--- a/modules/sensors/dynamic_sensor/dynamic_sensors.aconfig
+++ b/modules/sensors/dynamic_sensor/dynamic_sensors.aconfig
@@ -1,8 +1,16 @@
 package: "com.android.libhardware.dynamic.sensors.flags"
+container: "system"
 
 flag {
   name: "dynamic_sensors_le_audio"
   namespace: "sensors"
   description: "This flag controls the enablement of LE audio support on dynamic sensors"
   bug: "298450041"
+}
+
+flag {
+  name: "dynamic_sensors_hal_disconnect_dynamic_sensor"
+  namespace: "sensors"
+  description: "This flag controls if onDynamicSensorDisconnect callback in sensors HAL will be triggered"
+  bug: "316958439"
 }
\ No newline at end of file
