Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 82d6654a authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge changes from topic "upstream-hal-v6"

* changes:
  Rename of the Vendor HAL
  Support Audio HAL V6
  libaudioHAL: reduce version specific code
  Avoid querying the audio service twice
parents e4ff5510 b60cb13a
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -6,10 +6,10 @@ service audioserver /system/bin/audioserver
    capabilities BLOCK_SUSPEND
    ioprio rt 4
    writepid /dev/cpuset/foreground/tasks /dev/stune/foreground/tasks
    onrestart restart vendor.audio-hal-2-0
    onrestart restart vendor.audio-hal
    onrestart restart vendor.audio-hal-4-0-msd
    # Keep the original service name for backward compatibility when upgrading
    # O-MR1 devices with framework-only.
    # Keep the original service names for backward compatibility
    onrestart restart vendor.audio-hal-2-0
    onrestart restart audio-hal-2-0

on property:vts.native_server.on=1
+3 −7
Original line number Diff line number Diff line
@@ -13,20 +13,16 @@ cc_library_shared {
    ],

    shared_libs: [
        "android.hardware.audio.effect@2.0",
        "android.hardware.audio.effect@4.0",
        "android.hardware.audio.effect@5.0",
        "android.hardware.audio@2.0",
        "android.hardware.audio@4.0",
        "android.hardware.audio@5.0",
        "libaudiohal@2.0",
        "libaudiohal@4.0",
        "libaudiohal@5.0",
        "libaudiohal@6.0",
        "libutils",
    ],

    header_libs: [
        "libaudiohal_headers"
        "libaudiohal_headers",
        "libbase_headers",
    ]
}

+4 −14
Original line number Diff line number Diff line
@@ -14,26 +14,16 @@
 * limitations under the License.
 */

#include <android/hardware/audio/2.0/IDevicesFactory.h>
#include <android/hardware/audio/4.0/IDevicesFactory.h>
#include <android/hardware/audio/5.0/IDevicesFactory.h>

#include <libaudiohal/FactoryHalHidl.h>

#include <media/audiohal/DevicesFactoryHalInterface.h>

namespace android {

// static
sp<DevicesFactoryHalInterface> DevicesFactoryHalInterface::create() {
    if (hardware::audio::V5_0::IDevicesFactory::getService() != nullptr) {
        return V5_0::createDevicesFactoryHal();
    }
    if (hardware::audio::V4_0::IDevicesFactory::getService() != nullptr) {
        return V4_0::createDevicesFactoryHal();
    }
    if (hardware::audio::V2_0::IDevicesFactory::getService() != nullptr) {
        return V2_0::createDevicesFactoryHal();
    }
    return nullptr;
    return createPreferedImpl<DevicesFactoryHalInterface>();
}

} // namespace android
+4 −15
Original line number Diff line number Diff line
/*
 * Copyright (C) 2016 The Android Open Source Project
 * Copyright (C) 2017 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.
@@ -14,26 +14,15 @@
 * limitations under the License.
 */

#include <android/hardware/audio/effect/2.0/IEffectsFactory.h>
#include <android/hardware/audio/effect/4.0/IEffectsFactory.h>
#include <android/hardware/audio/effect/5.0/IEffectsFactory.h>

#include <libaudiohal/FactoryHalHidl.h>

#include <media/audiohal/EffectsFactoryHalInterface.h>

namespace android {

// static
sp<EffectsFactoryHalInterface> EffectsFactoryHalInterface::create() {
    if (hardware::audio::effect::V5_0::IEffectsFactory::getService() != nullptr) {
        return effect::V5_0::createEffectsFactoryHal();
    }
    if (hardware::audio::effect::V4_0::IEffectsFactory::getService() != nullptr) {
        return effect::V4_0::createEffectsFactoryHal();
    }
    if (hardware::audio::effect::V2_0::IEffectsFactory::getService() != nullptr) {
        return effect::V2_0::createEffectsFactoryHal();
    }
    return nullptr;
    return createPreferedImpl<EffectsFactoryHalInterface>();
}

// static
+17 −0
Original line number Diff line number Diff line
@@ -99,3 +99,20 @@ cc_library_shared {
        "-include common/all-versions/VersionMacro.h",
    ]
}

cc_library_shared {
    name: "libaudiohal@6.0",
    defaults: ["libaudiohal_default"],
    shared_libs: [
        "android.hardware.audio.common@6.0",
        "android.hardware.audio.common@6.0-util",
        "android.hardware.audio.effect@6.0",
        "android.hardware.audio@6.0",
    ],
    cflags: [
        "-DMAJOR_VERSION=6",
        "-DMINOR_VERSION=0",
        "-include common/all-versions/VersionMacro.h",
    ]
}
Loading