Loading cmds/idmap2/idmap2d/Idmap2Service.cpp +12 −0 Original line number Diff line number Diff line Loading @@ -60,6 +60,7 @@ using PolicyBitmask = android::ResTable_overlayable_policy_header::PolicyBitmask namespace { constexpr const char* kFrameworkPath = "/system/framework/framework-res.apk"; constexpr const char* kLineagePath = "/system/framework/org.lineageos.platform-res.apk"; Status ok() { return Status::ok(); Loading Loading @@ -218,6 +219,17 @@ idmap2::Result<Idmap2Service::TargetResourceContainerPtr> Idmap2Service::GetTarg } return {framework_apk_cache_.get()}; } 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 +1 −0 Original line number Diff line number Diff line Loading @@ -73,6 +73,7 @@ class Idmap2Service : public BinderService<Idmap2Service>, public BnIdmap2 { // 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> framework_apk_cache_; std::unique_ptr<idmap2::TargetResourceContainer> lineage_apk_cache_; std::optional<std::filesystem::directory_iterator> frro_iter_; Loading Loading
cmds/idmap2/idmap2d/Idmap2Service.cpp +12 −0 Original line number Diff line number Diff line Loading @@ -60,6 +60,7 @@ using PolicyBitmask = android::ResTable_overlayable_policy_header::PolicyBitmask namespace { constexpr const char* kFrameworkPath = "/system/framework/framework-res.apk"; constexpr const char* kLineagePath = "/system/framework/org.lineageos.platform-res.apk"; Status ok() { return Status::ok(); Loading Loading @@ -218,6 +219,17 @@ idmap2::Result<Idmap2Service::TargetResourceContainerPtr> Idmap2Service::GetTarg } return {framework_apk_cache_.get()}; } 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 +1 −0 Original line number Diff line number Diff line Loading @@ -73,6 +73,7 @@ class Idmap2Service : public BinderService<Idmap2Service>, public BnIdmap2 { // 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> framework_apk_cache_; std::unique_ptr<idmap2::TargetResourceContainer> lineage_apk_cache_; std::optional<std::filesystem::directory_iterator> frro_iter_; Loading