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

Commit 95936b6e authored by Yifan Hong's avatar Yifan Hong Committed by Automerger Merge Worker
Browse files

Merge changes from topic "runtime_skipcache" am: af04506e am: 8ac7d593 am:...

Merge changes from topic "runtime_skipcache" am: af04506e am: 8ac7d593 am: 71c3f1d8 am: bc03370a am: 62c8bd95

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

Change-Id: I22f4808ef36895049baeeceaffc7d2084beb32de
parents 0df0c8b0 62c8bd95
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -853,8 +853,7 @@ static jboolean android_os_Debug_isVmapStack(JNIEnv *env, jobject clazz)
    } cfg_state = CONFIG_UNKNOWN;

    if (cfg_state == CONFIG_UNKNOWN) {
        auto runtime_info = vintf::VintfObject::GetInstance()
                                    ->getRuntimeInfo(false /* skip cache */,
        auto runtime_info = vintf::VintfObject::GetInstance()->getRuntimeInfo(
                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();
+8 −10
Original line number Diff line number Diff line
@@ -30,13 +30,11 @@ using vintf::RuntimeInfo;
using vintf::VintfObject;

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

MAP_STRING_METHOD(getCpuInfo, info->cpuInfo(), RuntimeInfo::FetchFlag::CPU_INFO);
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)
{
    std::shared_ptr<const RuntimeInfo> info = VintfObject::GetRuntimeInfo(
        false /* skipCache */, RuntimeInfo::FetchFlag::POLICYVERS);
    std::shared_ptr<const RuntimeInfo> info =
            VintfObject::GetRuntimeInfo(RuntimeInfo::FetchFlag::POLICYVERS);
    if (info == nullptr) return 0;
    return static_cast<jlong>(info->kernelSepolicyVersion());
}