Merge "[Lut HAL] documentation update." into main
diff --git a/audio/aidl/vts/Android.bp b/audio/aidl/vts/Android.bp
index e2d4b79..14e70ef 100644
--- a/audio/aidl/vts/Android.bp
+++ b/audio/aidl/vts/Android.bp
@@ -117,6 +117,9 @@
     defaults: ["VtsHalAudioEffectTargetTestDefaults"],
     static_libs: ["libaudioaidlranges"],
     srcs: ["VtsHalDynamicsProcessingTest.cpp"],
+    shared_libs: [
+        "libaudioutils",
+    ],
 }
 
 cc_test {
diff --git a/audio/aidl/vts/VtsHalDynamicsProcessingTest.cpp b/audio/aidl/vts/VtsHalDynamicsProcessingTest.cpp
index 0c201cc..f106d83 100644
--- a/audio/aidl/vts/VtsHalDynamicsProcessingTest.cpp
+++ b/audio/aidl/vts/VtsHalDynamicsProcessingTest.cpp
@@ -20,6 +20,8 @@
 
 #define LOG_TAG "VtsHalDynamicsProcessingTest"
 #include <android-base/logging.h>
+#include <audio_utils/power.h>
+#include <audio_utils/primitives.h>
 
 #include <Utils.h>
 
@@ -44,26 +46,25 @@
 class DynamicsProcessingTestHelper : public EffectHelper {
   public:
     DynamicsProcessingTestHelper(std::pair<std::shared_ptr<IFactory>, Descriptor> pair,
-                                 int32_t channelLayOut = AudioChannelLayout::LAYOUT_STEREO) {
+                                 int32_t channelLayOut = AudioChannelLayout::LAYOUT_STEREO)
+        : mChannelLayout(channelLayOut),
+          mChannelCount(::aidl::android::hardware::audio::common::getChannelCount(
+                  AudioChannelLayout::make<AudioChannelLayout::layoutMask>(mChannelLayout))) {
         std::tie(mFactory, mDescriptor) = pair;
-        mChannelLayout = channelLayOut;
-        mChannelCount = ::aidl::android::hardware::audio::common::getChannelCount(
-                AudioChannelLayout::make<AudioChannelLayout::layoutMask>(mChannelLayout));
     }
 
     // setup
     void SetUpDynamicsProcessingEffect() {
         ASSERT_NE(nullptr, mFactory);
         ASSERT_NO_FATAL_FAILURE(create(mFactory, mEffect, mDescriptor));
-
         Parameter::Specific specific = getDefaultParamSpecific();
         Parameter::Common common = createParamCommon(
-                0 /* session */, 1 /* ioHandle */, 44100 /* iSampleRate */, 44100 /* oSampleRate */,
-                0x100 /* iFrameCount */, 0x100 /* oFrameCount */,
+                0 /* session */, 1 /* ioHandle */, kSamplingFrequency /* iSampleRate */,
+                kSamplingFrequency /* oSampleRate */, kFrameCount /* iFrameCount */,
+                kFrameCount /* oFrameCount */,
                 AudioChannelLayout::make<AudioChannelLayout::layoutMask>(mChannelLayout),
                 AudioChannelLayout::make<AudioChannelLayout::layoutMask>(mChannelLayout));
-        IEffect::OpenEffectReturn ret;
-        ASSERT_NO_FATAL_FAILURE(open(mEffect, common, specific, &ret, EX_NONE));
+        ASSERT_NO_FATAL_FAILURE(open(mEffect, common, specific, &mOpenEffectReturn, EX_NONE));
         ASSERT_NE(nullptr, mEffect);
         mEngineConfigApplied = mEngineConfigPreset;
     }
@@ -113,6 +114,8 @@
     // get set params and validate
     void SetAndGetDynamicsProcessingParameters();
 
+    bool isAllParamsValid();
+
     // enqueue test parameters
     void addEngineConfig(const DynamicsProcessing::EngineArchitecture& cfg);
     void addPreEqChannelConfig(const std::vector<DynamicsProcessing::ChannelConfig>& cfg);
@@ -126,9 +129,12 @@
 
     static constexpr float kPreferredProcessingDurationMs = 10.0f;
     static constexpr int kBandCount = 5;
+    static constexpr int kSamplingFrequency = 44100;
+    static constexpr int kFrameCount = 2048;
     std::shared_ptr<IFactory> mFactory;
     std::shared_ptr<IEffect> mEffect;
     Descriptor mDescriptor;
+    IEffect::OpenEffectReturn mOpenEffectReturn;
     DynamicsProcessing::EngineArchitecture mEngineConfigApplied;
     DynamicsProcessing::EngineArchitecture mEngineConfigPreset{
             .resolutionPreference =
@@ -148,12 +154,12 @@
     static const std::set<DynamicsProcessing::StageEnablement> kStageEnablementTestSet;
     static const std::set<std::vector<DynamicsProcessing::InputGain>> kInputGainTestSet;
 
-  protected:
-    int mChannelCount;
-
   private:
-    int32_t mChannelLayout;
+    const int32_t mChannelLayout;
     std::vector<std::pair<DynamicsProcessing::Tag, DynamicsProcessing>> mTags;
+
+  protected:
+    const int mChannelCount;
     void CleanUp() {
         mTags.clear();
         mPreEqChannelEnable.clear();
@@ -329,10 +335,7 @@
 }
 
 void DynamicsProcessingTestHelper::SetAndGetDynamicsProcessingParameters() {
-    for (auto& it : mTags) {
-        auto& tag = it.first;
-        auto& dp = it.second;
-
+    for (const auto& [tag, dp] : mTags) {
         // validate parameter
         Descriptor desc;
         ASSERT_STATUS(EX_NONE, mEffect->getDescriptor(&desc));
@@ -371,6 +374,22 @@
     }
 }
 
+bool DynamicsProcessingTestHelper::isAllParamsValid() {
+    if (mTags.empty()) {
+        return false;
+    }
+    for (const auto& [tag, dp] : mTags) {
+        // validate parameter
+        if (!isParamInRange(dp, mDescriptor.capability.range.get<Range::dynamicsProcessing>())) {
+            return false;
+        }
+        if (!isParamValid(tag, dp)) {
+            return false;
+        }
+    }
+    return true;
+}
+
 void DynamicsProcessingTestHelper::addEngineConfig(
         const DynamicsProcessing::EngineArchitecture& cfg) {
     DynamicsProcessing dp;
@@ -446,6 +465,21 @@
     mTags.push_back({DynamicsProcessing::inputGain, dp});
 }
 
+void fillLimiterConfig(std::vector<DynamicsProcessing::LimiterConfig>& limiterConfigList,
+                       int channelIndex, bool enable, int linkGroup, float attackTime,
+                       float releaseTime, float ratio, float threshold, float postGain) {
+    DynamicsProcessing::LimiterConfig cfg;
+    cfg.channel = channelIndex;
+    cfg.enable = enable;
+    cfg.linkGroup = linkGroup;
+    cfg.attackTimeMs = attackTime;
+    cfg.releaseTimeMs = releaseTime;
+    cfg.ratio = ratio;
+    cfg.thresholdDb = threshold;
+    cfg.postGainDb = postGain;
+    limiterConfigList.push_back(cfg);
+}
+
 /**
  * Test DynamicsProcessing Engine Configuration
  */
@@ -486,7 +520,7 @@
 
 TEST_P(DynamicsProcessingTestEngineArchitecture, SetAndGetEngineArch) {
     EXPECT_NO_FATAL_FAILURE(addEngineConfig(mCfg));
-    SetAndGetDynamicsProcessingParameters();
+    ASSERT_NO_FATAL_FAILURE(SetAndGetDynamicsProcessingParameters());
 }
 
 INSTANTIATE_TEST_SUITE_P(
@@ -527,7 +561,7 @@
   public:
     DynamicsProcessingTestInputGain()
         : DynamicsProcessingTestHelper(std::get<INPUT_GAIN_INSTANCE_NAME>(GetParam())),
-          mInputGain(std::get<INPUT_GAIN_PARAM>(GetParam())){};
+          mInputGain(std::get<INPUT_GAIN_PARAM>(GetParam())) {};
 
     void SetUp() override { SetUpDynamicsProcessingEffect(); }
 
@@ -538,7 +572,7 @@
 
 TEST_P(DynamicsProcessingTestInputGain, SetAndGetInputGain) {
     EXPECT_NO_FATAL_FAILURE(addInputGain(mInputGain));
-    SetAndGetDynamicsProcessingParameters();
+    ASSERT_NO_FATAL_FAILURE(SetAndGetDynamicsProcessingParameters());
 }
 
 INSTANTIATE_TEST_SUITE_P(
@@ -565,40 +599,23 @@
 enum LimiterConfigTestParamName {
     LIMITER_INSTANCE_NAME,
     LIMITER_CHANNEL,
-    LIMITER_ENABLE,
     LIMITER_LINK_GROUP,
-    LIMITER_ADDITIONAL,
-};
-enum LimiterConfigTestAdditionalParam {
     LIMITER_ATTACK_TIME,
     LIMITER_RELEASE_TIME,
     LIMITER_RATIO,
     LIMITER_THRESHOLD,
     LIMITER_POST_GAIN,
-    LIMITER_MAX_NUM,
 };
-using LimiterConfigTestAdditional = std::array<float, LIMITER_MAX_NUM>;
-// attackTime, releaseTime, ratio, thresh, postGain
-static constexpr std::array<LimiterConfigTestAdditional, 4> kLimiterConfigTestAdditionalParam = {
-        {{-1, -60, -2.5, -2, -3.14},
-         {-1, 60, -2.5, 2, -3.14},
-         {1, -60, 2.5, -2, 3.14},
-         {1, 60, 2.5, -2, 3.14}}};
 
 using LimiterConfigTestParams = std::tuple<std::pair<std::shared_ptr<IFactory>, Descriptor>,
-                                           int32_t, bool, int32_t, LimiterConfigTestAdditional>;
+                                           int32_t, int32_t, float, float, float, float, float>;
 
-void fillLimiterConfig(DynamicsProcessing::LimiterConfig& cfg,
+void fillLimiterConfig(std::vector<DynamicsProcessing::LimiterConfig>& cfg,
                        const LimiterConfigTestParams& params) {
-    const std::array<float, LIMITER_MAX_NUM> additional = std::get<LIMITER_ADDITIONAL>(params);
-    cfg.channel = std::get<LIMITER_CHANNEL>(params);
-    cfg.enable = std::get<LIMITER_ENABLE>(params);
-    cfg.linkGroup = std::get<LIMITER_LINK_GROUP>(params);
-    cfg.attackTimeMs = additional[LIMITER_ATTACK_TIME];
-    cfg.releaseTimeMs = additional[LIMITER_RELEASE_TIME];
-    cfg.ratio = additional[LIMITER_RATIO];
-    cfg.thresholdDb = additional[LIMITER_THRESHOLD];
-    cfg.postGainDb = additional[LIMITER_POST_GAIN];
+    fillLimiterConfig(cfg, std::get<LIMITER_CHANNEL>(params), true,
+                      std::get<LIMITER_LINK_GROUP>(params), std::get<LIMITER_ATTACK_TIME>(params),
+                      std::get<LIMITER_RELEASE_TIME>(params), std::get<LIMITER_RATIO>(params),
+                      std::get<LIMITER_THRESHOLD>(params), std::get<LIMITER_POST_GAIN>(params));
 }
 
 class DynamicsProcessingTestLimiterConfig
@@ -607,7 +624,7 @@
   public:
     DynamicsProcessingTestLimiterConfig()
         : DynamicsProcessingTestHelper(std::get<LIMITER_INSTANCE_NAME>(GetParam())) {
-        fillLimiterConfig(mCfg, GetParam());
+        fillLimiterConfig(mLimiterConfigList, GetParam());
     }
 
     void SetUp() override { SetUpDynamicsProcessingEffect(); }
@@ -615,36 +632,193 @@
     void TearDown() override { TearDownDynamicsProcessingEffect(); }
 
     DynamicsProcessing::LimiterConfig mCfg;
+    std::vector<DynamicsProcessing::LimiterConfig> mLimiterConfigList;
 };
 
 TEST_P(DynamicsProcessingTestLimiterConfig, SetAndGetLimiterConfig) {
     EXPECT_NO_FATAL_FAILURE(addEngineConfig(mEngineConfigPreset));
-    EXPECT_NO_FATAL_FAILURE(addLimiterConfig({mCfg}));
-    SetAndGetDynamicsProcessingParameters();
+    EXPECT_NO_FATAL_FAILURE(addLimiterConfig(mLimiterConfigList));
+    ASSERT_NO_FATAL_FAILURE(SetAndGetDynamicsProcessingParameters());
 }
 
 INSTANTIATE_TEST_SUITE_P(
         DynamicsProcessingTest, DynamicsProcessingTestLimiterConfig,
         ::testing::Combine(testing::ValuesIn(EffectFactoryHelper::getAllEffectDescriptors(
                                    IFactory::descriptor, getEffectTypeUuidDynamicsProcessing())),
-                           testing::Values(-1, 0, 1, 2),                           // channel count
-                           testing::Bool(),                                        // enable
-                           testing::Values(3),                                     // link group
-                           testing::ValuesIn(kLimiterConfigTestAdditionalParam)),  // Additional
+                           testing::Values(-1, 0, 1, 2),  // channel index
+                           testing::Values(3),            // link group
+                           testing::Values(-1, 1),        // attackTime
+                           testing::Values(-60, 60),      // releaseTime
+                           testing::Values(-2.5, 2.5),    // ratio
+                           testing::Values(-2, 2),        // thresh
+                           testing::Values(-3.14, 3.14)   // postGain
+                           ),
         [](const auto& info) {
             auto descriptor = std::get<LIMITER_INSTANCE_NAME>(info.param).second;
-            DynamicsProcessing::LimiterConfig cfg;
+            std::vector<DynamicsProcessing::LimiterConfig> cfg;
             fillLimiterConfig(cfg, info.param);
-            std::string name = "Implementor_" + descriptor.common.implementor + "_name_" +
-                               descriptor.common.name + "_UUID_" +
-                               toString(descriptor.common.id.uuid) + "_limiterConfig_" +
-                               cfg.toString();
+            std::string name =
+                    "Implementer_" + getPrefix(descriptor) + "_limiterConfig_" + cfg[0].toString();
             std::replace_if(
                     name.begin(), name.end(), [](const char c) { return !std::isalnum(c); }, '_');
             return name;
         });
 GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(DynamicsProcessingTestLimiterConfig);
 
+using LimiterConfigDataTestParams = std::pair<std::shared_ptr<IFactory>, Descriptor>;
+
+class DynamicsProcessingLimiterConfigDataTest
+    : public ::testing::TestWithParam<LimiterConfigDataTestParams>,
+      public DynamicsProcessingTestHelper {
+  public:
+    DynamicsProcessingLimiterConfigDataTest()
+        : DynamicsProcessingTestHelper(GetParam(), AudioChannelLayout::LAYOUT_MONO) {
+        mBufferSize = kFrameCount * mChannelCount;
+        mInput.resize(mBufferSize);
+        generateSineWave(1000 /*Input Frequency*/, mInput);
+        mInputDb = calculateDb(mInput);
+    }
+
+    void SetUp() override {
+        SetUpDynamicsProcessingEffect();
+        SKIP_TEST_IF_DATA_UNSUPPORTED(mDescriptor.common.flags);
+    }
+
+    void TearDown() override { TearDownDynamicsProcessingEffect(); }
+
+    float calculateDb(std::vector<float> input, size_t start = 0) {
+        return audio_utils_compute_power_mono(input.data() + start, AUDIO_FORMAT_PCM_FLOAT,
+                                              input.size() - start);
+    }
+
+    void computeThreshold(float ratio, float outputDb, float& threshold) {
+        EXPECT_NE(ratio, 0);
+        threshold = (mInputDb - (ratio * outputDb)) / (1 - ratio);
+    }
+
+    void computeRatio(float threshold, float outputDb, float& ratio) {
+        float inputOverThreshold = mInputDb - threshold;
+        float outputOverThreshold = outputDb - threshold;
+        EXPECT_NE(outputOverThreshold, 0);
+        ratio = inputOverThreshold / outputOverThreshold;
+    }
+
+    void setParamsAndProcess(std::vector<float>& output) {
+        EXPECT_NO_FATAL_FAILURE(addEngineConfig(mEngineConfigPreset));
+        EXPECT_NO_FATAL_FAILURE(addLimiterConfig(mLimiterConfigList));
+        ASSERT_NO_FATAL_FAILURE(SetAndGetDynamicsProcessingParameters());
+        if (isAllParamsValid()) {
+            ASSERT_NO_FATAL_FAILURE(
+                    processAndWriteToOutput(mInput, output, mEffect, &mOpenEffectReturn));
+            EXPECT_GT(output.size(), kStartIndex);
+        }
+        cleanUpLimiterConfig();
+    }
+
+    void cleanUpLimiterConfig() {
+        CleanUp();
+        mLimiterConfigList.clear();
+    }
+    static constexpr float kDefaultLinkerGroup = 3;
+    static constexpr float kDefaultAttackTime = 0;
+    static constexpr float kDefaultReleaseTime = 0;
+    static constexpr float kDefaultRatio = 4;
+    static constexpr float kDefaultThreshold = 0;
+    static constexpr float kDefaultPostGain = 0;
+    static constexpr int kInputFrequency = 1000;
+    static constexpr size_t kStartIndex = 15 * kSamplingFrequency / 1000;  // skip 15ms
+    std::vector<DynamicsProcessing::LimiterConfig> mLimiterConfigList;
+    std::vector<float> mInput;
+    float mInputDb;
+    int mBufferSize;
+};
+
+TEST_P(DynamicsProcessingLimiterConfigDataTest, IncreasingThresholdDb) {
+    std::vector<float> thresholdValues = {-200, -150, -100, -50, -5, 0};
+    std::vector<float> output(mInput.size());
+    float previousThreshold = -FLT_MAX;
+    for (float threshold : thresholdValues) {
+        for (int i = 0; i < mChannelCount; i++) {
+            fillLimiterConfig(mLimiterConfigList, i, true, kDefaultLinkerGroup, kDefaultAttackTime,
+                              kDefaultReleaseTime, kDefaultRatio, threshold, kDefaultPostGain);
+        }
+        EXPECT_NO_FATAL_FAILURE(setParamsAndProcess(output));
+        if (!isAllParamsValid()) {
+            continue;
+        }
+        float outputDb = calculateDb(output, kStartIndex);
+        if (threshold >= mInputDb || kDefaultRatio == 1) {
+            EXPECT_EQ(std::round(mInputDb), std::round(outputDb));
+        } else {
+            float calculatedThreshold = 0;
+            EXPECT_NO_FATAL_FAILURE(computeThreshold(kDefaultRatio, outputDb, calculatedThreshold));
+            ASSERT_GT(calculatedThreshold, previousThreshold);
+            previousThreshold = calculatedThreshold;
+        }
+    }
+}
+
+TEST_P(DynamicsProcessingLimiterConfigDataTest, IncreasingRatio) {
+    std::vector<float> ratioValues = {1, 10, 20, 30, 40, 50};
+    std::vector<float> output(mInput.size());
+    float threshold = -10;
+    float previousRatio = 0;
+    for (float ratio : ratioValues) {
+        for (int i = 0; i < mChannelCount; i++) {
+            fillLimiterConfig(mLimiterConfigList, i, true, kDefaultLinkerGroup, kDefaultAttackTime,
+                              kDefaultReleaseTime, ratio, threshold, kDefaultPostGain);
+        }
+        EXPECT_NO_FATAL_FAILURE(setParamsAndProcess(output));
+        if (!isAllParamsValid()) {
+            continue;
+        }
+        float outputDb = calculateDb(output, kStartIndex);
+
+        if (threshold >= mInputDb) {
+            EXPECT_EQ(std::round(mInputDb), std::round(outputDb));
+        } else {
+            float calculatedRatio = 0;
+            EXPECT_NO_FATAL_FAILURE(computeRatio(threshold, outputDb, calculatedRatio));
+            ASSERT_GT(calculatedRatio, previousRatio);
+            previousRatio = calculatedRatio;
+        }
+    }
+}
+
+TEST_P(DynamicsProcessingLimiterConfigDataTest, LimiterEnableDisable) {
+    std::vector<bool> limiterEnableValues = {false, true};
+    std::vector<float> output(mInput.size());
+    for (bool isEnabled : limiterEnableValues) {
+        for (int i = 0; i < mChannelCount; i++) {
+            // Set non-default values
+            fillLimiterConfig(mLimiterConfigList, i, isEnabled, kDefaultLinkerGroup,
+                              5 /*attack time*/, 5 /*release time*/, 10 /*ratio*/,
+                              -10 /*threshold*/, 5 /*postgain*/);
+        }
+        EXPECT_NO_FATAL_FAILURE(setParamsAndProcess(output));
+        if (!isAllParamsValid()) {
+            continue;
+        }
+        if (isEnabled) {
+            EXPECT_NE(mInputDb, calculateDb(output, kStartIndex));
+        } else {
+            EXPECT_NEAR(mInputDb, calculateDb(output, kStartIndex), 0.05);
+        }
+    }
+}
+
+INSTANTIATE_TEST_SUITE_P(DynamicsProcessingTest, DynamicsProcessingLimiterConfigDataTest,
+                         testing::ValuesIn(EffectFactoryHelper::getAllEffectDescriptors(
+                                 IFactory::descriptor, getEffectTypeUuidDynamicsProcessing())),
+                         [](const auto& info) {
+                             auto descriptor = info.param;
+                             std::string name = getPrefix(descriptor.second);
+                             std::replace_if(
+                                     name.begin(), name.end(),
+                                     [](const char c) { return !std::isalnum(c); }, '_');
+                             return name;
+                         });
+
 /**
  * Test DynamicsProcessing ChannelConfig
  */
@@ -673,19 +847,19 @@
 TEST_P(DynamicsProcessingTestChannelConfig, SetAndGetPreEqChannelConfig) {
     EXPECT_NO_FATAL_FAILURE(addEngineConfig(mEngineConfigPreset));
     EXPECT_NO_FATAL_FAILURE(addPreEqChannelConfig(mCfg));
-    SetAndGetDynamicsProcessingParameters();
+    ASSERT_NO_FATAL_FAILURE(SetAndGetDynamicsProcessingParameters());
 }
 
 TEST_P(DynamicsProcessingTestChannelConfig, SetAndGetPostEqChannelConfig) {
     EXPECT_NO_FATAL_FAILURE(addEngineConfig(mEngineConfigPreset));
     EXPECT_NO_FATAL_FAILURE(addPostEqChannelConfig(mCfg));
-    SetAndGetDynamicsProcessingParameters();
+    ASSERT_NO_FATAL_FAILURE(SetAndGetDynamicsProcessingParameters());
 }
 
 TEST_P(DynamicsProcessingTestChannelConfig, SetAndGetMbcChannelConfig) {
     EXPECT_NO_FATAL_FAILURE(addEngineConfig(mEngineConfigPreset));
     EXPECT_NO_FATAL_FAILURE(addMbcChannelConfig(mCfg));
-    SetAndGetDynamicsProcessingParameters();
+    ASSERT_NO_FATAL_FAILURE(SetAndGetDynamicsProcessingParameters());
 }
 
 INSTANTIATE_TEST_SUITE_P(
@@ -715,12 +889,11 @@
 enum EqBandConfigTestParamName {
     EQ_BAND_INSTANCE_NAME,
     EQ_BAND_CHANNEL,
-    EQ_BAND_ENABLE,
     EQ_BAND_CUT_OFF_FREQ,
     EQ_BAND_GAIN
 };
 using EqBandConfigTestParams = std::tuple<std::pair<std::shared_ptr<IFactory>, Descriptor>, int32_t,
-                                          bool, std::vector<std::pair<int, float>>, float>;
+                                          std::vector<std::pair<int, float>>, float>;
 
 void fillEqBandConfig(std::vector<DynamicsProcessing::EqBandConfig>& cfgs,
                       const EqBandConfigTestParams& params) {
@@ -730,7 +903,7 @@
     for (int i = 0; i < bandCount; i++) {
         cfgs[i].channel = std::get<EQ_BAND_CHANNEL>(params);
         cfgs[i].band = cutOffFreqs[i].first;
-        cfgs[i].enable = std::get<EQ_BAND_ENABLE>(params);
+        cfgs[i].enable = true /*Eqband Enable*/;
         cfgs[i].cutoffFrequencyHz = cutOffFreqs[i].second;
         cfgs[i].gainDb = std::get<EQ_BAND_GAIN>(params);
     }
@@ -761,7 +934,7 @@
     }
     EXPECT_NO_FATAL_FAILURE(addPreEqChannelConfig(cfgs));
     EXPECT_NO_FATAL_FAILURE(addPreEqBandConfigs(mCfgs));
-    SetAndGetDynamicsProcessingParameters();
+    ASSERT_NO_FATAL_FAILURE(SetAndGetDynamicsProcessingParameters());
 }
 
 TEST_P(DynamicsProcessingTestEqBandConfig, SetAndGetPostEqBandConfig) {
@@ -774,7 +947,7 @@
     }
     EXPECT_NO_FATAL_FAILURE(addPostEqChannelConfig(cfgs));
     EXPECT_NO_FATAL_FAILURE(addPostEqBandConfigs(mCfgs));
-    SetAndGetDynamicsProcessingParameters();
+    ASSERT_NO_FATAL_FAILURE(SetAndGetDynamicsProcessingParameters());
 }
 
 std::vector<std::vector<std::pair<int, float>>> kBands{
@@ -825,9 +998,8 @@
         DynamicsProcessingTest, DynamicsProcessingTestEqBandConfig,
         ::testing::Combine(testing::ValuesIn(EffectFactoryHelper::getAllEffectDescriptors(
                                    IFactory::descriptor, getEffectTypeUuidDynamicsProcessing())),
-                           testing::Values(-1, 0, 10),     // channel ID
-                           testing::Bool(),                // band enable
-                           testing::ValuesIn(kBands),      // cut off frequencies
+                           testing::Values(-1, 0, 10),     // channel index
+                           testing::ValuesIn(kBands),      // band index, cut off frequencies
                            testing::Values(-3.14f, 3.14f)  // gain
                            ),
         [](const auto& info) {
@@ -851,7 +1023,6 @@
 enum MbcBandConfigParamName {
     MBC_BAND_INSTANCE_NAME,
     MBC_BAND_CHANNEL,
-    MBC_BAND_ENABLE,
     MBC_BAND_CUTOFF_FREQ,
     MBC_BAND_ADDITIONAL
 };
@@ -877,7 +1048,7 @@
          {3, 10, 2, -2, -5, 90, 2.5, 2, 2}}};
 
 using TestParamsMbcBandConfig =
-        std::tuple<std::pair<std::shared_ptr<IFactory>, Descriptor>, int32_t, bool,
+        std::tuple<std::pair<std::shared_ptr<IFactory>, Descriptor>, int32_t,
                    std::vector<std::pair<int, float>>, TestParamsMbcBandConfigAdditional>;
 
 void fillMbcBandConfig(std::vector<DynamicsProcessing::MbcBandConfig>& cfgs,
@@ -890,7 +1061,7 @@
         cfgs[i] = DynamicsProcessing::MbcBandConfig{
                 .channel = std::get<MBC_BAND_CHANNEL>(params),
                 .band = cutOffFreqs[i].first,
-                .enable = std::get<MBC_BAND_ENABLE>(params),
+                .enable = true /*Mbc Band Enable*/,
                 .cutoffFrequencyHz = cutOffFreqs[i].second,
                 .attackTimeMs = additional[MBC_ADD_ATTACK_TIME],
                 .releaseTimeMs = additional[MBC_ADD_RELEASE_TIME],
@@ -930,16 +1101,15 @@
     }
     EXPECT_NO_FATAL_FAILURE(addMbcChannelConfig(cfgs));
     EXPECT_NO_FATAL_FAILURE(addMbcBandConfigs(mCfgs));
-    SetAndGetDynamicsProcessingParameters();
+    ASSERT_NO_FATAL_FAILURE(SetAndGetDynamicsProcessingParameters());
 }
 
 INSTANTIATE_TEST_SUITE_P(
         DynamicsProcessingTest, DynamicsProcessingTestMbcBandConfig,
         ::testing::Combine(testing::ValuesIn(EffectFactoryHelper::getAllEffectDescriptors(
                                    IFactory::descriptor, getEffectTypeUuidDynamicsProcessing())),
-                           testing::Values(-1, 0, 10),  // channel count
-                           testing::Bool(),             // enable
-                           testing::ValuesIn(kBands),   // cut off frequencies
+                           testing::Values(-1, 0, 10),  // channel index
+                           testing::ValuesIn(kBands),   // band index, cut off frequencies
                            testing::ValuesIn(kMbcBandConfigAdditionalParam)),  // Additional
         [](const auto& info) {
             auto descriptor = std::get<MBC_BAND_INSTANCE_NAME>(info.param).second;
diff --git a/common/aidl/Android.bp b/common/aidl/Android.bp
index 904a3d9..0ce52e7 100644
--- a/common/aidl/Android.bp
+++ b/common/aidl/Android.bp
@@ -26,7 +26,7 @@
             ],
         },
         cpp: {
-            enabled: false,
+            enabled: true,
         },
         ndk: {
             apex_available: [
diff --git a/common/fmq/aidl/Android.bp b/common/fmq/aidl/Android.bp
index 4a3658e..7fb6368 100644
--- a/common/fmq/aidl/Android.bp
+++ b/common/fmq/aidl/Android.bp
@@ -28,9 +28,8 @@
             sdk_version: "module_current",
         },
         cpp: {
-            // FMQ will not be supported in the cpp backend because the parcelables
-            // are not stable enough for use in shared memory
-            enabled: false,
+            // FMQ is only supported for PODs with the cpp backend
+            enabled: true,
         },
         ndk: {
             apex_available: [
diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/GalileoAlmanac.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/GalileoAlmanac.aidl
deleted file mode 100644
index ffe2c3f..0000000
--- a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/GalileoAlmanac.aidl
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Copyright (C) 2024 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.gnss.gnss_assistance;
-/* @hide */
-@VintfStability
-parcelable GalileoAlmanac {
-  long issueDate;
-  int weekNumber;
-  int toa;
-  int iod;
-  android.hardware.gnss.gnss_assistance.GalileoAlmanac.GalileoSatelliteAlmanac[] satelliteAlmanac;
-  @VintfStability
-  parcelable GalileoSatelliteAlmanac {
-    int svId;
-    android.hardware.gnss.gnss_assistance.GalileoAlmanac.GalileoAlmanacSvHealth svHealth;
-    double eccentricity;
-    double deltaI;
-    double omega;
-    double omega0;
-    double omegaDot;
-    double rootA;
-    double m0;
-    double af0;
-    double af1;
-    int weekNumber;
-    int toa;
-    int iod;
-  }
-  @VintfStability
-  parcelable GalileoAlmanacSvHealth {
-    int fNavE5a;
-    int iNavE5b;
-    int iNavE1b;
-  }
-}
diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/QzssAlmanac.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/GnssAlmanac.aidl
similarity index 90%
rename from gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/QzssAlmanac.aidl
rename to gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/GnssAlmanac.aidl
index 6c645a6..b986be4 100644
--- a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/QzssAlmanac.aidl
+++ b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/GnssAlmanac.aidl
@@ -34,13 +34,15 @@
 package android.hardware.gnss.gnss_assistance;
 /* @hide */
 @VintfStability
-parcelable QzssAlmanac {
-  int qzssWeekNumber;
-  int secondsOfQzssWeek;
-  android.hardware.gnss.gnss_assistance.QzssAlmanac.QzssSatelliteAlmanac[] satelliteAlmanac;
+parcelable GnssAlmanac {
+  long issueDateMs;
+  int iod;
+  int weekNumber;
+  int toaSeconds;
+  android.hardware.gnss.gnss_assistance.GnssAlmanac.GnssSatelliteAlmanac[] satelliteAlmanac;
   @VintfStability
-  parcelable QzssSatelliteAlmanac {
-    int prn;
+  parcelable GnssSatelliteAlmanac {
+    int svid;
     int svHealth;
     double eccentricity;
     double inclination;
diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/GnssAssistance.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/GnssAssistance.aidl
index 98383ac..5f8fee7 100644
--- a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/GnssAssistance.aidl
+++ b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/GnssAssistance.aidl
@@ -36,10 +36,10 @@
 @VintfStability
 parcelable GnssAssistance {
   android.hardware.gnss.gnss_assistance.GnssAssistance.GpsAssistance gpsAssistance;
-  android.hardware.gnss.gnss_assistance.GnssAssistance.GlonassAssistance gloAssistance;
-  android.hardware.gnss.gnss_assistance.GnssAssistance.GalileoAssistance galAssistance;
-  android.hardware.gnss.gnss_assistance.GnssAssistance.BeidouAssistance bdsAssistance;
-  android.hardware.gnss.gnss_assistance.GnssAssistance.QzssAssistance qzsAssistance;
+  android.hardware.gnss.gnss_assistance.GnssAssistance.GlonassAssistance glonassAssistance;
+  android.hardware.gnss.gnss_assistance.GnssAssistance.GalileoAssistance galileoAssistance;
+  android.hardware.gnss.gnss_assistance.GnssAssistance.BeidouAssistance beidouAssistance;
+  android.hardware.gnss.gnss_assistance.GnssAssistance.QzssAssistance qzssAssistance;
   @VintfStability
   parcelable GnssSatelliteCorrections {
     int svid;
@@ -47,7 +47,7 @@
   }
   @VintfStability
   parcelable GpsAssistance {
-    android.hardware.gnss.gnss_assistance.GpsAlmanac almanac;
+    android.hardware.gnss.gnss_assistance.GnssAlmanac almanac;
     android.hardware.gnss.gnss_assistance.KlobucharIonosphericModel ionosphericModel;
     android.hardware.gnss.gnss_assistance.UtcModel utcModel;
     android.hardware.gnss.gnss_assistance.LeapSecondsModel leapSecondsModel;
@@ -58,7 +58,7 @@
   }
   @VintfStability
   parcelable GalileoAssistance {
-    android.hardware.gnss.gnss_assistance.GalileoAlmanac almanac;
+    android.hardware.gnss.gnss_assistance.GnssAlmanac almanac;
     android.hardware.gnss.gnss_assistance.GalileoIonosphericModel ionosphericModel;
     android.hardware.gnss.gnss_assistance.UtcModel utcModel;
     android.hardware.gnss.gnss_assistance.LeapSecondsModel leapSecondsModel;
@@ -77,7 +77,7 @@
   }
   @VintfStability
   parcelable QzssAssistance {
-    android.hardware.gnss.gnss_assistance.QzssAlmanac almanac;
+    android.hardware.gnss.gnss_assistance.GnssAlmanac almanac;
     android.hardware.gnss.gnss_assistance.KlobucharIonosphericModel ionosphericModel;
     android.hardware.gnss.gnss_assistance.UtcModel utcModel;
     android.hardware.gnss.gnss_assistance.LeapSecondsModel leapSecondsModel;
@@ -88,7 +88,7 @@
   }
   @VintfStability
   parcelable BeidouAssistance {
-    android.hardware.gnss.gnss_assistance.BeidouAlmanac almanac;
+    android.hardware.gnss.gnss_assistance.GnssAlmanac almanac;
     android.hardware.gnss.gnss_assistance.KlobucharIonosphericModel ionosphericModel;
     android.hardware.gnss.gnss_assistance.UtcModel utcModel;
     android.hardware.gnss.gnss_assistance.LeapSecondsModel leapSecondsModel;
diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/GpsAlmanac.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/GpsAlmanac.aidl
deleted file mode 100644
index 60e0b96..0000000
--- a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/GpsAlmanac.aidl
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright (C) 2024 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.gnss.gnss_assistance;
-/* @hide */
-@VintfStability
-parcelable GpsAlmanac {
-  int gpsWeekNumber;
-  int secondsOfGpsWeek;
-  android.hardware.gnss.gnss_assistance.GpsAlmanac.GpsSatelliteAlmanac[] satelliteAlmanac;
-  @VintfStability
-  parcelable GpsSatelliteAlmanac {
-    int prn;
-    int svHealth;
-    double eccentricity;
-    double inclination;
-    double omega;
-    double omega0;
-    double omegaDot;
-    double rootA;
-    double m0;
-    double af0;
-    double af1;
-  }
-}
diff --git a/gnss/aidl/android/hardware/gnss/gnss_assistance/BeidouAlmanac.aidl b/gnss/aidl/android/hardware/gnss/gnss_assistance/BeidouAlmanac.aidl
deleted file mode 100644
index 1df485e..0000000
--- a/gnss/aidl/android/hardware/gnss/gnss_assistance/BeidouAlmanac.aidl
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Copyright (C) 2024 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.gnss.gnss_assistance;
-
-/**
- * Contains Beidou almanac data.
- * This is defined in BDS-SIS-ICD-B1I-3.0, section 5.2.4.15.
- *
- * @hide
- */
-@VintfStability
-parcelable BeidouAlmanac {
-    /**
-     * Contains Beidou satellite almanac data.
-     * This is defined in BDS-SIS-ICD-B1I-3.0, section 5.2.4.15.
-     */
-    @VintfStability
-    parcelable BeidouSatelliteAlmanac {
-        /** The PRN number of the Beidou satellite. */
-        int prn;
-
-        /** Satellite health (0=healthy, 1=unhealthy). */
-        int svHealth;
-
-        /** Almanac reference time in seconds. */
-        int toaSeconds;
-
-        /** Eccentricity. */
-        double eccentricity;
-
-        /**
-         * Correction of inclination angle relative to reference value at reference time
-         * in semi-circles.
-         */
-        double deltaI;
-
-        /** Argument of perigee in semi-circles. */
-        double omega;
-
-        /** Longitude of ascending node of orbital plane at weekly epoch in semi-circles. */
-        double omega0;
-
-        /** Rate of right ascension in semi-circles per second. */
-        double omegaDot;
-
-        /** Square root of semi-major axis in square root of meters. */
-        double rootA;
-
-        /** Mean anomaly at reference time in semi-circles. */
-        double m0;
-
-        /** Satellite clock time bias correction coefficient in seconds. */
-        double af0;
-
-        /** Satellite clock time drift correction coefficient in seconds per second. */
-        double af1;
-    }
-
-    /** Beidou week number. */
-    int beidouWeekNumber;
-
-    /** Array of BeidouSatelliteAlmanac. */
-    BeidouSatelliteAlmanac[] satelliteAlmanac;
-}
diff --git a/gnss/aidl/android/hardware/gnss/gnss_assistance/BeidouSatelliteEphemeris.aidl b/gnss/aidl/android/hardware/gnss/gnss_assistance/BeidouSatelliteEphemeris.aidl
index 025f402..48398ef 100644
--- a/gnss/aidl/android/hardware/gnss/gnss_assistance/BeidouSatelliteEphemeris.aidl
+++ b/gnss/aidl/android/hardware/gnss/gnss_assistance/BeidouSatelliteEphemeris.aidl
@@ -67,7 +67,7 @@
          */
         int aode;
 
-        /** Beidou week number. */
+        /** Beidou week number without rollover. */
         int weekNumber;
 
         /**
diff --git a/gnss/aidl/android/hardware/gnss/gnss_assistance/GalileoAlmanac.aidl b/gnss/aidl/android/hardware/gnss/gnss_assistance/GalileoAlmanac.aidl
deleted file mode 100644
index db5dd04..0000000
--- a/gnss/aidl/android/hardware/gnss/gnss_assistance/GalileoAlmanac.aidl
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
- * Copyright (C) 2024 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.gnss.gnss_assistance;
-
-/**
- * Contains Galileo almanac data.
- * This is defined in Galileo-OS-SIS-ICD-v2.1, 5.1.10.
- *
- * @hide
- */
-@VintfStability
-parcelable GalileoAlmanac {
-    /**
-     * Contains Galileo satellite almanac data.
-     * This is defined in Galileo-OS-SIS-ICD-v2.1, 5.1.10.
-     */
-    @VintfStability
-    parcelable GalileoSatelliteAlmanac {
-        /** Satellite ID. */
-        int svId;
-
-        /** Satellite health status. */
-        GalileoAlmanacSvHealth svHealth;
-
-        /** Eccentricity. */
-        double eccentricity;
-
-        /**
-         * Difference between the inclination angle at reference time and the
-         * nominal inclination, in semi-circles.
-         */
-        double deltaI;
-
-        /** Argument of perigee in semi-circles. */
-        double omega;
-
-        /** Longitude of ascending node of orbital plane at weekly epoch in semi-circles. */
-        double omega0;
-
-        /** Rate of right ascension in semi-circles per second. */
-        double omegaDot;
-
-        /**
-         * Difference with respect to the square root of the nominal semi-major axis
-         * in square root of meters.
-         */
-        double rootA;
-
-        /** Satellite mean anomaly at reference time in semi-circles. */
-        double m0;
-
-        /** Satellite clock correction bias in seconds. */
-        double af0;
-
-        /** Satellite clock correction linear in seconds per second. */
-        double af1;
-
-        /**
-         * Almanac reference week number.
-         * Modulo 4 representation of the Galileo system time week number.
-         */
-        int weekNumber;
-
-        /** Almanac reference time in seconds. */
-        int toa;
-
-        /** Almanac issue of data. */
-        int iod;
-    }
-
-    /**
-     * Contains Galileo satellite health status.
-     */
-    @VintfStability
-    parcelable GalileoAlmanacSvHealth {
-        /** Satellite E5a signal health status. */
-        int fNavE5a;
-
-        /** Satellite E5b signal health status. */
-        int iNavE5b;
-
-        /** Satellite E1b signal health status. */
-        int iNavE1b;
-    }
-
-    /** Almanac reference UTC time in milliseconds */
-    long issueDate;
-
-    /**
-     * Almanac reference week number.
-     * Modulo 4 representation of the Galileo system time week number.
-     */
-    int weekNumber;
-
-    /** Almanac reference time in seconds. */
-    int toa;
-
-    /** Almanac issue of data. */
-    int iod;
-
-    /** Array of GalileoSatelliteAlmanac. */
-    GalileoSatelliteAlmanac[] satelliteAlmanac;
-}
diff --git a/gnss/aidl/android/hardware/gnss/gnss_assistance/GnssAlmanac.aidl b/gnss/aidl/android/hardware/gnss/gnss_assistance/GnssAlmanac.aidl
new file mode 100644
index 0000000..e4f4bc8
--- /dev/null
+++ b/gnss/aidl/android/hardware/gnss/gnss_assistance/GnssAlmanac.aidl
@@ -0,0 +1,128 @@
+/*
+ * Copyright (C) 2024 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.gnss.gnss_assistance;
+
+/**
+ * Contains almanac parameters for GPS, QZSS, Galileo, Beidou.
+ *
+ * For Beidou, this is defined in BDS-SIS-ICD-B1I-3.0 section 5.2.4.15.
+ * For GPS, this is defined in IS-GPS-200 section 20.3.3.5.1.2.
+ * For QZSS, this is defined in IS-QZSS-PNT section 4.1.2.6.
+ * For Galileo, this is defined in Galileo-OS-SIS-ICD-v2.1 section 5.1.10.
+ *
+ * @hide
+ */
+@VintfStability
+parcelable GnssAlmanac {
+    /**
+     * Almanac issue date in milliseconds since the Unix epoch.
+     *
+     * This is unused for GPS/QZSS/Baidou.
+     */
+    long issueDateMs;
+
+    /**
+     * Almanac issue of data.
+     * This is defined Galileo-OS-SIS-ICD-v2.1 section 5.1.10.
+     * This is unused for GPS/QZSS/Baidou.
+     */
+    int iod;
+
+    /**
+     * Almanac reference week number.
+     *
+     * For GPS and QZSS, this is GPS week number (modulo 1024).
+     * For Beidou, this is Baidou week number (modulo 8192).
+     * For Galileo, this is modulo 4 representation of the Galileo week number.
+     */
+    int weekNumber;
+
+    /** Almanac reference time in seconds. */
+    int toaSeconds;
+
+    /**
+     * Contains almanac parameters for GPS, QZSS, Galileo, Beidou.
+     *
+     * For Beidou, this is defined in BDS-SIS-ICD-B1I-3.0 section 5.2.4.15.
+     * For GPS, this is defined in IS-GPS-200 section 20.3.3.5.1.2.
+     * For QZSS, this is defined in IS-QZSS-PNT section 4.1.2.6.
+     * For Galileo, this is defined in Galileo-OS-SIS-ICD-v2.1 section 5.1.10.
+     */
+    @VintfStability
+    parcelable GnssSatelliteAlmanac {
+        /** The PRN number of the GNSS satellite. */
+        int svid;
+
+        /**
+         * Satellite health information.
+         *
+         * For GPS, this is satellite subframe 4 and 5, page 25 6-bit health code as defined in
+         * IS-GPS-200 Table 20-VIII expressed in integer form.
+         *
+         * For QZSS, this is the 5-bit health code as defined in IS-QZSS-PNT, Table 4.1.2-5-2
+         * expressed in integer form.
+         *
+         * For Beidou, this is 1-bit health information. (0=healthy, 1=unhealthy).
+         *
+         * For Galileo, this is 6-bit health, bit 0 and 1 is for E5a, bit 2 and 3 is for E5b, bit
+         * 4 and 5 is for E1b.
+         */
+        int svHealth;
+
+        /** Eccentricity. */
+        double eccentricity;
+
+        /**
+         * Inclination in semi-circles.
+         *
+         * For GPS and Galileo, this is the difference between the inclination angle at reference
+         * time and the nominal inclination in semi-circles.
+         *
+         * For Beidou and QZSS, this is the inclination angle at reference time in semi-circles.
+         */
+        double inclination;
+
+        /** Argument of perigee in semi-circles. */
+        double omega;
+
+        /** Longitude of ascending node of orbital plane at weekly epoch in semi-circles. */
+        double omega0;
+
+        /** Rate of right ascension in semi-circles per second. */
+        double omegaDot;
+
+        /**
+         * Square root of semi-major axis in square root of meters.
+         *
+         * For Galileo, this is the difference with respect to the square root of the nominal
+         * semi-major axis in square root of meters.
+         */
+        double rootA;
+
+        /** Mean anomaly at reference time in semi-circles. */
+        double m0;
+
+        /** Satellite clock time bias correction coefficient in seconds. */
+        double af0;
+
+        /** Satellite clock time drift correction coefficient in seconds per second. */
+        double af1;
+    }
+
+    /** Array of GnssSatelliteAlmanac. */
+    GnssSatelliteAlmanac[] satelliteAlmanac;
+}
diff --git a/gnss/aidl/android/hardware/gnss/gnss_assistance/GnssAssistance.aidl b/gnss/aidl/android/hardware/gnss/gnss_assistance/GnssAssistance.aidl
index dad0764..ddff848 100644
--- a/gnss/aidl/android/hardware/gnss/gnss_assistance/GnssAssistance.aidl
+++ b/gnss/aidl/android/hardware/gnss/gnss_assistance/GnssAssistance.aidl
@@ -16,19 +16,16 @@
 
 package android.hardware.gnss.gnss_assistance;
 
-import android.hardware.gnss.gnss_assistance.BeidouAlmanac;
 import android.hardware.gnss.gnss_assistance.BeidouSatelliteEphemeris;
-import android.hardware.gnss.gnss_assistance.GalileoAlmanac;
 import android.hardware.gnss.gnss_assistance.GalileoIonosphericModel;
 import android.hardware.gnss.gnss_assistance.GalileoSatelliteEphemeris;
 import android.hardware.gnss.gnss_assistance.GlonassAlmanac;
 import android.hardware.gnss.gnss_assistance.GlonassSatelliteEphemeris;
-import android.hardware.gnss.gnss_assistance.GpsAlmanac;
+import android.hardware.gnss.gnss_assistance.GnssAlmanac;
 import android.hardware.gnss.gnss_assistance.GpsSatelliteEphemeris;
 import android.hardware.gnss.gnss_assistance.IonosphericCorrection;
 import android.hardware.gnss.gnss_assistance.KlobucharIonosphericModel;
 import android.hardware.gnss.gnss_assistance.LeapSecondsModel;
-import android.hardware.gnss.gnss_assistance.QzssAlmanac;
 import android.hardware.gnss.gnss_assistance.QzssSatelliteEphemeris;
 import android.hardware.gnss.gnss_assistance.RealTimeIntegrityModel;
 import android.hardware.gnss.gnss_assistance.TimeModel;
@@ -65,7 +62,7 @@
     @VintfStability
     parcelable GpsAssistance {
         /** The GPS almanac. */
-        GpsAlmanac almanac;
+        GnssAlmanac almanac;
 
         /** The Klobuchar ionospheric model. */
         KlobucharIonosphericModel ionosphericModel;
@@ -93,7 +90,7 @@
     @VintfStability
     parcelable GalileoAssistance {
         /** The Galileo almanac. */
-        GalileoAlmanac almanac;
+        GnssAlmanac almanac;
 
         /** The Galileo ionospheric model. */
         GalileoIonosphericModel ionosphericModel;
@@ -140,7 +137,7 @@
     @VintfStability
     parcelable QzssAssistance {
         /** The QZSS almanac. */
-        QzssAlmanac almanac;
+        GnssAlmanac almanac;
 
         /** The Klobuchar ionospheric model. */
         KlobucharIonosphericModel ionosphericModel;
@@ -168,7 +165,7 @@
     @VintfStability
     parcelable BeidouAssistance {
         /** The Beidou almanac. */
-        BeidouAlmanac almanac;
+        GnssAlmanac almanac;
 
         /** The Klobuchar ionospheric model. */
         KlobucharIonosphericModel ionosphericModel;
@@ -196,14 +193,14 @@
     GpsAssistance gpsAssistance;
 
     /** Glonass assistance. */
-    GlonassAssistance gloAssistance;
+    GlonassAssistance glonassAssistance;
 
     /** Galileo assistance. */
-    GalileoAssistance galAssistance;
+    GalileoAssistance galileoAssistance;
 
     /** Beidou assistance. */
-    BeidouAssistance bdsAssistance;
+    BeidouAssistance beidouAssistance;
 
     /** QZSS assistance. */
-    QzssAssistance qzsAssistance;
+    QzssAssistance qzssAssistance;
 }
diff --git a/gnss/aidl/android/hardware/gnss/gnss_assistance/GpsAlmanac.aidl b/gnss/aidl/android/hardware/gnss/gnss_assistance/GpsAlmanac.aidl
deleted file mode 100644
index 9cc37f9..0000000
--- a/gnss/aidl/android/hardware/gnss/gnss_assistance/GpsAlmanac.aidl
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * Copyright (C) 2024 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.gnss.gnss_assistance;
-
-/**
- * Contains GPS almanac data.
- * This is defined in IS-GPS-200, section 20.3.3.5.1.2.
- *
- * @hide
- */
-@VintfStability
-parcelable GpsAlmanac {
-    /** GPS week number. */
-    int gpsWeekNumber;
-
-    /** GPS time of week in seconds. */
-    int secondsOfGpsWeek;
-
-    /**
-     * Contains GPS satellite almanac data.
-     * This is defined in IS-GPS-200, section 20.3.3.5.1.2.
-     */
-    @VintfStability
-    parcelable GpsSatelliteAlmanac {
-        /** The PRN number of the GPS satellite. */
-        int prn;
-
-        /**
-         * Satellite health information.
-         * The satellite subframe 4 and 5, page 25 six-bit health code as defined
-         * in IS-GPS-200 Table 20-VIII expressed in integer form.
-         */
-        int svHealth;
-
-        /** Eccentricity. */
-        double eccentricity;
-
-        /**
-         * Correction of inclination angle relative to reference value at
-         * reference time in semi-circles.
-         */
-        double inclination;
-
-        /** Argument of perigee in semi-circles. */
-        double omega;
-
-        /** Longitude of ascending node of orbital plane at weekly epoch in semi-circles. */
-        double omega0;
-
-        /** Rate of right ascension in semi-circles per second. */
-        double omegaDot;
-
-        /** Square root of semi-major axis in square root of meters. */
-        double rootA;
-
-        /** Mean anomaly at reference time in semi-circles. */
-        double m0;
-
-        /** Satellite clock time bias correction coefficient in seconds. */
-        double af0;
-
-        /** Satellite clock time drift correction coefficient in seconds per second. */
-        double af1;
-    }
-
-    /** Array of GpsSatelliteAlmanac. */
-    GpsSatelliteAlmanac[] satelliteAlmanac;
-}
diff --git a/gnss/aidl/android/hardware/gnss/gnss_assistance/KeplerianOrbitModel.aidl b/gnss/aidl/android/hardware/gnss/gnss_assistance/KeplerianOrbitModel.aidl
index 15003e7..441b61d 100644
--- a/gnss/aidl/android/hardware/gnss/gnss_assistance/KeplerianOrbitModel.aidl
+++ b/gnss/aidl/android/hardware/gnss/gnss_assistance/KeplerianOrbitModel.aidl
@@ -33,25 +33,25 @@
     /** Eccentricity. */
     double eccentricity;
 
-    /** Inclination angle at reference time in semi-circles. */
+    /** Inclination angle at reference time in radians. */
     double i0;
 
-    /** Rate of change of inclination angle in semi-circles per second. */
+    /** Rate of change of inclination angle in radians per second. */
     double iDot;
 
-    /** Argument of perigee in semi-circles. */
+    /** Argument of perigee in radians. */
     double omega;
 
-    /** Longitude of ascending node of orbit plane at beginning of week in semi-circles. */
+    /** Longitude of ascending node of orbit plane at beginning of week in radians. */
     double omega0;
 
-    /** Rate of right ascension in semi-circles per second. */
+    /** Rate of right ascension in radians per second. */
     double omegaDot;
 
-    /** Mean anomaly at reference time in semi-circles. */
+    /** Mean anomaly at reference time in radians. */
     double m0;
 
-    /** Mean motion difference from computed value in semi-circles per second. */
+    /** Mean motion difference from computed value in radians per second. */
     double deltaN;
 
     /**
diff --git a/gnss/aidl/android/hardware/gnss/gnss_assistance/QzssAlmanac.aidl b/gnss/aidl/android/hardware/gnss/gnss_assistance/QzssAlmanac.aidl
deleted file mode 100644
index 80ace39..0000000
--- a/gnss/aidl/android/hardware/gnss/gnss_assistance/QzssAlmanac.aidl
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * Copyright (C) 2024 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.gnss.gnss_assistance;
-
-/**
- * Contains QZSS almanac data.
- * This is defined in IS-QZSS-PNT, section 4.1.2.6.
- *
- * @hide
- */
-@VintfStability
-parcelable QzssAlmanac {
-    /** QZSS week number. */
-    int qzssWeekNumber;
-
-    /** QZSS time of week in seconds. */
-    int secondsOfQzssWeek;
-
-    /**
-     * Contains QZSS satellite almanac data.
-     * This is defined in IS-QZSS-PNT, section 4.1.2.6.
-     */
-    @VintfStability
-    parcelable QzssSatelliteAlmanac {
-        /** The PRN number of the QZSS satellite. */
-        int prn;
-
-        /**
-         * Satellite health information.
-         * This is the 5-bit health code as defined in IS-QZSS-PNT, Table 4.1.2-5-2
-         * expressed in integer form.
-         */
-        int svHealth;
-
-        /** Eccentricity. */
-        double eccentricity;
-
-        /**
-         * Correction of inclination angle relative to reference value at
-         * reference time in semi-circles.
-         */
-        double inclination;
-
-        /** Argument of perigee in semi-circles. */
-        double omega;
-
-        /** Longitude of ascending node of orbital plane at weekly epoch in semi-circles. */
-        double omega0;
-
-        /** Rate of right ascension in semi-circles per second. */
-        double omegaDot;
-
-        /** Square root of semi-major axis in square root of meters. */
-        double rootA;
-
-        /** Mean anomaly at reference time in semi-circles. */
-        double m0;
-
-        /** Satellite clock time bias correction coefficient in seconds. */
-        double af0;
-
-        /** Satellite clock time drift correction coefficient in seconds per second. */
-        double af1;
-    }
-
-    /** Array of QzssSatelliteAlmanac. */
-    QzssSatelliteAlmanac[] satelliteAlmanac;
-}
diff --git a/gnss/aidl/android/hardware/gnss/gnss_assistance/SatelliteEphemerisTime.aidl b/gnss/aidl/android/hardware/gnss/gnss_assistance/SatelliteEphemerisTime.aidl
index 2d9b3e6..8849401 100644
--- a/gnss/aidl/android/hardware/gnss/gnss_assistance/SatelliteEphemerisTime.aidl
+++ b/gnss/aidl/android/hardware/gnss/gnss_assistance/SatelliteEphemerisTime.aidl
@@ -28,7 +28,7 @@
     /** The issue of ephemeris data. */
     int iode;
 
-    /** The satellite week number. */
+    /** The satellite week number without rollover. */
     int weekNumber;
 
     /** The broadcast time of ephemeris in GNSS time of week in seconds. */
diff --git a/graphics/common/aidl/android/hardware/graphics/common/DisplayHotplugEvent.aidl b/graphics/common/aidl/android/hardware/graphics/common/DisplayHotplugEvent.aidl
index c807ffd..f779105 100644
--- a/graphics/common/aidl/android/hardware/graphics/common/DisplayHotplugEvent.aidl
+++ b/graphics/common/aidl/android/hardware/graphics/common/DisplayHotplugEvent.aidl
@@ -23,23 +23,23 @@
 @Backing(type="int")
 enum DisplayHotplugEvent {
     /**
-     * Display is successfully connected.
-     * Connected may be called more than once and the behavior of subsequent
-     * calls is that SurfaceFlinger queries the display properties again.
+     * Display was successfully connected.
+     * CONNECTED may be emitted more than once and the behavior of subsequent
+     * events is that SurfaceFlinger queries the display properties again.
      */
     CONNECTED = 0,
 
-    /** Display is successfully disconnected */
+    /** Display was successfully disconnected */
     DISCONNECTED = 1,
 
-    /** Display is plugged in, but an unknown error occurred */
+    /** Unknown error occurred */
     ERROR_UNKNOWN = -1,
 
-    /** Display is plugged in, but incompatible cable error detected */
+    /** Display was plugged in, but incompatible cable error detected */
     ERROR_INCOMPATIBLE_CABLE = -2,
 
     /**
-     * Display is plugged in, but exceeds the max number of
+     * Display was plugged in, but exceeds the max number of
      * displays that can be simultaneously connected
      */
     ERROR_TOO_MANY_DISPLAYS = -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 55604a6..adbc344 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
@@ -88,6 +88,7 @@
   android.hardware.graphics.composer3.DisplayConfiguration[] getDisplayConfigurations(long display, int maxFrameIntervalNs);
   oneway void notifyExpectedPresent(long display, in android.hardware.graphics.composer3.ClockMonotonicTimestamp expectedPresentTime, int frameIntervalNs);
   int getMaxLayerPictureProfiles(long display);
+  oneway void startHdcpNegotiation(long display, in android.hardware.drm.HdcpLevels levels);
   const int EX_BAD_CONFIG = 1;
   const int EX_BAD_DISPLAY = 2;
   const int EX_BAD_LAYER = 3;
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl
index edbb988..b4d2e7f 100644
--- a/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl
+++ b/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl
@@ -16,6 +16,7 @@
 
 package android.hardware.graphics.composer3;
 
+import android.hardware.drm.HdcpLevels;
 import android.hardware.graphics.common.DisplayDecorationSupport;
 import android.hardware.graphics.common.Hdr;
 import android.hardware.graphics.common.HdrConversionCapability;
@@ -938,4 +939,21 @@
      * pipeline, a value of zero should be returned here.
      */
     int getMaxLayerPictureProfiles(long display);
+
+    /**
+     * Supports HDCP lazy activation.
+     *
+     * When SurfaceFlinger detects secure layers, this method is called to instruct HWC side that
+     * HDCP negotiation process can be started.
+     *
+     * When HDCP is successfully started or failed to start, HWC reports the HDCP levels via
+     * IComposerCallback.onHdcpLevelsChanged().
+     *
+     * @param display is the display whose HDCP negotiation can be started.
+     * @param levels is the desired HDCP levels.
+     *
+     * @see IComposerCallback.onHdcpLevelsChanged
+     *
+     */
+    oneway void startHdcpNegotiation(long display, in HdcpLevels levels);
 }
diff --git a/graphics/composer/aidl/vts/Android.bp b/graphics/composer/aidl/vts/Android.bp
index 894ca52..61c2593 100644
--- a/graphics/composer/aidl/vts/Android.bp
+++ b/graphics/composer/aidl/vts/Android.bp
@@ -71,6 +71,7 @@
         "libarect",
         "libbase",
         "libfmq",
+        "libgmock",
         "libgtest",
         "libmath",
         "librenderengine",
diff --git a/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_TargetTest.cpp b/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_TargetTest.cpp
index 8006523..354e3e0 100644
--- a/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_TargetTest.cpp
+++ b/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_TargetTest.cpp
@@ -29,6 +29,7 @@
 #include <android/hardware/graphics/composer3/ComposerClientWriter.h>
 #include <binder/ProcessState.h>
 #include <cutils/ashmem.h>
+#include <gmock/gmock.h>
 #include <gtest/gtest.h>
 #include <ui/Fence.h>
 #include <ui/GraphicBuffer.h>
@@ -47,6 +48,8 @@
 #undef LOG_TAG
 #define LOG_TAG "VtsHalGraphicsComposer3_TargetTest"
 
+using testing::Ge;
+
 namespace aidl::android::hardware::graphics::composer3::vts {
 
 using namespace std::chrono_literals;
@@ -1265,6 +1268,16 @@
         EXPECT_TRUE(status.isOk());
         EXPECT_FALSE(displayConfigurations.empty());
 
+        const bool areAllModesARR =
+                std::all_of(displayConfigurations.cbegin(), displayConfigurations.cend(),
+                            [](const auto& config) { return config.vrrConfig.has_value(); });
+
+        const bool areAllModesMRR =
+                std::all_of(displayConfigurations.cbegin(), displayConfigurations.cend(),
+                            [](const auto& config) { return !config.vrrConfig.has_value(); });
+
+        EXPECT_TRUE(areAllModesARR || areAllModesMRR) << "Mixing MRR and ARR modes is not allowed";
+
         for (const auto& displayConfig : displayConfigurations) {
             EXPECT_NE(-1, displayConfig.width);
             EXPECT_NE(-1, displayConfig.height);
@@ -1399,14 +1412,6 @@
     }
 }
 
-TEST_P(GraphicsComposerAidlV3Test, GetMaxLayerPictureProfiles) {
-    for (const auto& display : mDisplays) {
-        const auto& [status, maxPorfiles] =
-                mComposerClient->getMaxLayerPictureProfiles(display.getDisplayId());
-        EXPECT_TRUE(status.isOk());
-    }
-}
-
 // Tests for Command.
 class GraphicsComposerAidlCommandTest : public GraphicsComposerAidlTest {
   protected:
@@ -3239,19 +3244,44 @@
     });
 }
 
-TEST_P(GraphicsComposerAidlCommandV3Test, getMaxLayerPictureProfiles_success) {
+class GraphicsComposerAidlCommandV4Test : public GraphicsComposerAidlCommandTest {
+  protected:
+    void SetUp() override {
+        GraphicsComposerAidlTest::SetUp();
+        if (getInterfaceVersion() <= 3) {
+            GTEST_SKIP() << "Device interface version is expected to be >= 4";
+        }
+    }
+};
+
+TEST_P(GraphicsComposerAidlCommandV4Test, getMaxLayerPictureProfiles_success) {
     for (auto& display : mDisplays) {
         int64_t displayId = display.getDisplayId();
         if (!hasDisplayCapability(displayId, DisplayCapability::PICTURE_PROCESSING)) {
             continue;
         }
         const auto& [status, maxProfiles] =
-                mComposerClient->getMaxLayerPictureProfiles(getPrimaryDisplayId());
+                mComposerClient->getMaxLayerPictureProfiles(displayId);
         EXPECT_TRUE(status.isOk());
+        EXPECT_THAT(maxProfiles, Ge(0));
     }
 }
 
-TEST_P(GraphicsComposerAidlCommandV3Test, setDisplayPictureProfileId_success) {
+TEST_P(GraphicsComposerAidlCommandV4Test, getMaxLayerPictureProfiles_unsupported) {
+    for (auto& display : mDisplays) {
+        int64_t displayId = display.getDisplayId();
+        if (hasDisplayCapability(displayId, DisplayCapability::PICTURE_PROCESSING)) {
+            continue;
+        }
+        const auto& [status, maxProfiles] =
+                mComposerClient->getMaxLayerPictureProfiles(displayId);
+        EXPECT_FALSE(status.isOk());
+        EXPECT_NO_FATAL_FAILURE(
+                assertServiceSpecificError(status, IComposerClient::EX_UNSUPPORTED));
+    }
+}
+
+TEST_P(GraphicsComposerAidlCommandV4Test, setDisplayPictureProfileId_success) {
     for (auto& display : mDisplays) {
         int64_t displayId = display.getDisplayId();
         if (!hasDisplayCapability(displayId, DisplayCapability::PICTURE_PROCESSING)) {
@@ -3262,7 +3292,7 @@
         const auto layer = createOnScreenLayer(display);
         const auto buffer = allocate(::android::PIXEL_FORMAT_RGBA_8888);
         ASSERT_NE(nullptr, buffer->handle);
-        // TODO(b/337330263): Lookup profile IDs from PictureProfileService
+        // TODO(b/337330263): Lookup profile IDs from MediaQualityManager
         writer.setDisplayPictureProfileId(displayId, PictureProfileId(1));
         writer.setLayerBuffer(displayId, layer, /*slot*/ 0, buffer->handle,
                               /*acquireFence*/ -1);
@@ -3271,7 +3301,7 @@
     }
 }
 
-TEST_P(GraphicsComposerAidlCommandV3Test, setLayerPictureProfileId_success) {
+TEST_P(GraphicsComposerAidlCommandV4Test, setLayerPictureProfileId_success) {
     for (auto& display : mDisplays) {
         int64_t displayId = display.getDisplayId();
         if (!hasDisplayCapability(displayId, DisplayCapability::PICTURE_PROCESSING)) {
@@ -3289,14 +3319,14 @@
         ASSERT_NE(nullptr, buffer->handle);
         writer.setLayerBuffer(displayId, layer, /*slot*/ 0, buffer->handle,
                               /*acquireFence*/ -1);
-        // TODO(b/337330263): Lookup profile IDs from PictureProfileService
+        // TODO(b/337330263): Lookup profile IDs from MediaQualityManager
         writer.setLayerPictureProfileId(displayId, layer, PictureProfileId(1));
         execute();
         ASSERT_TRUE(mReader.takeErrors().empty());
     }
 }
 
-TEST_P(GraphicsComposerAidlCommandV3Test, setLayerPictureProfileId_failsWithTooManyProfiles) {
+TEST_P(GraphicsComposerAidlCommandV4Test, setLayerPictureProfileId_failsWithTooManyProfiles) {
     for (auto& display : mDisplays) {
         int64_t displayId = display.getDisplayId();
         if (!hasDisplayCapability(displayId, DisplayCapability::PICTURE_PROCESSING)) {
@@ -3315,7 +3345,7 @@
             ASSERT_NE(nullptr, buffer->handle);
             writer.setLayerBuffer(displayId, layer, /*slot*/ 0, buffer->handle,
                                   /*acquireFence*/ -1);
-            // TODO(b/337330263): Lookup profile IDs from PictureProfileService
+            // TODO(b/337330263): Lookup profile IDs from MediaQualityManager
             writer.setLayerPictureProfileId(displayId, layer, PictureProfileId(profileId));
         }
         execute();
@@ -3325,16 +3355,6 @@
     }
 }
 
-class GraphicsComposerAidlCommandV4Test : public GraphicsComposerAidlCommandTest {
-  protected:
-    void SetUp() override {
-        GraphicsComposerAidlTest::SetUp();
-        if (getInterfaceVersion() <= 3) {
-            GTEST_SKIP() << "Device interface version is expected to be >= 4";
-        }
-    }
-};
-
 TEST_P(GraphicsComposerAidlCommandV4Test, SetUnsupportedLayerLuts) {
     auto& writer = getWriter(getPrimaryDisplayId());
     const auto& [layerStatus, layer] =
diff --git a/power/aidl/aidl_api/android.hardware.power/current/android/hardware/power/CpuHeadroomParams.aidl b/power/aidl/aidl_api/android.hardware.power/current/android/hardware/power/CpuHeadroomParams.aidl
index 09a2ace..de92105 100644
--- a/power/aidl/aidl_api/android.hardware.power/current/android/hardware/power/CpuHeadroomParams.aidl
+++ b/power/aidl/aidl_api/android.hardware.power/current/android/hardware/power/CpuHeadroomParams.aidl
@@ -34,9 +34,10 @@
 package android.hardware.power;
 @JavaDerive(equals=true, toString=true) @VintfStability
 parcelable CpuHeadroomParams {
-  android.hardware.power.CpuHeadroomParams.CalculationType calculationType;
-  android.hardware.power.CpuHeadroomParams.SelectionType selectionType;
-  int pid;
+  android.hardware.power.CpuHeadroomParams.CalculationType calculationType = android.hardware.power.CpuHeadroomParams.CalculationType.MIN;
+  int calculationWindowMillis = 1000;
+  android.hardware.power.CpuHeadroomParams.SelectionType selectionType = android.hardware.power.CpuHeadroomParams.SelectionType.ALL;
+  int[] tids;
   enum CalculationType {
     MIN,
     AVERAGE,
diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/BeidouAlmanac.aidl b/power/aidl/aidl_api/android.hardware.power/current/android/hardware/power/CpuHeadroomResult.aidl
similarity index 76%
copy from gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/BeidouAlmanac.aidl
copy to power/aidl/aidl_api/android.hardware.power/current/android/hardware/power/CpuHeadroomResult.aidl
index f42e1d0..9303906 100644
--- a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/BeidouAlmanac.aidl
+++ b/power/aidl/aidl_api/android.hardware.power/current/android/hardware/power/CpuHeadroomResult.aidl
@@ -31,25 +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.gnss.gnss_assistance;
-/* @hide */
-@VintfStability
-parcelable BeidouAlmanac {
-  int beidouWeekNumber;
-  android.hardware.gnss.gnss_assistance.BeidouAlmanac.BeidouSatelliteAlmanac[] satelliteAlmanac;
-  @VintfStability
-  parcelable BeidouSatelliteAlmanac {
-    int prn;
-    int svHealth;
-    int toaSeconds;
-    double eccentricity;
-    double deltaI;
-    double omega;
-    double omega0;
-    double omegaDot;
-    double rootA;
-    double m0;
-    double af0;
-    double af1;
-  }
+package android.hardware.power;
+@JavaDerive(equals=true, toString=true) @VintfStability
+union CpuHeadroomResult {
+  float globalHeadroom;
+  float[] perCoreHeadroom;
 }
diff --git a/power/aidl/aidl_api/android.hardware.power/current/android/hardware/power/GpuHeadroomParams.aidl b/power/aidl/aidl_api/android.hardware.power/current/android/hardware/power/GpuHeadroomParams.aidl
index 64bb4a4..6faa938 100644
--- a/power/aidl/aidl_api/android.hardware.power/current/android/hardware/power/GpuHeadroomParams.aidl
+++ b/power/aidl/aidl_api/android.hardware.power/current/android/hardware/power/GpuHeadroomParams.aidl
@@ -34,7 +34,8 @@
 package android.hardware.power;
 @JavaDerive(equals=true, toString=true) @VintfStability
 parcelable GpuHeadroomParams {
-  android.hardware.power.GpuHeadroomParams.CalculationType calculationType;
+  android.hardware.power.GpuHeadroomParams.CalculationType calculationType = android.hardware.power.GpuHeadroomParams.CalculationType.MIN;
+  int calculationWindowMillis = 1000;
   enum CalculationType {
     MIN,
     AVERAGE,
diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/BeidouAlmanac.aidl b/power/aidl/aidl_api/android.hardware.power/current/android/hardware/power/GpuHeadroomResult.aidl
similarity index 76%
copy from gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/BeidouAlmanac.aidl
copy to power/aidl/aidl_api/android.hardware.power/current/android/hardware/power/GpuHeadroomResult.aidl
index f42e1d0..bbd3d8b 100644
--- a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/BeidouAlmanac.aidl
+++ b/power/aidl/aidl_api/android.hardware.power/current/android/hardware/power/GpuHeadroomResult.aidl
@@ -31,25 +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.gnss.gnss_assistance;
-/* @hide */
-@VintfStability
-parcelable BeidouAlmanac {
-  int beidouWeekNumber;
-  android.hardware.gnss.gnss_assistance.BeidouAlmanac.BeidouSatelliteAlmanac[] satelliteAlmanac;
-  @VintfStability
-  parcelable BeidouSatelliteAlmanac {
-    int prn;
-    int svHealth;
-    int toaSeconds;
-    double eccentricity;
-    double deltaI;
-    double omega;
-    double omega0;
-    double omegaDot;
-    double rootA;
-    double m0;
-    double af0;
-    double af1;
-  }
+package android.hardware.power;
+@JavaDerive(equals=true, toString=true) @VintfStability
+union GpuHeadroomResult {
+  float globalHeadroom;
 }
diff --git a/power/aidl/aidl_api/android.hardware.power/current/android/hardware/power/IPower.aidl b/power/aidl/aidl_api/android.hardware.power/current/android/hardware/power/IPower.aidl
index a855ddd..9d20ca1 100644
--- a/power/aidl/aidl_api/android.hardware.power/current/android/hardware/power/IPower.aidl
+++ b/power/aidl/aidl_api/android.hardware.power/current/android/hardware/power/IPower.aidl
@@ -44,8 +44,8 @@
   android.hardware.power.ChannelConfig getSessionChannel(in int tgid, in int uid);
   oneway void closeSessionChannel(in int tgid, in int uid);
   android.hardware.power.SupportInfo getSupportInfo();
-  float[] getCpuHeadroom(in android.hardware.power.CpuHeadroomParams params);
-  float getGpuHeadroom(in android.hardware.power.GpuHeadroomParams params);
+  android.hardware.power.CpuHeadroomResult getCpuHeadroom(in android.hardware.power.CpuHeadroomParams params);
+  android.hardware.power.GpuHeadroomResult getGpuHeadroom(in android.hardware.power.GpuHeadroomParams params);
   long getCpuHeadroomMinIntervalMillis();
   long getGpuHeadroomMinIntervalMillis();
   oneway void sendCompositionData(in android.hardware.power.CompositionData[] data);
diff --git a/power/aidl/android/hardware/power/CpuHeadroomParams.aidl b/power/aidl/android/hardware/power/CpuHeadroomParams.aidl
index cf71b67..64c7b44 100644
--- a/power/aidl/android/hardware/power/CpuHeadroomParams.aidl
+++ b/power/aidl/android/hardware/power/CpuHeadroomParams.aidl
@@ -32,7 +32,14 @@
     /**
      * The calculation type.
      */
-    CalculationType calculationType;
+    CalculationType calculationType = CalculationType.MIN;
+
+    /**
+     * The calculation rolling window size in milliseconds.
+     * The device should support a superset of [50, 10000] and try to use the closest feasible
+     * window size to the provided value param.
+     */
+    int calculationWindowMillis = 1000;
 
     /**
      * Defines how to select the CPU.
@@ -47,16 +54,17 @@
     /**
      * The CPU selection type.
      */
-    SelectionType selectionType;
+    SelectionType selectionType = SelectionType.ALL;
 
     /**
-     * The caller thread's PID.
+     * The thread TIDs to track.
      *
-     * If pid is positive, return the headroom only for cores that are available
-     * to the given pid, otherwise return the headroom(s) for all cores.
+     * If tids are not-empty, return the headrooms only for cores that are available
+     * to the given tids, otherwise return the headroom(s) for all cores.
      *
-     * This should handle all the cases including but not limited to thread core
-     * affinity and app cpuset that change the available CPU cores for the caller.
+     * This should handle all the cases including but not limited to core affinity and app cpuset
+     * that change the available CPU cores for the caller. And the HAL should check that the TIDs
+     * have the same core affinity.
      */
-    int pid;
+    int[] tids;
 }
diff --git a/power/aidl/android/hardware/power/CpuHeadroomResult.aidl b/power/aidl/android/hardware/power/CpuHeadroomResult.aidl
new file mode 100644
index 0000000..316d5f6
--- /dev/null
+++ b/power/aidl/android/hardware/power/CpuHeadroomResult.aidl
@@ -0,0 +1,36 @@
+/*
+ * Copyright (C) 2024 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.power;
+
+/**
+ * Headroom value result depending on the request params.
+ *
+ * Each value is ranged from [0, 100], where 0 indicates no CPU resources were left
+ * during the calculation interval and the app may expect low resources to be granted.
+ */
+@VintfStability
+@JavaDerive(equals=true, toString=true)
+union CpuHeadroomResult {
+    /**
+     * If ALL selection type is requested.
+     */
+    float globalHeadroom;
+    /**
+     * If PER_CORE selection type is requested.
+     */
+    float[] perCoreHeadroom;
+}
diff --git a/power/aidl/android/hardware/power/GpuHeadroomParams.aidl b/power/aidl/android/hardware/power/GpuHeadroomParams.aidl
index 972adbc..68848d8 100644
--- a/power/aidl/android/hardware/power/GpuHeadroomParams.aidl
+++ b/power/aidl/android/hardware/power/GpuHeadroomParams.aidl
@@ -32,5 +32,11 @@
     /**
      * The calculation type.
      */
-    CalculationType calculationType;
+    CalculationType calculationType = CalculationType.MIN;
+
+    /**
+     * The device should support a superset of [50, 10000] and try to use the closest feasible
+     * window size to the provided value param.
+     */
+    int calculationWindowMillis = 1000;
 }
diff --git a/power/aidl/android/hardware/power/GpuHeadroomResult.aidl b/power/aidl/android/hardware/power/GpuHeadroomResult.aidl
new file mode 100644
index 0000000..ef3257d
--- /dev/null
+++ b/power/aidl/android/hardware/power/GpuHeadroomResult.aidl
@@ -0,0 +1,29 @@
+/*
+ * Copyright (C) 2024 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.power;
+
+/**
+ * Headroom value result depending on the request params.
+ *
+ * Each value is ranged from [0, 100], where 0 indicates no GPU resources were left
+ * during the calculation interval and the app may expect low resources to be granted.
+ */
+@VintfStability
+@JavaDerive(equals=true, toString=true)
+union GpuHeadroomResult {
+    float globalHeadroom;
+}
diff --git a/power/aidl/android/hardware/power/IPower.aidl b/power/aidl/android/hardware/power/IPower.aidl
index db1d93f..41a9379 100644
--- a/power/aidl/android/hardware/power/IPower.aidl
+++ b/power/aidl/android/hardware/power/IPower.aidl
@@ -21,7 +21,9 @@
 import android.hardware.power.CompositionData;
 import android.hardware.power.CompositionUpdate;
 import android.hardware.power.CpuHeadroomParams;
+import android.hardware.power.CpuHeadroomResult;
 import android.hardware.power.GpuHeadroomParams;
+import android.hardware.power.GpuHeadroomResult;
 import android.hardware.power.IPowerHintSession;
 import android.hardware.power.Mode;
 import android.hardware.power.SessionConfig;
@@ -162,24 +164,21 @@
      * Provides an estimate of available CPU headroom the device based on past history.
      * <p>
      * @param params params to customize the CPU headroom calculation
-     * @return a single value or an array of values depending on selection type of params.
-     *         Each value is ranged from [0, 100], and 0 indicates no CPU resources were left
-     *         during the calculation interval and the app may expect low resources to be granted.
      * @throws EX_UNSUPPORTED_OPERATION if the API is unsupported or the request params can't be
      *         served.
+     * @throws EX_SECURITY if the TIDs passed in do not belong to the same process.
+     * @throws EX_ILLEGAL_STATE if the TIDs passed in do not have the same core affinity setting.
      */
-    float[] getCpuHeadroom(in CpuHeadroomParams params);
+    CpuHeadroomResult getCpuHeadroom(in CpuHeadroomParams params);
 
     /**
      * Provides an estimate of available GPU headroom the device based on past history.
      * <p>
      * @param params params to customize the GPU headroom calculation
-     * @return Value is ranged from [0, 100], and 0 indicates no GPU resources were left
-     *         during the calculation interval and the app may expect low resources to be granted.
      * @throws EX_UNSUPPORTED_OPERATION if the API is unsupported or the request params can't be
      *         served.
      */
-    float getGpuHeadroom(in GpuHeadroomParams params);
+    GpuHeadroomResult getGpuHeadroom(in GpuHeadroomParams params);
 
     /**
      * Minimum polling interval for calling getCpuHeadroom in milliseconds.
diff --git a/power/aidl/default/Power.cpp b/power/aidl/default/Power.cpp
index d9353fe..8490b62 100644
--- a/power/aidl/default/Power.cpp
+++ b/power/aidl/default/Power.cpp
@@ -71,14 +71,22 @@
     return ScopedAStatus::ok();
 }
 
-ndk::ScopedAStatus Power::getCpuHeadroom(const CpuHeadroomParams& _,
-                                         std::vector<float>* _aidl_return) {
-    *_aidl_return = {0.5f};
-    return ndk::ScopedAStatus::ok();
+ndk::ScopedAStatus Power::getCpuHeadroom(const CpuHeadroomParams& params,
+                                         CpuHeadroomResult* _aidl_return) {
+    if (params.selectionType == CpuHeadroomParams::SelectionType::ALL) {
+        _aidl_return->set<CpuHeadroomResult::globalHeadroom>(100.0f);
+        return ndk::ScopedAStatus::ok();
+    } else if (params.selectionType == CpuHeadroomParams::SelectionType::PER_CORE) {
+        std::vector<float> headroom = {50.0f, 100.0f};
+        _aidl_return->set<CpuHeadroomResult::perCoreHeadroom>(headroom);
+        return ndk::ScopedAStatus::ok();
+    }
+    return ndk::ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION);
 }
 
-ndk::ScopedAStatus Power::getGpuHeadroom(const GpuHeadroomParams& _, float* _aidl_return) {
-    *_aidl_return = 0.5f;
+ndk::ScopedAStatus Power::getGpuHeadroom(const GpuHeadroomParams& _,
+                                         GpuHeadroomResult* _aidl_return) {
+    _aidl_return->set<GpuHeadroomResult::globalHeadroom>(100.0f);
     return ndk::ScopedAStatus::ok();
 }
 
diff --git a/power/aidl/default/Power.h b/power/aidl/default/Power.h
index 51528c6..c4aa7ab 100644
--- a/power/aidl/default/Power.h
+++ b/power/aidl/default/Power.h
@@ -46,9 +46,10 @@
     ndk::ScopedAStatus closeSessionChannel(int32_t tgid, int32_t uid) override;
     ndk::ScopedAStatus getSupportInfo(SupportInfo* _aidl_return) override;
     ndk::ScopedAStatus getCpuHeadroom(const CpuHeadroomParams& params,
-                                      std::vector<float>* _aidl_return) override;
+                                      CpuHeadroomResult* _aidl_return) override;
+
     ndk::ScopedAStatus getGpuHeadroom(const GpuHeadroomParams& params,
-                                      float* _aidl_return) override;
+                                      GpuHeadroomResult* _aidl_return) override;
     ndk::ScopedAStatus getCpuHeadroomMinIntervalMillis(int64_t* _aidl_return) override;
     ndk::ScopedAStatus getGpuHeadroomMinIntervalMillis(int64_t* _aidl_return) override;
     ndk::ScopedAStatus sendCompositionData(const std::vector<CompositionData>& in_data) override;
diff --git a/power/aidl/vts/VtsHalPowerTargetTest.cpp b/power/aidl/vts/VtsHalPowerTargetTest.cpp
index 0df360a..ffe20c6 100644
--- a/power/aidl/vts/VtsHalPowerTargetTest.cpp
+++ b/power/aidl/vts/VtsHalPowerTargetTest.cpp
@@ -45,7 +45,9 @@
 using android::hardware::power::ChannelConfig;
 using android::hardware::power::ChannelMessage;
 using android::hardware::power::CpuHeadroomParams;
+using android::hardware::power::CpuHeadroomResult;
 using android::hardware::power::GpuHeadroomParams;
+using android::hardware::power::GpuHeadroomResult;
 using android::hardware::power::IPower;
 using android::hardware::power::IPowerHintSession;
 using android::hardware::power::Mode;
@@ -307,7 +309,7 @@
         GTEST_SKIP() << "DEVICE not launching with Power V6 and beyond.";
     }
     CpuHeadroomParams params;
-    std::vector<float> headroom;
+    CpuHeadroomResult headroom;
     auto ret = power->getCpuHeadroom(params, &headroom);
     if (ret.getExceptionCode() == EX_UNSUPPORTED_OPERATION) {
         GTEST_SKIP() << "power->getCpuHeadroom is not supported";
@@ -316,9 +318,9 @@
     int64_t minIntervalMillis;
     ASSERT_TRUE(power->getCpuHeadroomMinIntervalMillis(&minIntervalMillis).isOk());
     ASSERT_GE(minIntervalMillis, 0);
-    ASSERT_GE(headroom.size(), 1);
-    ASSERT_GE(headroom[0], 0.0f);
-    ASSERT_LE(headroom[0], 100.00f);
+    ASSERT_EQ(headroom.getTag(), CpuHeadroomResult::globalHeadroom);
+    ASSERT_GE(headroom.get<CpuHeadroomResult::globalHeadroom>(), 0.0f);
+    ASSERT_LE(headroom.get<CpuHeadroomResult::globalHeadroom>(), 100.00f);
 }
 
 TEST_P(PowerAidl, getGpuHeadroom) {
@@ -326,7 +328,7 @@
         GTEST_SKIP() << "DEVICE not launching with Power V6 and beyond.";
     }
     GpuHeadroomParams params;
-    float headroom;
+    GpuHeadroomResult headroom;
     auto ret = power->getGpuHeadroom(params, &headroom);
     if (ret.getExceptionCode() == EX_UNSUPPORTED_OPERATION) {
         GTEST_SKIP() << "power->getGpuHeadroom is not supported";
@@ -335,8 +337,9 @@
     int64_t minIntervalMillis;
     ASSERT_TRUE(power->getGpuHeadroomMinIntervalMillis(&minIntervalMillis).isOk());
     ASSERT_GE(minIntervalMillis, 0);
-    ASSERT_GE(headroom, 0.0f);
-    ASSERT_LE(headroom, 100.00f);
+    ASSERT_EQ(headroom.getTag(), GpuHeadroomResult::globalHeadroom);
+    ASSERT_GE(headroom.get<GpuHeadroomResult::globalHeadroom>(), 0.0f);
+    ASSERT_LE(headroom.get<GpuHeadroomResult::globalHeadroom>(), 100.00f);
 }
 
 // FIXED_PERFORMANCE mode is required for all devices which ship on Android 11
diff --git a/thermal/aidl/aidl_api/android.hardware.thermal/current/android/hardware/thermal/IThermal.aidl b/thermal/aidl/aidl_api/android.hardware.thermal/current/android/hardware/thermal/IThermal.aidl
index 904496c..3cff780 100644
--- a/thermal/aidl/aidl_api/android.hardware.thermal/current/android/hardware/thermal/IThermal.aidl
+++ b/thermal/aidl/aidl_api/android.hardware.thermal/current/android/hardware/thermal/IThermal.aidl
@@ -46,4 +46,5 @@
   void unregisterThermalChangedCallback(in android.hardware.thermal.IThermalChangedCallback callback);
   void registerCoolingDeviceChangedCallbackWithType(in android.hardware.thermal.ICoolingDeviceChangedCallback callback, in android.hardware.thermal.CoolingType type);
   void unregisterCoolingDeviceChangedCallback(in android.hardware.thermal.ICoolingDeviceChangedCallback callback);
+  float forecastSkinTemperature(in int forecastSeconds);
 }
diff --git a/thermal/aidl/android/hardware/thermal/IThermal.aidl b/thermal/aidl/android/hardware/thermal/IThermal.aidl
index 4aa4090..87f7637 100644
--- a/thermal/aidl/android/hardware/thermal/IThermal.aidl
+++ b/thermal/aidl/android/hardware/thermal/IThermal.aidl
@@ -225,4 +225,20 @@
      *         getMessage() must be populated with human-readable error message.
      */
     void unregisterCoolingDeviceChangedCallback(in ICoolingDeviceChangedCallback callback);
+
+    /**
+     * Retrieves the forecasted skin temperature in Celsius.
+     *
+     * @param forecastSeconds the number of seconds to forecast the skin temperature, it should
+     *                        at least support superset of [0, 60] seconds range.
+     *
+     * @return forecasted skin temperature in Celsius.
+     *
+     * @throws EX_ILLEGAL_STATE If the Thermal HAL is not initialized successfully
+     * @throws EX_ILLEGAL_ARGUMENT If the provided forecastSeconds is negative
+     * @throws EX_UNSUPPORTED_OPERATION if API is not supported or the forecastSeconds exceeds the
+     *         supported range. And the getMessage() must be populated with human-readable
+     *         error message.
+     */
+    float forecastSkinTemperature(in int forecastSeconds);
 }
diff --git a/thermal/aidl/default/Thermal.cpp b/thermal/aidl/default/Thermal.cpp
index 41d0be8..339e9b8 100644
--- a/thermal/aidl/default/Thermal.cpp
+++ b/thermal/aidl/default/Thermal.cpp
@@ -191,4 +191,9 @@
     }
     return ScopedAStatus::ok();
 }
+
+ndk::ScopedAStatus Thermal::forecastSkinTemperature(int32_t, float*) {
+    return ndk::ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION);
+}
+
 }  // namespace aidl::android::hardware::thermal::impl::example
diff --git a/thermal/aidl/default/Thermal.h b/thermal/aidl/default/Thermal.h
index d3d8874..a4d8b00 100644
--- a/thermal/aidl/default/Thermal.h
+++ b/thermal/aidl/default/Thermal.h
@@ -60,6 +60,8 @@
 
     ndk::ScopedAStatus unregisterCoolingDeviceChangedCallback(
             const std::shared_ptr<ICoolingDeviceChangedCallback>& in_callback) override;
+    ndk::ScopedAStatus forecastSkinTemperature(int32_t forecastSeconds,
+                                               float* _aidl_return) override;
 
   private:
     std::mutex thermal_callback_mutex_;
diff --git a/thermal/aidl/vts/VtsHalThermalTargetTest.cpp b/thermal/aidl/vts/VtsHalThermalTargetTest.cpp
index 066e773..17653b4 100644
--- a/thermal/aidl/vts/VtsHalThermalTargetTest.cpp
+++ b/thermal/aidl/vts/VtsHalThermalTargetTest.cpp
@@ -426,6 +426,23 @@
     }
 }
 
+// Test Thermal->forecastSkinTemperature.
+TEST_P(ThermalAidlTest, ForecastSkinTemperatureTest) {
+    auto apiLevel = ::android::base::GetIntProperty<int32_t>("ro.vendor.api_level", 0);
+    if (apiLevel < 202504) {
+        GTEST_SKIP() << "Skipping test as the vendor level is below 202504: " << apiLevel;
+    }
+    float temperature = 0.0f;
+    ::ndk::ScopedAStatus status = mThermal->forecastSkinTemperature(1, &temperature);
+    if (status.getExceptionCode() == EX_UNSUPPORTED_OPERATION) {
+        GTEST_SKIP() << "Skipping test as temperature forecast is not supported";
+    }
+    for (int i = 0; i <= 60; i++) {
+        status = mThermal->forecastSkinTemperature(i, &temperature);
+        ASSERT_NE(NAN, temperature);
+    }
+}
+
 GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(ThermalAidlTest);
 INSTANTIATE_TEST_SUITE_P(
         Thermal, ThermalAidlTest,
diff --git a/vibrator/aidl/android/hardware/vibrator/CompositePwleV2.aidl b/vibrator/aidl/android/hardware/vibrator/CompositePwleV2.aidl
index 9662ca0..f0d0970 100644
--- a/vibrator/aidl/android/hardware/vibrator/CompositePwleV2.aidl
+++ b/vibrator/aidl/android/hardware/vibrator/CompositePwleV2.aidl
@@ -21,7 +21,11 @@
 @VintfStability
 parcelable CompositePwleV2 {
     /**
-     * An array of primitives that represents the PWLE effect
+     * Represents a PWLE (Piecewise-Linear Envelope) effect as an array of primitives.
+     *
+     * A PWLE effect defines a vibration waveform using amplitude and frequency points.
+     * The envelope linearly interpolates both amplitude and frequency between consecutive points,
+     * creating smooth transitions in the vibration pattern.
      */
     PwleV2Primitive[] pwlePrimitives;
 }
diff --git a/vibrator/aidl/android/hardware/vibrator/FrequencyAccelerationMapEntry.aidl b/vibrator/aidl/android/hardware/vibrator/FrequencyAccelerationMapEntry.aidl
index 470dc80..013ae84 100644
--- a/vibrator/aidl/android/hardware/vibrator/FrequencyAccelerationMapEntry.aidl
+++ b/vibrator/aidl/android/hardware/vibrator/FrequencyAccelerationMapEntry.aidl
@@ -29,7 +29,7 @@
      *
      * This value represents the maximum safe output acceleration (in Gs) achievable at the
      * specified frequency, typically determined during calibration. The actual output acceleration
-     * is assumed to scale linearly with the input amplitude within the range of [0, 1].
+     * should scale linearly based on the 'amplitude' input value.
      */
     float maxOutputAccelerationGs;
 }
diff --git a/vibrator/aidl/android/hardware/vibrator/IVibrator.aidl b/vibrator/aidl/android/hardware/vibrator/IVibrator.aidl
index a2f0017..81d7948 100644
--- a/vibrator/aidl/android/hardware/vibrator/IVibrator.aidl
+++ b/vibrator/aidl/android/hardware/vibrator/IVibrator.aidl
@@ -472,7 +472,11 @@
     int getPwleV2PrimitiveDurationMinMillis();
 
     /**
-     * Play composed sequence of chirps with optional callback upon completion.
+     * Play composed sequence of PWLEs with optional callback upon completion.
+     *
+     * A PWLE (Piecewise-Linear Envelope) effect defines a vibration waveform using amplitude and
+     * frequency points. The envelope linearly interpolates both amplitude and frequency between
+     * consecutive points, creating smooth transitions in the vibration pattern.
      *
      * This may not be supported and this support is reflected in
      * getCapabilities (CAP_COMPOSE_PWLE_EFFECTS_V2).
diff --git a/vibrator/aidl/default/VibrationSession.cpp b/vibrator/aidl/default/VibrationSession.cpp
index cfb6608..4eac831 100644
--- a/vibrator/aidl/default/VibrationSession.cpp
+++ b/vibrator/aidl/default/VibrationSession.cpp
@@ -24,7 +24,7 @@
 namespace hardware {
 namespace vibrator {
 
-static constexpr int32_t SESSION_END_DELAY_MS = 50;
+static constexpr int32_t SESSION_END_DELAY_MS = 20;
 
 ndk::ScopedAStatus VibrationSession::close() {
     LOG(VERBOSE) << "Vibration Session close";
diff --git a/wifi/aidl/default/aidl_callback_util.h b/wifi/aidl/default/aidl_callback_util.h
index 2419db9..d077683 100644
--- a/wifi/aidl/default/aidl_callback_util.h
+++ b/wifi/aidl/default/aidl_callback_util.h
@@ -26,6 +26,7 @@
 namespace {
 std::unordered_map<void* /* callback */, void* /* handler */> callback_handler_map_;
 std::mutex callback_handler_lock_;
+int32_t min_callback_version_ = INT_MAX;
 }
 
 namespace aidl {
@@ -50,6 +51,13 @@
             return false;
         }
 
+        // Callback interface version indicates which methods are available
+        int callbackVersion = getCallbackInterfaceVersion(cb);
+        if (callbackVersion < min_callback_version_) {
+            LOG(INFO) << "Setting min callback version to " << callbackVersion;
+            min_callback_version_ = callbackVersion;
+        }
+
         std::unique_lock<std::mutex> lk(callback_handler_lock_);
         void* cbPtr = reinterpret_cast<void*>(cb->asBinder().get());
         const auto& cbPosition = findCbInSet(cbPtr);
@@ -111,6 +119,8 @@
         // unique_lock unlocked here
     }
 
+    int32_t getMinCallbackVersion() { return min_callback_version_; }
+
   private:
     std::set<std::shared_ptr<CallbackType>> cb_set_;
     AIBinder_DeathRecipient* death_handler_;
@@ -145,6 +155,15 @@
         }
     }
 
+    static int32_t getCallbackInterfaceVersion(std::shared_ptr<CallbackType> callback) {
+        int32_t callbackVersion;
+        if (!callback->getInterfaceVersion(&callbackVersion).isOk()) {
+            LOG(ERROR) << "Unable to check the callback version";
+            return INT_MAX;
+        }
+        return callbackVersion;
+    }
+
     DISALLOW_COPY_AND_ASSIGN(AidlCallbackHandler);
 };
 
diff --git a/wifi/aidl/default/wifi_nan_iface.cpp b/wifi/aidl/default/wifi_nan_iface.cpp
index cefe7f7..9d50798 100644
--- a/wifi/aidl/default/wifi_nan_iface.cpp
+++ b/wifi/aidl/default/wifi_nan_iface.cpp
@@ -672,6 +672,10 @@
     return ifname_;
 }
 
+int32_t WifiNanIface::getMinCallbackVersion() {
+    return event_cb_handler_.getMinCallbackVersion();
+}
+
 std::set<std::shared_ptr<IWifiNanIfaceEventCallback>> WifiNanIface::getEventCallbacks() {
     LOG(ERROR) << "Using original getEventCallbacks";
     return event_cb_handler_.getCallbacks();
diff --git a/wifi/aidl/default/wifi_nan_iface.h b/wifi/aidl/default/wifi_nan_iface.h
index a49ae8c..d2d1d5c 100644
--- a/wifi/aidl/default/wifi_nan_iface.h
+++ b/wifi/aidl/default/wifi_nan_iface.h
@@ -134,6 +134,8 @@
     ndk::ScopedAStatus suspendRequestInternal(char16_t in_cmdId, int8_t sessionId);
     ndk::ScopedAStatus resumeRequestInternal(char16_t in_cmdId, int8_t sessionId);
 
+    int32_t getMinCallbackVersion();
+
     // Overridden in the gTest suite.
     virtual std::set<std::shared_ptr<IWifiNanIfaceEventCallback>> getEventCallbacks();
 
diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantP2pIface.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantP2pIface.aidl
index d54e44c..c584d57 100644
--- a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantP2pIface.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantP2pIface.aidl
@@ -79,6 +79,9 @@
    */
   void provisionDiscovery(in byte[] peerAddress, in android.hardware.wifi.supplicant.WpsProvisionMethod provisionMethod);
   void registerCallback(in android.hardware.wifi.supplicant.ISupplicantP2pIfaceCallback callback);
+  /**
+   * @deprecated This method is deprecated from AIDL v4, newer HALs should use reinvokePersistentGroup.
+   */
   void reinvoke(in int persistentNetworkId, in byte[] peerAddress);
   void reject(in byte[] peerAddress);
   void removeBonjourService(in byte[] query);
@@ -132,6 +135,9 @@
   int startUsdBasedServiceAdvertisement(in android.hardware.wifi.supplicant.P2pUsdBasedServiceAdvertisementConfig serviceAdvertisementConfig);
   void stopUsdBasedServiceAdvertisement(in int sessionId);
   void provisionDiscoveryWithParams(in android.hardware.wifi.supplicant.P2pProvisionDiscoveryParams params);
+  android.hardware.wifi.supplicant.P2pDirInfo getDirInfo();
+  int validateDirInfo(in android.hardware.wifi.supplicant.P2pDirInfo dirInfo);
+  void reinvokePersistentGroup(in android.hardware.wifi.supplicant.P2pReinvokePersistentGroupParams reinvokeGroupParams);
   const long P2P_FEATURE_V2 = (1 << 0) /* 1 */;
   const long P2P_FEATURE_PCC_MODE_WPA3_COMPATIBILITY = (1 << 1) /* 2 */;
 }
diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pConnectInfo.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pConnectInfo.aidl
index 88dd740..a88a829 100644
--- a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pConnectInfo.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pConnectInfo.aidl
@@ -43,4 +43,7 @@
   @nullable android.hardware.wifi.common.OuiKeyedData[] vendorData;
   int pairingBootstrappingMethod;
   @nullable String password;
+  int frequencyMHz;
+  boolean authorizeConnectionFromPeer;
+  @nullable String groupInterfaceName;
 }
diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pDeviceFoundEventParams.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pDeviceFoundEventParams.aidl
index 68cde9e..184fbd0 100644
--- a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pDeviceFoundEventParams.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pDeviceFoundEventParams.aidl
@@ -46,4 +46,5 @@
   byte[] vendorElemBytes;
   @nullable android.hardware.wifi.common.OuiKeyedData[] vendorData;
   int pairingBootstrappingMethods;
+  @nullable android.hardware.wifi.supplicant.P2pDirInfo dirInfo;
 }
diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/BeidouAlmanac.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pDirInfo.aidl
similarity index 77%
copy from gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/BeidouAlmanac.aidl
copy to wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pDirInfo.aidl
index f42e1d0..2c55410 100644
--- a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/BeidouAlmanac.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pDirInfo.aidl
@@ -31,25 +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.gnss.gnss_assistance;
-/* @hide */
+package android.hardware.wifi.supplicant;
 @VintfStability
-parcelable BeidouAlmanac {
-  int beidouWeekNumber;
-  android.hardware.gnss.gnss_assistance.BeidouAlmanac.BeidouSatelliteAlmanac[] satelliteAlmanac;
-  @VintfStability
-  parcelable BeidouSatelliteAlmanac {
-    int prn;
-    int svHealth;
-    int toaSeconds;
-    double eccentricity;
-    double deltaI;
-    double omega;
-    double omega0;
-    double omegaDot;
-    double rootA;
-    double m0;
-    double af0;
-    double af1;
+parcelable P2pDirInfo {
+  android.hardware.wifi.supplicant.P2pDirInfo.CipherVersion cipherVersion;
+  byte[6] deviceInterfaceMacAddress;
+  byte[] nonce;
+  byte[] dirTag;
+  @Backing(type="int") @VintfStability
+  enum CipherVersion {
+    NONE,
+    DIRA_CIPHER_VERSION_128_BIT,
   }
 }
diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pPairingBootstrappingMethodMask.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pPairingBootstrappingMethodMask.aidl
index 6e83277..182c091 100644
--- a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pPairingBootstrappingMethodMask.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pPairingBootstrappingMethodMask.aidl
@@ -39,4 +39,5 @@
   const int BOOTSTRAPPING_DISPLAY_PASSPHRASE = (1 << 2) /* 4 */;
   const int BOOTSTRAPPING_KEYPAD_PINCODE = (1 << 3) /* 8 */;
   const int BOOTSTRAPPING_KEYPAD_PASSPHRASE = (1 << 4) /* 16 */;
+  const int BOOTSTRAPPING_OUT_OF_BAND = (1 << 5) /* 32 */;
 }
diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/BeidouAlmanac.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pReinvokePersistentGroupParams.aidl
similarity index 77%
rename from gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/BeidouAlmanac.aidl
rename to wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pReinvokePersistentGroupParams.aidl
index f42e1d0..0743a64 100644
--- a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/BeidouAlmanac.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pReinvokePersistentGroupParams.aidl
@@ -31,25 +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.gnss.gnss_assistance;
-/* @hide */
+package android.hardware.wifi.supplicant;
 @VintfStability
-parcelable BeidouAlmanac {
-  int beidouWeekNumber;
-  android.hardware.gnss.gnss_assistance.BeidouAlmanac.BeidouSatelliteAlmanac[] satelliteAlmanac;
-  @VintfStability
-  parcelable BeidouSatelliteAlmanac {
-    int prn;
-    int svHealth;
-    int toaSeconds;
-    double eccentricity;
-    double deltaI;
-    double omega;
-    double omega0;
-    double omegaDot;
-    double rootA;
-    double m0;
-    double af0;
-    double af1;
-  }
+parcelable P2pReinvokePersistentGroupParams {
+  byte[6] peerMacAddress;
+  int persistentNetworkId;
+  int deviceIdentityEntryId;
 }
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 d7ff798..8675ab3 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
@@ -46,4 +46,5 @@
   FAILURE_NETWORK_UNKNOWN,
   FAILURE_UNSUPPORTED,
   FAILURE_ONGOING_REQUEST,
+  FAILURE_DATA_NOT_AVAILABLE,
 }
diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantP2pIface.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantP2pIface.aidl
index 62f9fc3..75e65ff 100644
--- a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantP2pIface.aidl
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantP2pIface.aidl
@@ -25,11 +25,13 @@
 import android.hardware.wifi.supplicant.P2pAddGroupConfigurationParams;
 import android.hardware.wifi.supplicant.P2pConnectInfo;
 import android.hardware.wifi.supplicant.P2pCreateGroupOwnerInfo;
+import android.hardware.wifi.supplicant.P2pDirInfo;
 import android.hardware.wifi.supplicant.P2pDiscoveryInfo;
 import android.hardware.wifi.supplicant.P2pExtListenInfo;
 import android.hardware.wifi.supplicant.P2pFrameTypeMask;
 import android.hardware.wifi.supplicant.P2pGroupCapabilityMask;
 import android.hardware.wifi.supplicant.P2pProvisionDiscoveryParams;
+import android.hardware.wifi.supplicant.P2pReinvokePersistentGroupParams;
 import android.hardware.wifi.supplicant.P2pUsdBasedServiceAdvertisementConfig;
 import android.hardware.wifi.supplicant.P2pUsdBasedServiceDiscoveryConfig;
 import android.hardware.wifi.supplicant.WpsConfigMethods;
@@ -439,6 +441,9 @@
 
     /**
      * Reinvoke a device from a persistent group.
+     * <p>
+     * @deprecated This method is deprecated from AIDL v4, newer HALs should use
+     * reinvokePersistentGroup.
      *
      * @param persistentNetworkId Used to specify the persistent group.
      * @param peerAddress MAC address of the device to reinvoke.
@@ -1022,4 +1027,42 @@
      *         |SupplicantStatusCode.FAILURE_IFACE_INVALID|
      */
     void provisionDiscoveryWithParams(in P2pProvisionDiscoveryParams params);
+
+    /**
+     * The Device Identity Resolution (DIR) Info used to send in
+     * Bluetooth LE advertising packet for the receiving device to
+     * check if the device is a previously paired device.
+     *
+     * @return The DIR info - |P2pDirInfo|
+     * @throws ServiceSpecificException with one of the following values:
+     *         |SupplicantStatusCode.FAILURE_UNKNOWN|,
+     *         |SupplicantStatusCode.FAILURE_IFACE_INVALID|
+     *         |SupplicantStatusCode.FAILURE_DATA_NOT_AVAILABLE|
+     */
+    P2pDirInfo getDirInfo();
+
+    /**
+     * Validate a Device Identity Resolution (DIR) Info of a P2P device.
+     * wpa_supplicant takes the |P2pDirInfo| and derives a set of Tag values based on
+     * the cached Device Identity Keys (DevIK) of all paired peers saved in the
+     * configuration file. If a derived Tag value matches the Tag value received in the
+     * |P2pDirInfo|, the device is identified as a paired peer and returns an identifier
+     * identifying the device identity key information stored in the configuration file.
+     *
+     * @return The identifier of device identity key stored in the configuration file.
+     * @throws ServiceSpecificException with one of the following values:
+     *         |SupplicantStatusCode.FAILURE_UNKNOWN|,
+     *         |SupplicantStatusCode.FAILURE_IFACE_INVALID|
+     */
+    int validateDirInfo(in P2pDirInfo dirInfo);
+
+    /**
+     * Reinvoke a device from a persistent group.
+     *
+     * @param reinvokeGroupParams Parameters associated to reinvoke a group.
+     * @throws ServiceSpecificException with one of the following values:
+     *         |SupplicantStatusCode.FAILURE_UNKNOWN|,
+     *         |SupplicantStatusCode.FAILURE_IFACE_INVALID|
+     */
+    void reinvokePersistentGroup(in P2pReinvokePersistentGroupParams reinvokeGroupParams);
 }
diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/P2pConnectInfo.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/P2pConnectInfo.aidl
index 8f3c596..6467436 100644
--- a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/P2pConnectInfo.aidl
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/P2pConnectInfo.aidl
@@ -25,7 +25,8 @@
 @VintfStability
 parcelable P2pConnectInfo {
     /**
-     * MAC address of the device to connect to.
+     * MAC address of the peer device to connect to or to authorize a connect
+     * request.
      */
     byte[6] peerAddress;
 
@@ -82,4 +83,23 @@
      * null otherwise.
      */
     @nullable String password;
+
+    /**
+     * Channel frequency in MHz to start group formation,
+     * join an existing group owner or authorize a connection request.
+     */
+    int frequencyMHz;
+
+    /**
+     * Used to authorize a connection request from the Peer device.
+     * The MAC address of the peer device is set in peerAddress.
+     */
+    boolean authorizeConnectionFromPeer;
+
+    /**
+     * Used to check if the authorize connection request is on an existing Group Owner
+     * interface to allow a peer device to connect. This field is set to null if the request
+     * is to form a group or join an existing group.
+     */
+    @nullable String groupInterfaceName;
 }
diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/P2pDeviceFoundEventParams.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/P2pDeviceFoundEventParams.aidl
index 31e64ac..e320954 100644
--- a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/P2pDeviceFoundEventParams.aidl
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/P2pDeviceFoundEventParams.aidl
@@ -17,6 +17,7 @@
 package android.hardware.wifi.supplicant;
 
 import android.hardware.wifi.common.OuiKeyedData;
+import android.hardware.wifi.supplicant.P2pDirInfo;
 
 /**
  * Parameters passed as a part of a P2P Device found event.
@@ -95,4 +96,9 @@
      * the pairing bootstrapping between bootstrapping initiator and a bootstrapping responder.
      */
     int pairingBootstrappingMethods;
+
+    /**
+     * The Device Identity Resolution Attribute (DIRA) |P2pDirInfo| received in the USD frame.
+     */
+    @nullable P2pDirInfo dirInfo;
 }
diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/P2pDirInfo.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/P2pDirInfo.aidl
new file mode 100644
index 0000000..22037ed
--- /dev/null
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/P2pDirInfo.aidl
@@ -0,0 +1,67 @@
+/*
+ * Copyright (C) 2024 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.wifi.supplicant;
+
+/**
+ * The Device Identity Resolution (DIR) Info is used to identify a previously
+ * paired P2P device.
+ * The device advertises this information in Bluetooth LE advertising packets
+ * and Unsynchronized Service Discovery (USD) frames. The device receiving DIR
+ * Info uses this information to identify that the peer device is a previously paired device.
+ * For Details, refer Wi-Fi Alliance Wi-Fi Direct R2 specification section 3.8.2 Pairing Identity
+ * and section 3.9.2.3.2 Optional Advertising Data Elements.
+ */
+@VintfStability
+parcelable P2pDirInfo {
+    /**
+     * Enums for the |cipherVersion| field.
+     */
+    @VintfStability
+    @Backing(type="int")
+    enum CipherVersion {
+        NONE,
+        /**
+         * DIRA cipher version 128 bit.
+         * 128-bit Device Identity Key, 64-bit Nonce, 64-bit Tag.
+         * 64-bit Tag = Truncate-64(HMAC-SHA-256(DevIk, "DIR" ||
+         * P2P Device Address || Nonce))
+         */
+        DIRA_CIPHER_VERSION_128_BIT,
+    }
+
+    /**
+     * DIRA cipher version. The value of cipher version indicates the
+     * cryptographic parameters and method used to derive the dirTag field.
+     * Set to one of the |DIRA_CIPHER_VERSION_*|.
+     */
+    CipherVersion cipherVersion;
+
+    /**
+     * The MAC address of the P2P device interface.
+     */
+    byte[6] deviceInterfaceMacAddress;
+
+    /**
+     * Random number. The size limit is defined in the cipher version comment.
+     */
+    byte[] nonce;
+
+    /**
+     * A resolvable identity. The size limit is defined in the cipher version comment.
+     */
+    byte[] dirTag;
+}
diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/P2pPairingBootstrappingMethodMask.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/P2pPairingBootstrappingMethodMask.aidl
index cac8c53..03c2703 100644
--- a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/P2pPairingBootstrappingMethodMask.aidl
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/P2pPairingBootstrappingMethodMask.aidl
@@ -31,4 +31,9 @@
     const int BOOTSTRAPPING_KEYPAD_PINCODE = 1 << 3;
     /** Keypad passphrase */
     const int BOOTSTRAPPING_KEYPAD_PASSPHRASE = 1 << 4;
+    /**
+     * Pairing bootstrapping done Out of band (For example: Over Bluetooth LE.
+     * Refer Wi-Fi Alliance Wi-Fi Direct R2 specification Section 3.9 for the details).
+     */
+    const int BOOTSTRAPPING_OUT_OF_BAND = 1 << 5;
 }
diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/P2pReinvokePersistentGroupParams.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/P2pReinvokePersistentGroupParams.aidl
new file mode 100644
index 0000000..f5f4562
--- /dev/null
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/P2pReinvokePersistentGroupParams.aidl
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 2024 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.wifi.supplicant;
+
+/**
+ * Parameters used for |ISupplicantP2pIface.reinvokePersistentGroup|
+ */
+@VintfStability
+parcelable P2pReinvokePersistentGroupParams {
+    /**
+     * MAC address of the peer device to reinvoke the persistent group.
+     */
+    byte[6] peerMacAddress;
+
+    /**
+     * Persistent network ID of the group.
+     */
+    int persistentNetworkId;
+
+    /**
+     * The identifier of device identity key information stored in the configuration file.
+     * This field is valid only for P2P group formed via pairing protocol (P2P version 2).
+     * Set to invalid value of -1 for a group formed via WPS process (P2P version 1).
+     */
+    int deviceIdentityEntryId;
+}
diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/SupplicantStatusCode.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/SupplicantStatusCode.aidl
index e97d6ee..271da7f 100644
--- a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/SupplicantStatusCode.aidl
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/SupplicantStatusCode.aidl
@@ -67,4 +67,8 @@
      * A different request is currently being processed.
      */
     FAILURE_ONGOING_REQUEST,
+    /**
+     * Requested data is not available.
+     */
+    FAILURE_DATA_NOT_AVAILABLE,
 }
diff --git a/wifi/supplicant/aidl/vts/functional/supplicant_p2p_iface_aidl_test.cpp b/wifi/supplicant/aidl/vts/functional/supplicant_p2p_iface_aidl_test.cpp
index 3226ffd..3638ac5 100644
--- a/wifi/supplicant/aidl/vts/functional/supplicant_p2p_iface_aidl_test.cpp
+++ b/wifi/supplicant/aidl/vts/functional/supplicant_p2p_iface_aidl_test.cpp
@@ -43,6 +43,7 @@
 using aidl::android::hardware::wifi::supplicant::P2pConnectInfo;
 using aidl::android::hardware::wifi::supplicant::P2pCreateGroupOwnerInfo;
 using aidl::android::hardware::wifi::supplicant::P2pDeviceFoundEventParams;
+using aidl::android::hardware::wifi::supplicant::P2pDirInfo;
 using aidl::android::hardware::wifi::supplicant::P2pDiscoveryInfo;
 using aidl::android::hardware::wifi::supplicant::P2pExtListenInfo;
 using aidl::android::hardware::wifi::supplicant::P2pFrameTypeMask;
@@ -56,7 +57,7 @@
 using aidl::android::hardware::wifi::supplicant::P2pProvDiscStatusCode;
 using aidl::android::hardware::wifi::supplicant::P2pProvisionDiscoveryCompletedEventParams;
 using aidl::android::hardware::wifi::supplicant::P2pProvisionDiscoveryParams;
-;
+using aidl::android::hardware::wifi::supplicant::P2pReinvokePersistentGroupParams;
 using aidl::android::hardware::wifi::supplicant::P2pScanType;
 using aidl::android::hardware::wifi::supplicant::P2pStatusCode;
 using aidl::android::hardware::wifi::supplicant::P2pUsdBasedServiceAdvertisementConfig;
@@ -80,6 +81,8 @@
 const std::string kTestServiceSpecificInfoStr = "TestServiceSpecificInfo";
 const std::vector<uint8_t> kTestServiceSpecificInfo = std::vector<uint8_t>(
         kTestServiceSpecificInfoStr.begin(), kTestServiceSpecificInfoStr.end());
+const std::vector<uint8_t> kTestNonce = {0x11, 0x22, 0x33, 0x44, 0x55, 0x92, 0x22, 0x33};
+const std::vector<uint8_t> kTestDirTag = {0xaa, 0x22, 0x55, 0x44, 0x55, 0x92, 0x22, 0x33};
 const std::string kTestPassphrase = "P2pWorld1234";
 const std::string kTestConnectPin = "34556665";
 const std::string kTestGroupIfName = "TestGroup";
@@ -924,6 +927,60 @@
     EXPECT_TRUE(p2p_iface_->provisionDiscoveryWithParams(params).isOk());
 }
 
+/*
+ * ValidateDirInfo
+ */
+TEST_P(SupplicantP2pIfaceAidlTest, ValidateDirInfo) {
+    if (interface_version_ < 4) {
+        GTEST_SKIP() << "ValidateDirInfo is available as of Supplicant V4";
+    }
+    if (!(supported_features_ & ISupplicantP2pIface::P2P_FEATURE_V2)) {
+        GTEST_SKIP() << "P2P2 is not supported";
+    }
+
+    int32_t ret;
+    P2pDirInfo dirInfo;
+    dirInfo.cipherVersion = P2pDirInfo::CipherVersion::DIRA_CIPHER_VERSION_128_BIT;
+    dirInfo.deviceInterfaceMacAddress = vecToArrayMacAddr(kTestMacAddr);
+    dirInfo.nonce = kTestNonce;
+    dirInfo.dirTag = kTestDirTag;
+    EXPECT_TRUE(p2p_iface_->validateDirInfo(dirInfo, &ret).isOk());
+}
+
+/*
+ * GetDirInfo
+ */
+TEST_P(SupplicantP2pIfaceAidlTest, GetDirInfo) {
+    if (interface_version_ < 4) {
+        GTEST_SKIP() << "GetDirInfo is available as of Supplicant V4";
+    }
+    if (!(supported_features_ & ISupplicantP2pIface::P2P_FEATURE_V2)) {
+        GTEST_SKIP() << "P2P2 is not supported";
+    }
+
+    P2pDirInfo dirInfo;
+    EXPECT_TRUE(p2p_iface_->getDirInfo(&dirInfo).isOk());
+}
+
+/*
+ * ReinvokePersistentGroup
+ */
+TEST_P(SupplicantP2pIfaceAidlTest, ReinvokePersistentGroup) {
+    if (interface_version_ < 4) {
+        GTEST_SKIP() << "ReinvokePersistentGroup is available as of Supplicant V4";
+    }
+    if (!(supported_features_ & ISupplicantP2pIface::P2P_FEATURE_V2)) {
+        GTEST_SKIP() << "P2P2 is not supported";
+    }
+
+    P2pReinvokePersistentGroupParams params;
+    params.peerMacAddress = vecToArrayMacAddr(kTestMacAddr);
+    params.persistentNetworkId = 0;
+    params.deviceIdentityEntryId = 0;
+
+    EXPECT_TRUE(p2p_iface_->reinvokePersistentGroup(params).isOk());
+}
+
 GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(SupplicantP2pIfaceAidlTest);
 INSTANTIATE_TEST_SUITE_P(Supplicant, SupplicantP2pIfaceAidlTest,
                          testing::ValuesIn(android::getAidlHalInstanceNames(