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

Commit 7ddf867a authored by Andy Hung's avatar Andy Hung
Browse files

Fix dlopen library load

dlopen does not go through default library path search
if there is a '/' in the library name.

Bug: 27905931
Change-Id: Id9dbfe6938499ef783222c6851a65d1f7dd611cf
parent f9583c36
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -22,7 +22,11 @@
#include <audio_hw.h>
#include <dlfcn.h>

#define LIB_SPEAKER_BUNDLE "soundfx/libspeakerbundle.so"
#ifdef __LP64__
#define LIB_SPEAKER_BUNDLE "/system/lib64/soundfx/libspeakerbundle.so"
#else
#define LIB_SPEAKER_BUNDLE "/system/lib/soundfx/libspeakerbundle.so"
#endif

typedef void (*set_mode_t)(int);
typedef void (*set_speaker_on_t)(bool);
+5 −1
Original line number Diff line number Diff line
@@ -31,7 +31,11 @@
#define XSTR(x) STR(x)
#define STR(x) #x

#define SOUND_TRIGGER_LIBRARY_PATH "hw/sound_trigger.primary.%s.so"
#ifdef __LP64__
#define SOUND_TRIGGER_LIBRARY_PATH "/system/vendor/lib64/hw/sound_trigger.primary.%s.so"
#else
#define SOUND_TRIGGER_LIBRARY_PATH "/system/vendor/lib/hw/sound_trigger.primary.%s.so"
#endif

struct sound_trigger_info  {
    struct sound_trigger_session_info st_ses;
+8 −2
Original line number Diff line number Diff line
@@ -27,8 +27,14 @@
#include <audio_route/audio_route.h>
#include "voice.h"

#define VISUALIZER_LIBRARY_PATH "soundfx/libqcomvisualizer.so"
#define OFFLOAD_EFFECTS_BUNDLE_LIBRARY_PATH "soundfx/libqcompostprocbundle.so"
// dlopen() does not go through default library path search if there is a "/" in the library name.
#ifdef __LP64__
#define VISUALIZER_LIBRARY_PATH "/system/lib64/soundfx/libqcomvisualizer.so"
#define OFFLOAD_EFFECTS_BUNDLE_LIBRARY_PATH "/system/lib64/soundfx/libqcompostprocbundle.so"
#else
#define VISUALIZER_LIBRARY_PATH "/system/lib/soundfx/libqcomvisualizer.so"
#define OFFLOAD_EFFECTS_BUNDLE_LIBRARY_PATH "/system/lib/soundfx/libqcompostprocbundle.so"
#endif
#define ADM_LIBRARY_PATH "libadm.so"

/* Flags used to initialize acdb_settings variable that goes to ACDB library */