VINTF: Remove skipCache boolean.

Test: pass
Change-Id: Iec1aa7f7c2ef203ff2f1fd6adb456baec24c075a
This commit is contained in:
Yifan Hong
2020-07-21 17:12:43 -07:00
parent 85429d850f
commit 9e55b45cdf
2 changed files with 10 additions and 13 deletions

View File

@@ -846,9 +846,8 @@ 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 */,
vintf::RuntimeInfo::FetchFlag::CONFIG_GZ);
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();
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::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); \
if (info == nullptr) return nullptr; \
return env->NewStringUTF((cppString).c_str()); \
} \
#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(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());
}