Merge "VtsHalBluetooth: Add test for double init"
diff --git a/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/Flags.aidl b/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/Flags.aidl
index 285ff18..bcbf870 100644
--- a/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/Flags.aidl
+++ b/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/Flags.aidl
@@ -42,7 +42,7 @@
   boolean deviceIndication;
   boolean audioModeIndication;
   boolean audioSourceIndication;
-  boolean noProcessing;
+  boolean bypass;
   @Backing(type="byte") @VintfStability
   enum Type {
     INSERT = 0,
diff --git a/audio/aidl/android/hardware/audio/effect/Flags.aidl b/audio/aidl/android/hardware/audio/effect/Flags.aidl
index f449c2d..1612234 100644
--- a/audio/aidl/android/hardware/audio/effect/Flags.aidl
+++ b/audio/aidl/android/hardware/audio/effect/Flags.aidl
@@ -141,7 +141,7 @@
     boolean audioSourceIndication;
 
     /**
-     * Set to true if no processing done for this effect instance.
+     * Set to true if the effect instance bypass audio data (no processing).
      */
-    boolean noProcessing;
+    boolean bypass;
 }
diff --git a/audio/aidl/default/Android.bp b/audio/aidl/default/Android.bp
index 95043f7..856f83f 100644
--- a/audio/aidl/default/Android.bp
+++ b/audio/aidl/default/Android.bp
@@ -152,23 +152,7 @@
     vintf_fragments: ["android.hardware.audio.effect.service-aidl.xml"],
     defaults: ["aidlaudioeffectservice_defaults"],
     shared_libs: [
-        "libaecsw",
-        "libagcsw",
-        "libbassboostsw",
-        "libbundleaidl",
-        "libdownmixaidl",
-        "libdynamicsprocessingaidl",
-        "libenvreverbsw",
-        "libequalizersw",
-        "libhapticgeneratoraidl",
-        "libloudnessenhanceraidl",
-        "libnssw",
-        "libpresetreverbsw",
-        "libreverbaidl",
         "libtinyxml2",
-        "libvirtualizersw",
-        "libvisualizeraidl",
-        "libvolumesw",
     ],
     srcs: [
         "EffectConfig.cpp",
diff --git a/audio/aidl/default/EffectConfig.cpp b/audio/aidl/default/EffectConfig.cpp
index e1427ec..c030b7a 100644
--- a/audio/aidl/default/EffectConfig.cpp
+++ b/audio/aidl/default/EffectConfig.cpp
@@ -79,14 +79,30 @@
     return children;
 }
 
+bool EffectConfig::resolveLibrary(const std::string& path, std::string* resolvedPath) {
+    for (auto* libraryDirectory : kEffectLibPath) {
+        std::string candidatePath = std::string(libraryDirectory) + '/' + path;
+        if (access(candidatePath.c_str(), R_OK) == 0) {
+            *resolvedPath = std::move(candidatePath);
+            return true;
+        }
+    }
+    return false;
+}
+
 bool EffectConfig::parseLibrary(const tinyxml2::XMLElement& xml) {
     const char* name = xml.Attribute("name");
     RETURN_VALUE_IF(!name, false, "noNameAttribute");
     const char* path = xml.Attribute("path");
     RETURN_VALUE_IF(!path, false, "noPathAttribute");
 
-    mLibraryMap[name] = path;
-    LOG(DEBUG) << __func__ << " " << name << " : " << path;
+    std::string resolvedPath;
+    if (!resolveLibrary(path, &resolvedPath)) {
+        LOG(ERROR) << __func__ << " can't find " << path;
+        return false;
+    }
+    mLibraryMap[name] = resolvedPath;
+    LOG(DEBUG) << __func__ << " " << name << " : " << resolvedPath;
     return true;
 }
 
diff --git a/audio/aidl/default/EffectFactory.cpp b/audio/aidl/default/EffectFactory.cpp
index 5cd87fd..638fa7f 100644
--- a/audio/aidl/default/EffectFactory.cpp
+++ b/audio/aidl/default/EffectFactory.cpp
@@ -165,7 +165,7 @@
     return status;
 }
 
