Merge changes from topic "runtime_skipcache" am: af04506edd am: 8ac7d59373 am: 71c3f1d873 am: bc03370ae9

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

Change-Id: I2f83ef63367df41f080a0f50508db9cfefdf7625
This commit is contained in:
Yifan Hong
2020-07-22 21:12:41 +00:00
committed by Automerger Merge Worker
2 changed files with 10 additions and 13 deletions

View File

@@ -853,9 +853,8 @@ 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();
std::map<std::string, std::string>::const_iterator it = configs.find("CONFIG_VMAP_STACK"); std::map<std::string, std::string>::const_iterator it = configs.find("CONFIG_VMAP_STACK");

View File

@@ -29,14 +29,12 @@ namespace android {
using vintf::RuntimeInfo; 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( \ if (info == nullptr) return nullptr; \
false /* skipCache */, flags); \ return env->NewStringUTF((cppString).c_str()); \
if (info == nullptr) return nullptr; \ }
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());
} }