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

Commit 77ac6b7d authored by Yifan Hong's avatar Yifan Hong Committed by Automerger Merge Worker
Browse files

Debug.isVmapStack reads kernel configs only am: 85429d85

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1369185

Change-Id: I5940c6fdbd3a973a4da9f00d5d8e0617239b8c10
parents 612715db 85429d85
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -846,8 +846,11 @@ static jboolean android_os_Debug_isVmapStack(JNIEnv *env, jobject clazz)
    } cfg_state = CONFIG_UNKNOWN;

    if (cfg_state == CONFIG_UNKNOWN) {
        const std::map<std::string, std::string> configs =
            vintf::VintfObject::GetInstance()->getRuntimeInfo()->kernelConfigs();
        auto runtime_info = vintf::VintfObject::GetInstance()
                                    ->getRuntimeInfo(false /* skip cache */,
                                                     vintf::RuntimeInfo::FetchFlag::CONFIG_GZ);
        CHECK(runtime_info != nullptr) << "Kernel configs cannot be fetched. b/151092221";
        const std::map<std::string, std::string>& configs = runtime_info->kernelConfigs();
        std::map<std::string, std::string>::const_iterator it = configs.find("CONFIG_VMAP_STACK");
        cfg_state = (it != configs.end() && it->second == "y") ? CONFIG_SET : CONFIG_UNSET;
    }