Update libaudiohal with AudioHalVersionInfo
Bug: 261129656
Test: atest VtsHalAudioEffectTargetTest
Flash to Cuttlefish and Panther and check audio.
Merged-In: Ieace37b25dc03d50048b35b1c63b4ec5f39257c8
Change-Id: Ieace37b25dc03d50048b35b1c63b4ec5f39257c8
diff --git a/media/libaudiohal/impl/DevicesFactoryHalAidl.h b/media/libaudiohal/impl/DevicesFactoryHalAidl.h
new file mode 100644
index 0000000..f4812af
--- /dev/null
+++ b/media/libaudiohal/impl/DevicesFactoryHalAidl.h
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+#include <aidl/android/hardware/audio/core/IConfig.h>
+#include <media/audiohal/DevicesFactoryHalInterface.h>
+#include <utils/RefBase.h>
+
+using namespace ::aidl::android::hardware::audio::core;
+
+namespace android {
+
+class DevicesFactoryHalAidl : public DevicesFactoryHalInterface
+{
+ public:
+ explicit DevicesFactoryHalAidl(std::shared_ptr<IConfig> iConfig);
+ void onFirstRef() override;
+
+ // Opens a device with the specified name. To close the device, it is
+ // necessary to release references to the returned object.
+ status_t openDevice(const char *name, sp<DeviceHalInterface> *device) override;
+
+ status_t getHalPids(std::vector<pid_t> *pids) override;
+
+ status_t setCallbackOnce(sp<DevicesFactoryHalCallback> callback) override;
+
+ android::detail::AudioHalVersionInfo getHalVersion() const override;
+
+ private:
+ std::shared_ptr<IConfig> mIConfig;
+ virtual ~DevicesFactoryHalAidl() = default;
+};
+
+} // namespace android