libaudiohal: Optimize loading for minor version upgrades
Make libaudiohal@7.1 to contain clients for core HAL
V7.1 and effect HAL V7.0. This is to avoid loading
both libaudiohal@7.1 (for core) and libaudiohal@7.0
(for effects).
Update the loader to figure out maximum minor version
and only load the library for that version.
Implemented proper conversion for the Result type
from the a.h.audio.effect library.
Bug: 219730472
Test: adb shell dumpsys meminfo
Change-Id: I44dd6c77505f6bbf8897e10b083e99e36730b43d
diff --git a/media/libaudiohal/impl/EffectsFactoryHalHidlEntry.cpp b/media/libaudiohal/impl/EffectsFactoryHalHidlEntry.cpp
new file mode 100644
index 0000000..2c6f2c6
--- /dev/null
+++ b/media/libaudiohal/impl/EffectsFactoryHalHidlEntry.cpp
@@ -0,0 +1,21 @@
+/*
+ * 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.
+ */
+
+extern "C" void* createIEffectsFactoryImpl();
+
+extern "C" __attribute__((visibility("default"))) void* createIEffectsFactory() {
+ return createIEffectsFactoryImpl();
+}