#include <bundle.h>
#include <message-port.h>
-#include <package_manager.h>
+#include <pkgmgr-info.h>
#include <FBaseStringComparer.h>
#include <FBaseSysLog.h>
unique_ptr<char[]> pLocalAppId(_StringConverter::CopyToCharArrayN(localAppId));
unique_ptr<char[]> pRemoteAppId(_StringConverter::CopyToCharArrayN(remoteAppId));
- int ret = package_manager_is_preload_package_by_app_id(pLocalAppId.get(), &preload_local);
- if (ret == 0)
+ pkgmgrinfo_appinfo_h handle = null;
+ int ret = pkgmgrinfo_appinfo_get_appinfo(pLocalAppId.get(), &handle);
+ if (ret != PMINFO_R_OK)
{
- ret = package_manager_is_preload_package_by_app_id(pRemoteAppId.get(), &preload_remote);
- if (ret == 0)
- {
- if (preload_local && preload_remote)
- {
- return true;
- }
- }
- else
- {
- SysLog(NID_IO, "Failed to check the preloaded application. %d", ret);
- }
+ SysLog(NID_IO, "Failed to get the appinfo. %d", ret);
+ return false;
}
- else
+ ret = pkgmgrinfo_appinfo_is_preload(handle, &preload_local);
+ if (ret != PMINFO_R_OK)
{
SysLog(NID_IO, "Failed to check the preloaded application. %d", ret);
+ pkgmgrinfo_appinfo_destroy_appinfo(handle);
+ return false;
+ }
+
+ ret = pkgmgrinfo_appinfo_get_appinfo(pRemoteAppId.get(), &handle);
+ if (ret != PMINFO_R_OK)
+ {
+ SysLog(NID_IO, "Failed to get the appinfo. %d", ret);
+ return false;
+ }
+ ret = pkgmgrinfo_appinfo_is_preload(handle, &preload_remote);
+ if (ret != PMINFO_R_OK)
+ {
+ SysLog(NID_IO, "Failed to check the preloaded application. %d", ret);
+ pkgmgrinfo_appinfo_destroy_appinfo(handle);
+ return false;
+ }
+
+ if (preload_local && preload_remote)
+ {
+ return true;
}
return false;
int
_MessagePortService::CheckCertificate(const String& localAppId, const String& remoteAppId) const
{
- package_manager_compare_result_type_e res;
-
unique_ptr<char[]> pLocalAppId(_StringConverter::CopyToCharArrayN(localAppId));
unique_ptr<char[]> pRemoteAppId(_StringConverter::CopyToCharArrayN(remoteAppId));
- int ret = package_manager_compare_app_cert_info(pLocalAppId.get(), pRemoteAppId.get(), &res);
+ pkgmgrinfo_cert_compare_result_type_e res;
+ int ret = pkgmgrinfo_pkginfo_compare_app_cert_info(pLocalAppId.get(), pRemoteAppId.get(), &res);
SysTryReturn(NID_IO, ret == 0, MESSAGEPORT_ERROR_IO_ERROR, E_SYSTEM,
"[E_SYSTEM] Failed to check the certificate: %d", ret);
- SysTryReturn(NID_IO, res == PACAKGE_MANAGER_COMPARE_MATCH, MESSAGEPORT_ERROR_CERTIFICATE_NOT_MATCH, E_CERTIFICATE_VERIFICATION_FAILED,
+ SysTryReturn(NID_IO, res == PMINFO_CERT_COMPARE_MATCH, MESSAGEPORT_ERROR_CERTIFICATE_NOT_MATCH, E_CERTIFICATE_VERIFICATION_FAILED,
"[E_CERTIFICATE_VERIFICATION_FAILED] Both applications are not signed with the same certificate: %d", res);
return 0;