-bool Factory::openEffectLibrary(const AudioUuid& impl, const std::string& libName) {
+bool Factory::openEffectLibrary(const AudioUuid& impl, const std::string& path) {
     std::function<void(void*)> dlClose = [](void* handle) -> void {
         if (handle && dlclose(handle)) {
             LOG(ERROR) << "dlclose failed " << dlerror();
@@ -173,19 +173,19 @@
     };
 
     auto libHandle =
-            std::unique_ptr<void, decltype(dlClose)>{dlopen(libName.c_str(), RTLD_LAZY), dlClose};
+            std::unique_ptr<void, decltype(dlClose)>{dlopen(path.c_str(), RTLD_LAZY), dlClose};
     if (!libHandle) {
         LOG(ERROR) << __func__ << ": dlopen failed, err: " << dlerror();
         return false;
     }
 
-    LOG(INFO) << __func__ << " dlopen lib:" << libName << "\nimpl:" << impl.toString()
+    LOG(INFO) << __func__ << " dlopen lib:" << path << "\nimpl:" << impl.toString()
               << "\nhandle:" << libHandle;
     auto interface = new effect_dl_interface_s{nullptr, nullptr, nullptr};
     mEffectLibMap.insert(
             {impl,
              std::make_tuple(std::move(libHandle),
-                             std::unique_ptr<struct effect_dl_interface_s>(interface), libName)});
+                             std::unique_ptr<struct effect_dl_interface_s>(interface), path)});
     return true;
 }
 
@@ -199,8 +199,8 @@
         id.type = typeUuid;
         id.uuid = configLib.uuid;
         id.proxy = proxyUuid;
-        LOG(DEBUG) << __func__ << ": typeUuid " << id.type.toString() << "\nimplUuid "
-                   << id.uuid.toString() << " proxyUuid "
+        LOG(DEBUG) << __func__ << " loading lib " << path->second << ": typeUuid "
+                   << id.type.toString() << "\nimplUuid " << id.uuid.toString() << " proxyUuid "
                    << (proxyUuid.has_value() ? proxyUuid->toString() : "null");
         if (openEffectLibrary(id.uuid, path->second)) {
             mIdentitySet.insert(std::move(id));
diff --git a/audio/aidl/default/acousticEchoCanceler/Android.bp b/audio/aidl/default/acousticEchoCanceler/Android.bp
index b2e2682..bfb7212 100644
--- a/audio/aidl/default/acousticEchoCanceler/Android.bp
+++ b/audio/aidl/default/acousticEchoCanceler/Android.bp
@@ -34,6 +34,7 @@
         "AcousticEchoCancelerSw.cpp",
         ":effectCommonFile",
     ],
+    relative_install_path: "soundfx",
     visibility: [
         "//hardware/interfaces/audio/aidl/default",
     ],
diff --git a/audio/aidl/default/automaticGainControl/Android.bp b/audio/aidl/default/automaticGainControl/Android.bp
index 4899b39..17d6416 100644
--- a/audio/aidl/default/automaticGainControl/Android.bp
+++ b/audio/aidl/default/automaticGainControl/Android.bp
@@ -34,6 +34,7 @@
         "AutomaticGainControlSw.cpp",
         ":effectCommonFile",
     ],
+    relative_install_path: "soundfx",
     visibility: [
         "//hardware/interfaces/audio/aidl/default",
     ],
diff --git a/audio/aidl/default/bassboost/Android.bp b/audio/aidl/default/bassboost/Android.bp
index f22eb95..82b2f20 100644
--- a/audio/aidl/default/bassboost/Android.bp
+++ b/audio/aidl/default/bassboost/Android.bp
@@ -34,6 +34,7 @@
         "BassBoostSw.cpp",
         ":effectCommonFile",
     ],
