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

Commit b0dfbe6e authored by Glenn Kasten's avatar Glenn Kasten Committed by android-build-merger
Browse files

Merge "No need for access() before dlopen()" into nyc-dev

am: 62e3222e

* commit '62e3222e':
  No need for access() before dlopen()

Change-Id: Id3b62fcb6927e890570933858c60ce1416884c08
parents 9d91ddea 62e3222e
Loading
Loading
Loading
Loading
+47 −53
Original line number Diff line number Diff line
@@ -3010,10 +3010,9 @@ static int adev_open(const hw_module_t *module, const char *name,
    adev->extspk = audio_extn_extspk_init(adev);
    audio_extn_sound_trigger_init(adev);

    if (access(VISUALIZER_LIBRARY_PATH, R_OK) == 0) {
    adev->visualizer_lib = dlopen(VISUALIZER_LIBRARY_PATH, RTLD_NOW);
    if (adev->visualizer_lib == NULL) {
            ALOGE("%s: DLOPEN failed for %s", __func__, VISUALIZER_LIBRARY_PATH);
        ALOGW("%s: DLOPEN failed for %s", __func__, VISUALIZER_LIBRARY_PATH);
    } else {
        ALOGV("%s: DLOPEN successful for %s", __func__, VISUALIZER_LIBRARY_PATH);
        adev->visualizer_start_output =
@@ -3023,12 +3022,10 @@ static int adev_open(const hw_module_t *module, const char *name,
                    (int (*)(audio_io_handle_t, int))dlsym(adev->visualizer_lib,
                                                    "visualizer_hal_stop_output");
    }
    }

    if (access(OFFLOAD_EFFECTS_BUNDLE_LIBRARY_PATH, R_OK) == 0) {
    adev->offload_effects_lib = dlopen(OFFLOAD_EFFECTS_BUNDLE_LIBRARY_PATH, RTLD_NOW);
    if (adev->offload_effects_lib == NULL) {
            ALOGE("%s: DLOPEN failed for %s", __func__,
        ALOGW("%s: DLOPEN failed for %s", __func__,
              OFFLOAD_EFFECTS_BUNDLE_LIBRARY_PATH);
    } else {
        ALOGV("%s: DLOPEN successful for %s", __func__,
@@ -3040,12 +3037,10 @@ static int adev_open(const hw_module_t *module, const char *name,
                    (int (*)(audio_io_handle_t, int))dlsym(adev->offload_effects_lib,
                                     "offload_effects_bundle_hal_stop_output");
    }
    }

    if (access(ADM_LIBRARY_PATH, R_OK) == 0) {
    adev->adm_lib = dlopen(ADM_LIBRARY_PATH, RTLD_NOW);
    if (adev->adm_lib == NULL) {
            ALOGE("%s: DLOPEN failed for %s", __func__, ADM_LIBRARY_PATH);
        ALOGW("%s: DLOPEN failed for %s", __func__, ADM_LIBRARY_PATH);
    } else {
        ALOGV("%s: DLOPEN successful for %s", __func__, ADM_LIBRARY_PATH);
        adev->adm_init = (adm_init_t)
@@ -3063,7 +3058,6 @@ static int adev_open(const hw_module_t *module, const char *name,
        adev->adm_abandon_focus = (adm_abandon_focus_t)
                                dlsym(adev->adm_lib, "adm_abandon_focus");
    }
    }

    adev->bt_wb_speech_enabled = false;
    adev->enable_voicerx = false;