if (isPreloaded)
type |= static_cast<int>(Type::PreLoaded);
+ bool isRemovable = false;
+ ret = ::pkgmgrinfo_pkginfo_is_removable(handle, &isRemovable);
+
+ if (ret != PMINFO_R_OK)
+ ERROR("Failed to ::pkgmgrinfo_pkginfo_is_removable: " << ret);
+
+ if (isRemovable)
+ type |= static_cast<int>(Type::Removable);
+
::pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
return type;
}
auto type = File::getPkgTypes(pkgUser, pkgId);
-
return ((type & static_cast<int>(Type::Package)) &&
- (!(type & static_cast<int>(Type::PreLoaded)))) ? pkgPath : path;
+ ((type & static_cast<int>(Type::Removable)))) ? pkgPath : path;
}
return path;
if (parentdir->isPreloaded())
this->m_type |= static_cast<int>(File::Type::PreLoaded);
+ if (parentdir->isRemovable())
+ this->m_type |= static_cast<int>(File::Type::Removable);
return;
} else if (!this->isDir()) {
this->m_type &= ~(static_cast<int>(File::Type::Package) |
- static_cast<int>(File::Type::PreLoaded));
+ static_cast<int>(File::Type::PreLoaded) |
+ static_cast<int>(File::Type::Removable));
}
}
inline bool isInApp() const noexcept
{
- return this->isPackage() && !this->isPreloaded();
+ return this->isPackage() && this->isRemovable();
}
inline bool isPackage() const noexcept
return this->m_type & static_cast<int>(Type::Package);
}
+ inline bool isRemovable() const noexcept
+ {
+ return this->m_type & static_cast<int>(Type::Removable);
+ }
+
inline bool isPreloaded() const noexcept
{
return this->m_type & static_cast<int>(Type::PreLoaded);
Modified = (1 << 0),
Package = (1 << 1),
PreLoaded = (1 << 2),
- File = (1 << 3),
- Directory = (1 << 4)
+ Removable = (1 << 3),
+ File = (1 << 4),
+ Directory = (1 << 5)
};
static FilePtr createInternal(const std::string &fpath, const FilePtr &parentdir,