+    relative_install_path: "soundfx",
     visibility: [
         "//hardware/interfaces/audio/aidl/default",
     ],
diff --git a/audio/aidl/default/downmix/Android.bp b/audio/aidl/default/downmix/Android.bp
index 230b2d8..6d15cdb 100644
--- a/audio/aidl/default/downmix/Android.bp
+++ b/audio/aidl/default/downmix/Android.bp
@@ -34,6 +34,7 @@
         "DownmixSw.cpp",
         ":effectCommonFile",
     ],
+    relative_install_path: "soundfx",
     visibility: [
         "//hardware/interfaces/audio/aidl/default",
     ],
diff --git a/audio/aidl/default/dynamicProcessing/Android.bp b/audio/aidl/default/dynamicProcessing/Android.bp
index 3697ba3..1c0312d 100644
--- a/audio/aidl/default/dynamicProcessing/Android.bp
+++ b/audio/aidl/default/dynamicProcessing/Android.bp
@@ -34,6 +34,7 @@
         "DynamicsProcessingSw.cpp",
         ":effectCommonFile",
     ],
+    relative_install_path: "soundfx",
     visibility: [
         "//hardware/interfaces/audio/aidl/default",
     ],
diff --git a/audio/aidl/default/envReverb/Android.bp b/audio/aidl/default/envReverb/Android.bp
index c239ee5..dd4219a 100644
--- a/audio/aidl/default/envReverb/Android.bp
+++ b/audio/aidl/default/envReverb/Android.bp
@@ -34,6 +34,7 @@
         "EnvReverbSw.cpp",
         ":effectCommonFile",
     ],
+    relative_install_path: "soundfx",
     visibility: [
         "//hardware/interfaces/audio/aidl/default",
     ],
diff --git a/audio/aidl/default/equalizer/Android.bp b/audio/aidl/default/equalizer/Android.bp
index 8de6b1a..3610563 100644
--- a/audio/aidl/default/equalizer/Android.bp
+++ b/audio/aidl/default/equalizer/Android.bp
@@ -34,6 +34,7 @@
         "EqualizerSw.cpp",
         ":effectCommonFile",
     ],
+    relative_install_path: "soundfx",
     visibility: [
         "//hardware/interfaces/audio/aidl/default",
     ],
diff --git a/audio/aidl/default/hapticGenerator/Android.bp b/audio/aidl/default/hapticGenerator/Android.bp
index a632130..0df9a94 100644
--- a/audio/aidl/default/hapticGenerator/Android.bp
+++ b/audio/aidl/default/hapticGenerator/Android.bp
@@ -34,6 +34,7 @@
         "HapticGeneratorSw.cpp",
         ":effectCommonFile",
     ],
+    relative_install_path: "soundfx",
     visibility: [
         "//hardware/interfaces/audio/aidl/default",
     ],
diff --git a/audio/aidl/default/include/effectFactory-impl/EffectConfig.h b/audio/aidl/default/include/effectFactory-impl/EffectConfig.h
index 2b904f5..c499811 100644
--- a/audio/aidl/default/include/effectFactory-impl/EffectConfig.h
+++ b/audio/aidl/default/include/effectFactory-impl/EffectConfig.h
@@ -63,6 +63,13 @@
     }
 
   private:
+    static constexpr const char* kEffectLibPath[] =
+#ifdef __LP64__
+            {"/odm/lib64/soundfx", "/vendor/lib64/soundfx", "/system/lib64/soundfx"};
+#else
+            {"/odm/lib/soundfx", "/vendor/lib/soundfx", "/system/lib/soundfx"};
+#endif
+
     int mSkippedElements;
     /* Parsed Libraries result */
     std::unordered_map<std::string, std::string> mLibraryMap;
@@ -91,6 +98,8 @@
 
     const char* dump(const tinyxml2::XMLElement& element,
                      tinyxml2::XMLPrinter&& printer = {}) const;
+
+    bool resolveLibrary(const std::string& path, std::string* resolvedPath);
 };
 
 }  // namespace aidl::android::hardware::audio::effect
