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

Commit 305862a8 authored by LuK1337's avatar LuK1337
Browse files

sm8150-common: Call oem_qmi_access_func() on RIL init

This makes us dump NV items on boot which in the end fixes invalid MAC
address for BT and WLAN.

This change should be reverted as soon as RIL stack is fixed.

Change-Id: I4a2756c91230f43d0c9528d1a685aa7c90723590
parent 47408bd1
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -370,6 +370,7 @@ PRODUCT_PACKAGES += \
    android.hardware.radio.config@1.0 \
    android.hardware.secure_element@1.0 \
    libprotobuf-cpp-full \
    libril_shim \
    librmnetctl \
    libxml2

+3 −0
Original line number Diff line number Diff line
@@ -63,6 +63,9 @@ function blob_fixup() {
        system_ext/lib64/libwfdnative.so)
            sed -i "s/android.hidl.base@1.0.so/libhidlbase.so\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00/" "${2}"
            ;;
        vendor/bin/hw/qcrild)
            "${PATCHELF}" --add-needed libril_shim.so "${2}"
            ;;
    esac
}

shims/Android.bp

0 → 100644
+20 −0
Original line number Diff line number Diff line
//
// Copyright (C) 2021 The LineageOS 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.

cc_library {
    name: "libril_shim",
    srcs: ["libril_shim.cpp"],
    vendor: true
}

shims/libril_shim.cpp

0 → 100644
+30 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2021 The LineageOS 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.
 */

#include <dlfcn.h>

typedef void (*qcril_other_init_t)();
typedef void (*oem_qmi_access_func_t)();

extern "C" void qcril_other_init() {
    static auto qcril_other_init_orig = reinterpret_cast<qcril_other_init_t>(
            dlsym(RTLD_NEXT, "qcril_other_init"));
    static auto oem_qmi_access_func_orig = reinterpret_cast<oem_qmi_access_func_t>(
            dlsym(RTLD_NEXT, "_Z19oem_qmi_access_funcv"));

    oem_qmi_access_func_orig();
    qcril_other_init_orig();
}