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

Commit 6dd512f5 authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge changes from topic "cherrypicker-L48700030005938629:N88900030094104124"...

Merge changes from topic "cherrypicker-L48700030005938629:N88900030094104124" into main am: 91bc552c am: d537bf92

Original change: https://android-review.googlesource.com/c/platform/frameworks/av/+/3196527



Change-Id: I523f0c0ae2093210e97c8b06958521faee3ae9ee
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 849ec4a8 d537bf92
Loading
Loading
Loading
Loading
+26 −0
Original line number Diff line number Diff line
@@ -25,6 +25,32 @@

namespace android {

/*
 * Helper macro to add instance name, function name in logs
 * classes should provide getInstanceName and getClassName API to use these macros.
 * print function names along with instance name.
 *
 * Usage:
 *  AUGMENT_LOG(I, "hello!");
 *  AUGMENT_LOG(W, "value: %d", value);
 *
 * AUGMENT_LOG_IF(D, value < 0, "negative");
 * AUGMENT_LOG_IF(E, value < 0, "bad value: %d", value);
 */

#define AUGMENT_LOG(level, ...)                                                              \
    ALOG##level("[%s] %s: " __android_second(0, __VA_ARGS__, ""), getInstanceName().c_str(), \
                __func__ __android_rest(__VA_ARGS__))

#define AUGMENT_LOG_IF(level, cond, ...)                                     \
    ALOG##level##_IF(cond, "[%s] %s: " __android_second(0, __VA_ARGS__, ""), \
                     getInstanceName().c_str(), __func__ __android_rest(__VA_ARGS__))
// Used to register an entry into the function
#define LOG_ENTRY() ALOGD("[%s] %s", getInstanceName().c_str(), __func__)

// entry logging as verbose level
#define LOG_ENTRY_V() ALOGV("[%s] %s", getInstanceName().c_str(), __func__)

class HalDeathHandler {
  public:
    static HalDeathHandler& getInstance();
+6 −4
Original line number Diff line number Diff line
@@ -49,13 +49,15 @@ class Args {

class ConversionHelperAidl {
  protected:
    ConversionHelperAidl(std::string_view className) : mClassName(className) {}
    ConversionHelperAidl(std::string_view className, std::string_view instanceName)
        : mClassName(className), mInstanceName(instanceName) {}

    const std::string& getClassName() const {
        return mClassName;
    }
    const std::string& getClassName() const { return mClassName; }

    const std::string& getInstanceName() const { return mInstanceName; }

    const std::string mClassName;
    const std::string mInstanceName;
};

// 'action' must accept a value of type 'T' and return 'status_t'.
+376 −303

File changed.

Preview size limit exceeded, changes collapsed.

+0 −1
Original line number Diff line number Diff line
@@ -235,7 +235,6 @@ class DeviceHalAidl : public DeviceHalInterface, public ConversionHelperAidl,
    // MicrophoneInfoProvider implementation
    MicrophoneInfoProvider::Info const* getMicrophoneInfo() override;

    const std::string mInstance;
    const std::shared_ptr<::aidl::android::hardware::audio::core::IModule> mModule;
    const std::shared_ptr<::aidl::android::media::audio::IHalAdapterVendorExtension> mVendorExt;
    const std::shared_ptr<::aidl::android::hardware::audio::core::ITelephony> mTelephony;
+82 −83

File changed.

Preview size limit exceeded, changes collapsed.

Loading