diff --git a/audio/aidl/default/include/effectFactory-impl/EffectFactory.h b/audio/aidl/default/include/effectFactory-impl/EffectFactory.h
index b32ec56..fc9ef02 100644
--- a/audio/aidl/default/include/effectFactory-impl/EffectFactory.h
+++ b/audio/aidl/default/include/effectFactory-impl/EffectFactory.h
@@ -102,7 +102,7 @@
     ndk::ScopedAStatus destroyEffectImpl(const std::shared_ptr<IEffect>& in_handle);
     void cleanupEffectMap();
     bool openEffectLibrary(const ::aidl::android::media::audio::common::AudioUuid& impl,
-                           const std::string& libName);
+                           const std::string& path);
     void createIdentityWithConfig(
             const EffectConfig::LibraryUuid& configLib,
             const ::aidl::android::media::audio::common::AudioUuid& typeUuid,
diff --git a/audio/aidl/default/loudnessEnhancer/Android.bp b/audio/aidl/default/loudnessEnhancer/Android.bp
index 3a0ac73..89a72fe 100644
--- a/audio/aidl/default/loudnessEnhancer/Android.bp
+++ b/audio/aidl/default/loudnessEnhancer/Android.bp
@@ -34,6 +34,7 @@
         "LoudnessEnhancerSw.cpp",
         ":effectCommonFile",
     ],
+    relative_install_path: "soundfx",
     visibility: [
         "//hardware/interfaces/audio/aidl/default",
     ],
diff --git a/audio/aidl/default/noiseSuppression/Android.bp b/audio/aidl/default/noiseSuppression/Android.bp
index 581d4bf..dad3d49 100644
--- a/audio/aidl/default/noiseSuppression/Android.bp
+++ b/audio/aidl/default/noiseSuppression/Android.bp
@@ -34,6 +34,7 @@
         "NoiseSuppressionSw.cpp",
         ":effectCommonFile",
     ],
+    relative_install_path: "soundfx",
     visibility: [
         "//hardware/interfaces/audio/aidl/default",
     ],
diff --git a/audio/aidl/default/presetReverb/Android.bp b/audio/aidl/default/presetReverb/Android.bp
index 4148511..18bdd17 100644
--- a/audio/aidl/default/presetReverb/Android.bp
+++ b/audio/aidl/default/presetReverb/Android.bp
@@ -34,6 +34,7 @@
         "PresetReverbSw.cpp",
         ":effectCommonFile",
     ],
+    relative_install_path: "soundfx",
     visibility: [
         "//hardware/interfaces/audio/aidl/default",
     ],
diff --git a/audio/aidl/default/virtualizer/Android.bp b/audio/aidl/default/virtualizer/Android.bp
index ba38f5c..ed0199d 100644
--- a/audio/aidl/default/virtualizer/Android.bp
+++ b/audio/aidl/default/virtualizer/Android.bp
@@ -34,6 +34,7 @@
         "VirtualizerSw.cpp",
         ":effectCommonFile",
     ],
+    relative_install_path: "soundfx",
     visibility: [
         "//hardware/interfaces/audio/aidl/default",
     ],
diff --git a/audio/aidl/default/visualizer/Android.bp b/audio/aidl/default/visualizer/Android.bp
index 5041be8..091daa2 100644
--- a/audio/aidl/default/visualizer/Android.bp
+++ b/audio/aidl/default/visualizer/Android.bp
@@ -34,6 +34,7 @@
         "VisualizerSw.cpp",
         ":effectCommonFile",
     ],
+    relative_install_path: "soundfx",
     visibility: [
         "//hardware/interfaces/audio/aidl/default",
     ],
diff --git a/audio/aidl/default/volume/Android.bp b/audio/aidl/default/volume/Android.bp
index 505ee67..418bb8d 100644
--- a/audio/aidl/default/volume/Android.bp
+++ b/audio/aidl/default/volume/Android.bp
@@ -34,6 +34,7 @@
         "VolumeSw.cpp",
         ":effectCommonFile",
     ],
