diff options
| author | 2020-07-22 20:06:39 +0000 | |
|---|---|---|
| committer | 2020-07-22 20:06:39 +0000 | |
| commit | af04506eddf6f280f39a5f8e0d1de95e2d3e6ceb (patch) | |
| tree | 53f9ade50d49d4f173a24470ea4a25c0075ee430 | |
| parent | 059739f34a60b5ac78e42cf4f209760dd9a3c21b (diff) | |
| parent | 9e55b45cdf939f06d51bfb9a5d344d1b809b705f (diff) | |
Merge changes from topic "runtime_skipcache"
* changes:
VINTF: Remove skipCache boolean.
Debug.isVmapStack reads kernel configs only
| -rw-r--r-- | core/jni/android_os_Debug.cpp | 6 | ||||
| -rw-r--r-- | core/jni/android_os_VintfRuntimeInfo.cpp | 18 |
2 files changed, 12 insertions, 12 deletions
diff --git a/core/jni/android_os_Debug.cpp b/core/jni/android_os_Debug.cpp index cd3611546852..1037713c6af9 100644 --- a/core/jni/android_os_Debug.cpp +++ b/core/jni/android_os_Debug.cpp @@ -846,8 +846,10 @@ 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( + 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; } diff --git a/core/jni/android_os_VintfRuntimeInfo.cpp b/core/jni/android_os_VintfRuntimeInfo.cpp index 9379ea6dcd10..b0271b9e92af 100644 --- a/core/jni/android_os_VintfRuntimeInfo.cpp +++ b/core/jni/android_os_VintfRuntimeInfo.cpp @@ -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()); } |