diff options
author | Kyungwook Tak <k.tak@samsung.com> | 2017-02-01 10:29:35 +0900 |
---|---|---|
committer | Kyungwook Tak <k.tak@samsung.com> | 2017-02-01 10:30:56 +0900 |
commit | 7e23c6e46c0207cb8973137aa365724d5555dc5d (patch) | |
tree | b4d501450d224ed7007420b1036c85a478105af4 | |
parent | b4f1327fa51cdbc6d378287859a48bd01c2e72e4 (diff) | |
download | csr-framework-7e23c6e46c0207cb8973137aa365724d5555dc5d.tar.gz csr-framework-7e23c6e46c0207cb8973137aa365724d5555dc5d.tar.bz2 csr-framework-7e23c6e46c0207cb8973137aa365724d5555dc5d.zip |
Revert "Determine package by removable attribute"
This reverts commit b4f1327fa51cdbc6d378287859a48bd01c2e72e4.
Need more precise decision related to preloaded app deletions.
Change-Id: I49367d5afd2748ce8133b3345cb23e5bd6d9fb76
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
-rw-r--r-- | src/framework/service/file-system.cpp | 17 | ||||
-rw-r--r-- | src/framework/service/file-system.h | 12 |
2 files changed, 6 insertions, 23 deletions
diff --git a/src/framework/service/file-system.cpp b/src/framework/service/file-system.cpp index 7be7cef..9ae2380 100644 --- a/src/framework/service/file-system.cpp +++ b/src/framework/service/file-system.cpp @@ -66,15 +66,6 @@ int File::getPkgTypes(const std::string &user, const std::string &pkgid) 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; @@ -104,8 +95,9 @@ std::string File::getPkgPath(const std::string &path) } auto type = File::getPkgTypes(pkgUser, pkgId); + return ((type & static_cast<int>(Type::Package)) && - ((type & static_cast<int>(Type::Removable)))) ? pkgPath : path; + (!(type & static_cast<int>(Type::PreLoaded)))) ? pkgPath : path; } return path; @@ -125,14 +117,11 @@ File::File(const std::string &fpath, const FilePtr &parentdir, int type, 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::Removable)); + static_cast<int>(File::Type::PreLoaded)); } } diff --git a/src/framework/service/file-system.h b/src/framework/service/file-system.h index 9278deb..7166c47 100644 --- a/src/framework/service/file-system.h +++ b/src/framework/service/file-system.h @@ -44,7 +44,7 @@ public: inline bool isInApp() const noexcept { - return this->isPackage() && this->isRemovable(); + return this->isPackage() && !this->isPreloaded(); } inline bool isPackage() const noexcept @@ -52,11 +52,6 @@ public: 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); @@ -117,9 +112,8 @@ private: Modified = (1 << 0), Package = (1 << 1), PreLoaded = (1 << 2), - Removable = (1 << 3), - File = (1 << 4), - Directory = (1 << 5) + File = (1 << 3), + Directory = (1 << 4) }; static FilePtr createInternal(const std::string &fpath, const FilePtr &parentdir, |