diff options
Diffstat (limited to 'runtime/app_info.cc')
| -rw-r--r-- | runtime/app_info.cc | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/runtime/app_info.cc b/runtime/app_info.cc index c72951eebc..3fef5651b0 100644 --- a/runtime/app_info.cc +++ b/runtime/app_info.cc @@ -93,6 +93,12 @@ void AppInfo::RegisterOdexStatus(const std::string& code_path, << "\nodex_status=" << odex_status; } +bool AppInfo::HasRegisteredAppInfo() { + MutexLock mu(Thread::Current(), update_mutex_); + + return package_name_.has_value(); +} + void AppInfo::GetPrimaryApkOptimizationStatus( std::string* out_compiler_filter, std::string* out_compilation_reason) { @@ -110,6 +116,13 @@ void AppInfo::GetPrimaryApkOptimizationStatus( *out_compilation_reason = kUnknownValue; } +AppInfo::CodeType AppInfo::GetRegisteredCodeType(const std::string& code_path) { + MutexLock mu(Thread::Current(), update_mutex_); + + const auto it = registered_code_locations_.find(code_path); + return it != registered_code_locations_.end() ? it->second.code_type : CodeType::kUnknown; +} + std::ostream& operator<<(std::ostream& os, AppInfo& rhs) { MutexLock mu(Thread::Current(), rhs.update_mutex_); @@ -130,4 +143,17 @@ std::ostream& operator<<(std::ostream& os, AppInfo& rhs) { return os; } +std::string AppInfo::GetPrimaryApkReferenceProfile() { + MutexLock mu(Thread::Current(), update_mutex_); + + for (const auto& it : registered_code_locations_) { + const CodeLocationInfo& cli = it.second; + if (cli.code_type == CodeType::kPrimaryApk) { + return cli.ref_profile_path.value_or(""); + } + } + return ""; +} + + } // namespace art |