+    relative_install_path: "soundfx",
     visibility: [
         "//hardware/interfaces/audio/aidl/default",
     ],
diff --git a/compatibility_matrices/compatibility_matrix.8.xml b/compatibility_matrices/compatibility_matrix.8.xml
index 5225f5f..c17cb15 100644
--- a/compatibility_matrices/compatibility_matrix.8.xml
+++ b/compatibility_matrices/compatibility_matrix.8.xml
@@ -503,6 +503,7 @@
     </hal>
     <hal format="aidl" optional="true">
         <name>android.hardware.power.stats</name>
+        <version>2</version>
         <interface>
             <name>IPowerStats</name>
             <instance>default</instance>
diff --git a/confirmationui/aidl/android/hardware/confirmationui/IConfirmationResultCallback.aidl b/confirmationui/aidl/android/hardware/confirmationui/IConfirmationResultCallback.aidl
index 2165fdd..92328a8 100644
--- a/confirmationui/aidl/android/hardware/confirmationui/IConfirmationResultCallback.aidl
+++ b/confirmationui/aidl/android/hardware/confirmationui/IConfirmationResultCallback.aidl
@@ -26,16 +26,16 @@
 interface IConfirmationResultCallback {
     /**
      * This callback is called by the confirmation provider when it stops prompting the user.
-     * Iff the user has confirmed the prompted text, error is ErrorCode::OK and the
+     * Iff the user has confirmed the prompted text, error is IConfirmationUI::OK and the
      * parameters formattedMessage and confirmationToken hold the values needed to request
      * a signature from keymaster.
      * In all other cases formattedMessage and confirmationToken must be of length 0.
      *
-     * @param error - OK: IFF the user has confirmed the prompt.
-     *              - CANCELED: If the user has pressed the cancel button.
-     *              - ABORTED: If IConfirmationUI::abort() was called.
-     *              - SYSTEM_ERROR: If an unexpected System error occurred that prevented the TUI
-     *                             from being shut down gracefully.
+     * @param error - IConfirmationUI::OK: IFF the user has confirmed the prompt.
+     *              - IConfirmationUI::CANCELED: If the user has pressed the cancel button.
+     *              - IConfirmationUI::ABORTED: If IConfirmationUI::abort() was called.
+     *              - IConfirmationUI::SYSTEM_ERROR: If an unexpected System error occurred that
+     * prevented the TUI from being shut down gracefully.
      *
      * @param formattedMessage holds the prompt text and extra data.
      *                         The message is CBOR (RFC 7049) encoded and has the following format:
@@ -59,7 +59,7 @@
      *                          the "", concatenated with the formatted message as returned in the
      *                          formattedMessage argument. The HMAC is keyed with a 256-bit secret
      *                          which is shared with Keymaster. In test mode the test key MUST be
-     *                          used (see types.hal TestModeCommands and
+     *                          used (see TestModeCommands.aidl and
      * IConfirmationUI::TEST_KEY_BYTE).
      */
     void result(in int error, in byte[] formattedMessage, in byte[] confirmationToken);
diff --git a/confirmationui/aidl/android/hardware/confirmationui/IConfirmationUI.aidl b/confirmationui/aidl/android/hardware/confirmationui/IConfirmationUI.aidl
index f071126..20032ce 100644
--- a/confirmationui/aidl/android/hardware/confirmationui/IConfirmationUI.aidl
+++ b/confirmationui/aidl/android/hardware/confirmationui/IConfirmationUI.aidl
@@ -91,7 +91,7 @@
     /**
      * Aborts a pending user prompt. This allows the framework to gracefully end a TUI dialog.
      * If a TUI operation was pending the corresponding call back is informed with
-     * ErrorCode::Aborted.
+     * IConfirmationUI::ABORTED.
      */
     void abort();
 
@@ -139,7 +139,7 @@
      *                      is an IETF BCP 47 tag.
      *
      * @param uiOptions A set of uiOptions manipulating how the confirmation prompt is displayed.
-     *                  Refer to UIOption in types.hal for possible options.
+     *                  Refer to UIOption in UIOptions.aidl for possible options.
      */
     void promptUserConfirmation(in IConfirmationResultCallback resultCB, in byte[] promptText,
             in byte[] extraData, in @utf8InCpp String locale, in UIOption[] uiOptions);
diff --git a/confirmationui/aidl/android/hardware/confirmationui/TestModeCommands.aidl b/confirmationui/aidl/android/hardware/confirmationui/TestModeCommands.aidl
index 5b1d8fb..70f69c9 100644
--- a/confirmationui/aidl/android/hardware/confirmationui/TestModeCommands.aidl
+++ b/confirmationui/aidl/android/hardware/confirmationui/TestModeCommands.aidl
@@ -34,15 +34,15 @@
 enum TestModeCommands {
     /**
      * Simulates the user pressing the OK button on the UI. If no operation is pending
-     * ResponseCode::Ignored must be returned. A pending operation is finalized successfully
+     * IConfirmationUI::IGNORED must be returned. A pending operation is finalized successfully
      * see IConfirmationResultCallback::result, however, the test key
      * (see IConfirmationUI::TEST_KEY_BYTE) MUST be used to generate the confirmation token.
      */
     OK_EVENT = 0,
     /**
      * Simulates the user pressing the CANCEL button on the UI. If no operation is pending
-     * Result::Ignored must be returned. A pending operation is finalized as specified in
-     * IConfirmationResultCallback.hal.
+     * IConfirmationUI::IGNORED must be returned. A pending operation is finalized as specified in
+     * IConfirmationResultCallback.aidl.
      */
     CANCEL_EVENT = 1,
 }
diff --git a/drm/aidl/vts/drm_hal_common.cpp b/drm/aidl/vts/drm_hal_common.cpp
index f5ef0e7..f0445a5 100644
--- a/drm/aidl/vts/drm_hal_common.cpp
+++ b/drm/aidl/vts/drm_hal_common.cpp
@@ -263,6 +263,9 @@
 }
 
 bool DrmHalTest::isCryptoSchemeSupported(Uuid uuid, SecurityLevel level, std::string mime) {
+    if (drmFactory == nullptr) {
+        return false;
+    }
     CryptoSchemes schemes{};
     auto ret = drmFactory->getSupportedCryptoSchemes(&schemes);
     EXPECT_OK(ret);
diff --git a/health/aidl/vts/functional/VtsHalHealthTargetTest.cpp b/health/aidl/vts/functional/VtsHalHealthTargetTest.cpp
index dd0bd81..6506ea2 100644
--- a/health/aidl/vts/functional/VtsHalHealthTargetTest.cpp
+++ b/health/aidl/vts/functional/VtsHalHealthTargetTest.cpp
@@ -229,8 +229,14 @@
  * Tests the values returned by getChargingPolicy() from interface IHealth.
  */
 TEST_P(HealthAidl, getChargingPolicy) {
+    int32_t version = 0;
+    auto status = health->getInterfaceVersion(&version);
+    ASSERT_TRUE(status.isOk()) << status;
+    if (version < 2) {
+        GTEST_SKIP() << "Support in health hal v2 for EU Ecodesign";
+    }
     BatteryChargingPolicy value;
-    auto status = health->getChargingPolicy(&value);
+    status = health->getChargingPolicy(&value);
     ASSERT_THAT(status, AnyOf(IsOk(), ExceptionIs(EX_UNSUPPORTED_OPERATION)));
     if (!status.isOk()) return;
     ASSERT_THAT(value, IsValidEnum<BatteryChargingPolicy>());
@@ -241,10 +247,17 @@
  * value by getChargingPolicy() from interface IHealth.
  */
 TEST_P(HealthAidl, setChargingPolicy) {
+    int32_t version = 0;
+    auto status = health->getInterfaceVersion(&version);
+    ASSERT_TRUE(status.isOk()) << status;
+    if (version < 2) {
+        GTEST_SKIP() << "Support in health hal v2 for EU Ecodesign";
+    }
+
     BatteryChargingPolicy value;
 
     /* set ChargingPolicy*/
-    auto status = health->setChargingPolicy(static_cast<BatteryChargingPolicy>(2));  // LONG_LIFE
+    status = health->setChargingPolicy(static_cast<BatteryChargingPolicy>(2));  // LONG_LIFE
     ASSERT_THAT(status, AnyOf(IsOk(), ExceptionIs(EX_UNSUPPORTED_OPERATION)));
     if (!status.isOk()) return;
 
@@ -273,8 +286,15 @@
  * Tests the values returned by getBatteryHealthData() from interface IHealth.
  */
 TEST_P(HealthAidl, getBatteryHealthData) {
+    int32_t version = 0;
+    auto status = health->getInterfaceVersion(&version);
+    ASSERT_TRUE(status.isOk()) << status;
+    if (version < 2) {
+        GTEST_SKIP() << "Support in health hal v2 for EU Ecodesign";
+    }
+
     BatteryHealthData value;
-    auto status = health->getBatteryHealthData(&value);
+    status = health->getBatteryHealthData(&value);
     ASSERT_THAT(status, AnyOf(IsOk(), ExceptionIs(EX_UNSUPPORTED_OPERATION)));
     if (!status.isOk()) return;
     ASSERT_THAT(value, IsValidHealthData());
diff --git a/power/stats/aidl/default/Android.bp b/power/stats/aidl/default/Android.bp
index 66be5f9..d3ab29b 100644
--- a/power/stats/aidl/default/Android.bp
+++ b/power/stats/aidl/default/Android.bp
@@ -30,7 +30,7 @@
     shared_libs: [
         "libbase",
         "libbinder_ndk",
-        "android.hardware.power.stats-V1-ndk",
+        "android.hardware.power.stats-V2-ndk",
     ],
     srcs: [
         "main.cpp",
diff --git a/power/stats/aidl/default/power.stats-default.xml b/power/stats/aidl/default/power.stats-default.xml
index 3b1a216..b64ea7e 100644
--- a/power/stats/aidl/default/power.stats-default.xml
+++ b/power/stats/aidl/default/power.stats-default.xml
@@ -1,6 +1,7 @@
 <manifest version="1.0" type="device">
     <hal format="aidl">
         <name>android.hardware.power.stats</name>
+        <version>2</version>
         <fqname>IPowerStats/default</fqname>
     </hal>
 </manifest>
diff --git a/security/dice/aidl/vts/functional/dice_demote_test.rs b/security/dice/aidl/vts/functional/dice_demote_test.rs
index 02ff2a4..1a17ec7 100644
--- a/security/dice/aidl/vts/functional/dice_demote_test.rs
+++ b/security/dice/aidl/vts/functional/dice_demote_test.rs
@@ -12,7 +12,6 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-use diced_open_dice_cbor as dice;
 use diced_sample_inputs;
 use diced_utils;
 use std::convert::TryInto;
@@ -44,14 +43,7 @@
         )
         .unwrap();
 
-        let input_values: Vec<diced_utils::InputValues> = input_values
-            .iter()
-            .map(|v| v.into())
-            .collect();
-
-        let artifacts = artifacts
-            .execute_steps(input_values.iter().map(|v| v as &dyn dice::InputValues))
-            .unwrap();
+        let artifacts = artifacts.execute_steps(input_values.iter()).unwrap();
         let (cdi_attest, cdi_seal, bcc) = artifacts.into_tuple();
         let from_former = diced_utils::make_bcc_handover(
             cdi_attest[..].try_into().unwrap(),
diff --git a/security/dice/aidl/vts/functional/dice_test.rs b/security/dice/aidl/vts/functional/dice_test.rs
index 574b634..190f187 100644
--- a/security/dice/aidl/vts/functional/dice_test.rs
+++ b/security/dice/aidl/vts/functional/dice_test.rs
@@ -12,10 +12,9 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-use diced_open_dice_cbor as dice;
 use diced_sample_inputs;
 use diced_utils;
-use std::convert::{TryInto, Into};
+use std::convert::TryInto;
 
 mod utils;
 use utils::with_connection;
@@ -44,14 +43,7 @@
         )
         .unwrap();
 
-        let input_values: Vec<diced_utils::InputValues> = input_values
-            .iter()
-            .map(|v| v.into())
-            .collect();
-
-        let artifacts = artifacts
-            .execute_steps(input_values.iter().map(|v| v as &dyn dice::InputValues))
-            .unwrap();
+        let artifacts = artifacts.execute_steps(input_values.iter()).unwrap();
         let (cdi_attest, cdi_seal, bcc) = artifacts.into_tuple();
         let from_former = diced_utils::make_bcc_handover(
             cdi_attest[..].try_into().unwrap(),
diff --git a/security/keymint/aidl/vts/functional/KeyBlobUpgradeTest.cpp b/security/keymint/aidl/vts/functional/KeyBlobUpgradeTest.cpp
index 574366e..6892442 100644
--- a/security/keymint/aidl/vts/functional/KeyBlobUpgradeTest.cpp
+++ b/security/keymint/aidl/vts/functional/KeyBlobUpgradeTest.cpp
@@ -297,14 +297,14 @@
                                 .Authorization(TAG_NO_AUTH_REQUIRED)},
             {"hmac-key", AuthorizationSetBuilder()
                                  .HmacKey(128)
-                                 .Digest(Digest::SHA1)
+                                 .Digest(Digest::SHA_2_256)
                                  .Authorization(TAG_MIN_MAC_LENGTH, 128)
                                  .Authorization(TAG_NO_AUTH_REQUIRED)},
             {"rsa-key", AuthorizationSetBuilder()
                                 .RsaEncryptionKey(2048, 65537)
                                 .Authorization(TAG_PURPOSE, KeyPurpose::SIGN)
                                 .Digest(Digest::NONE)
-                                .Digest(Digest::SHA1)
+                                .Digest(Digest::SHA_2_256)
                                 .Padding(PaddingMode::NONE)
                                 .Authorization(TAG_NO_AUTH_REQUIRED)
                                 .SetDefaultValidity()},
@@ -314,7 +314,7 @@
                             .EcdsaSigningKey(EcCurve::P_256)
                             .Authorization(TAG_PURPOSE, KeyPurpose::AGREE_KEY)
                             .Digest(Digest::NONE)
-                            .Digest(Digest::SHA1)
+                            .Digest(Digest::SHA_2_256)
                             .Authorization(TAG_NO_AUTH_REQUIRED)
                             .SetDefaultValidity(),
             },
@@ -471,7 +471,7 @@
                 string plaintext = DecryptMessage(keyblob, ciphertext, builder);
                 EXPECT_EQ(message, plaintext);
             } else if (name.find("hmac-key") != std::string::npos) {
-                builder.Digest(Digest::SHA1);
+                builder.Digest(Digest::SHA_2_256);
                 auto sign_builder = builder;
                 sign_builder.Authorization(TAG_MAC_LENGTH, 128);
                 string tag = SignMessage(keyblob, message, sign_builder);
@@ -481,7 +481,7 @@
                 string signature = SignMessage(keyblob, message, builder);
                 LocalVerifyMessage(cert, message, signature, builder);
             } else if (name.find("p256-key") != std::string::npos) {
-                builder.Digest(Digest::SHA1);
+                builder.Digest(Digest::SHA_2_256);
                 string signature = SignMessage(keyblob, message, builder);
                 LocalVerifyMessage(cert, message, signature, builder);
             } else if (name.find("ed25519-key") != std::string::npos) {