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

Commit 8ac7d593 authored by Yifan Hong's avatar Yifan Hong Committed by Automerger Merge Worker
Browse files

Merge changes from topic "runtime_skipcache" am: af04506e

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

Change-Id: I5b8dbbebca9353d38544d9f4d282d046cfab6556
parents 77ac6b7d af04506e
Loading
Loading
Loading
Loading
+2 −3
Original line number Original line Diff line number Diff line
@@ -846,8 +846,7 @@ static jboolean android_os_Debug_isVmapStack(JNIEnv *env, jobject clazz)
    } cfg_state = CONFIG_UNKNOWN;
    } cfg_state = CONFIG_UNKNOWN;


    if (cfg_state == CONFIG_UNKNOWN) {
    if (cfg_state == CONFIG_UNKNOWN) {
        auto runtime_info = vintf::VintfObject::GetInstance()
        auto runtime_info = vintf::VintfObject::GetInstance()->getRuntimeInfo(
                                    ->getRuntimeInfo(false /* skip cache */,
                vintf::RuntimeInfo::FetchFlag::CONFIG_GZ);
                vintf::RuntimeInfo::FetchFlag::CONFIG_GZ);
        CHECK(runtime_info != nullptr) << "Kernel configs cannot be fetched. b/151092221";
        CHECK(runtime_info != nullptr) << "Kernel configs cannot be fetched. b/151092221";
        const std::map<std::string, std::string>& configs = runtime_info->kernelConfigs();
        const std::map<std::string, std::string>& configs = runtime_info->kernelConfigs();
+8 −10
Original line number Original line Diff line number Diff line
@@ -30,13 +30,11 @@ using vintf::RuntimeInfo;
using vintf::VintfObject;
using vintf::VintfObject;


#define MAP_STRING_METHOD(javaMethod, cppString, flags)                                  \
#define MAP_STRING_METHOD(javaMethod, cppString, flags)                                  \
    static jstring android_os_VintfRuntimeInfo_##javaMethod(JNIEnv* env, jclass clazz) \
    static jstring android_os_VintfRuntimeInfo_##javaMethod(JNIEnv* env, jclass clazz) { \
    {                                                                                  \
        std::shared_ptr<const RuntimeInfo> info = VintfObject::GetRuntimeInfo(flags);    \
        std::shared_ptr<const RuntimeInfo> info = VintfObject::GetRuntimeInfo(         \
                false /* skipCache */, flags);                                         \
        if (info == nullptr) return nullptr;                                             \
        if (info == nullptr) return nullptr;                                             \
        return env->NewStringUTF((cppString).c_str());                                   \
        return env->NewStringUTF((cppString).c_str());                                   \
    }                                                                                  \
    }


MAP_STRING_METHOD(getCpuInfo, info->cpuInfo(), RuntimeInfo::FetchFlag::CPU_INFO);
MAP_STRING_METHOD(getCpuInfo, info->cpuInfo(), RuntimeInfo::FetchFlag::CPU_INFO);
MAP_STRING_METHOD(getOsName, info->osName(), RuntimeInfo::FetchFlag::CPU_VERSION);
MAP_STRING_METHOD(getOsName, info->osName(), RuntimeInfo::FetchFlag::CPU_VERSION);
@@ -54,8 +52,8 @@ MAP_STRING_METHOD(getBootVbmetaAvbVersion, vintf::to_string(info->bootVbmetaAvbV


static jlong android_os_VintfRuntimeInfo_getKernelSepolicyVersion(JNIEnv *env, jclass clazz)
static jlong android_os_VintfRuntimeInfo_getKernelSepolicyVersion(JNIEnv *env, jclass clazz)
{
{
    std::shared_ptr<const RuntimeInfo> info = VintfObject::GetRuntimeInfo(
    std::shared_ptr<const RuntimeInfo> info =
        false /* skipCache */, RuntimeInfo::FetchFlag::POLICYVERS);
            VintfObject::GetRuntimeInfo(RuntimeInfo::FetchFlag::POLICYVERS);
    if (info == nullptr) return 0;
    if (info == nullptr) return 0;
    return static_cast<jlong>(info->kernelSepolicyVersion());
    return static_cast<jlong>(info->kernelSepolicyVersion());
}
}