auto type = static_cast<int>(Type::Package);
+ bool isPreloaded = false;
+ ret = ::pkgmgrinfo_pkginfo_is_preload(handle, &isPreloaded);
+
+ if (ret != PMINFO_R_OK)
+ ERROR("Failed to ::pkgmgrinfo_pkginfo_is_preload: " << ret);
+
+ if (isPreloaded)
+ type |= static_cast<int>(Type::PreLoaded);
+
::pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
return type;
continue;
}
- return File::getPkgTypes(pkgUser, pkgId) != 0;
+ auto type = File::getPkgTypes(pkgUser, pkgId);
+
+ return (type & static_cast<int>(Type::Package)) &&
+ (!(type & static_cast<int>(Type::PreLoaded)));
}
return false;
continue;
}
- return File::getPkgTypes(pkgUser, pkgId) != 0 ? pkgPath : path;
+ auto type = File::getPkgTypes(pkgUser, pkgId);
+
+ return ((type & static_cast<int>(Type::Package)) &&
+ (!(type & static_cast<int>(Type::PreLoaded)))) ? pkgPath : path;
}
return path;
bool File::isInApp() const noexcept
{
- return this->m_type & static_cast<int>(Type::Package);
+ return (this->m_type & static_cast<int>(Type::Package)) &&
+ (!(this->m_type & static_cast<int>(Type::PreLoaded)));
}
bool File::isDir() const noexcept