Loading cmds/idmap2/idmap2d/Idmap2Service.cpp +3 −13 Original line number Diff line number Diff line Loading @@ -60,7 +60,7 @@ using PolicyBitmask = android::ResTable_overlayable_policy_header::PolicyBitmask namespace { constexpr std::string_view kFrameworkPath = "/system/framework/framework-res.apk"; constexpr const char* kLineagePath = "/system/framework/org.lineageos.platform-res.apk"; constexpr std::string_view kLineagePath = "/system/framework/org.lineageos.platform-res.apk"; Status ok() { return Status::ok(); Loading Loading @@ -209,9 +209,10 @@ Status Idmap2Service::createIdmap(const std::string& target_path, const std::str idmap2::Result<Idmap2Service::TargetResourceContainerPtr> Idmap2Service::GetTargetContainer( const std::string& target_path) { const bool is_framework = target_path == kFrameworkPath; const bool is_lineage_framework = target_path == kLineagePath; bool use_cache; struct stat st = {}; if (is_framework || !::stat(target_path.c_str(), &st)) { if (is_framework || is_lineage_framework || !::stat(target_path.c_str(), &st)) { use_cache = true; } else { LOG(WARNING) << "failed to stat target path '" << target_path << "' for the cache"; Loading @@ -230,17 +231,6 @@ idmap2::Result<Idmap2Service::TargetResourceContainerPtr> Idmap2Service::GetTarg container_cache_.erase(cache_it); } } if (target_path == kLineagePath) { if (lineage_apk_cache_ == nullptr) { // Initialize the lineage APK cache. auto target = TargetResourceContainer::FromPath(target_path); if (!target) { return target.GetError(); } lineage_apk_cache_ = std::move(*target); } return {lineage_apk_cache_.get()}; } auto target = TargetResourceContainer::FromPath(target_path); if (!target) { Loading cmds/idmap2/idmap2d/Idmap2Service.h +0 −1 Original line number Diff line number Diff line Loading @@ -75,7 +75,6 @@ class Idmap2Service : public BinderService<Idmap2Service>, public BnIdmap2 { private: // idmap2d is killed after a period of inactivity, so any information stored on this class should // be able to be recalculated if idmap2 dies and restarts. std::unique_ptr<idmap2::TargetResourceContainer> lineage_apk_cache_; // A cache item for the resource containers (apks or frros), with all information needed to // detect if it has changed since it was parsed: Loading Loading
cmds/idmap2/idmap2d/Idmap2Service.cpp +3 −13 Original line number Diff line number Diff line Loading @@ -60,7 +60,7 @@ using PolicyBitmask = android::ResTable_overlayable_policy_header::PolicyBitmask namespace { constexpr std::string_view kFrameworkPath = "/system/framework/framework-res.apk"; constexpr const char* kLineagePath = "/system/framework/org.lineageos.platform-res.apk"; constexpr std::string_view kLineagePath = "/system/framework/org.lineageos.platform-res.apk"; Status ok() { return Status::ok(); Loading Loading @@ -209,9 +209,10 @@ Status Idmap2Service::createIdmap(const std::string& target_path, const std::str idmap2::Result<Idmap2Service::TargetResourceContainerPtr> Idmap2Service::GetTargetContainer( const std::string& target_path) { const bool is_framework = target_path == kFrameworkPath; const bool is_lineage_framework = target_path == kLineagePath; bool use_cache; struct stat st = {}; if (is_framework || !::stat(target_path.c_str(), &st)) { if (is_framework || is_lineage_framework || !::stat(target_path.c_str(), &st)) { use_cache = true; } else { LOG(WARNING) << "failed to stat target path '" << target_path << "' for the cache"; Loading @@ -230,17 +231,6 @@ idmap2::Result<Idmap2Service::TargetResourceContainerPtr> Idmap2Service::GetTarg container_cache_.erase(cache_it); } } if (target_path == kLineagePath) { if (lineage_apk_cache_ == nullptr) { // Initialize the lineage APK cache. auto target = TargetResourceContainer::FromPath(target_path); if (!target) { return target.GetError(); } lineage_apk_cache_ = std::move(*target); } return {lineage_apk_cache_.get()}; } auto target = TargetResourceContainer::FromPath(target_path); if (!target) { Loading
cmds/idmap2/idmap2d/Idmap2Service.h +0 −1 Original line number Diff line number Diff line Loading @@ -75,7 +75,6 @@ class Idmap2Service : public BinderService<Idmap2Service>, public BnIdmap2 { private: // idmap2d is killed after a period of inactivity, so any information stored on this class should // be able to be recalculated if idmap2 dies and restarts. std::unique_ptr<idmap2::TargetResourceContainer> lineage_apk_cache_; // A cache item for the resource containers (apks or frros), with all information needed to // detect if it has changed since it was parsed: Loading