From f4cc941f7ae0fa2de3c8f0b5c84ffe8248020fa6 Mon Sep 17 00:00:00 2001 From: Duyoung Jang Date: Tue, 9 Apr 2013 21:33:25 +0900 Subject: [PATCH] Change progress logic Change-Id: If6da0fcfbf808275398a53b94040950997b2f894 Signed-off-by: Duyoung Jang --- inc/InstallerDefs.h | 2 +- src/Context/InstallationContext.cpp | 1 + src/Context/InstallationContext.h | 1 + src/Manager/InstallerManager.cpp | 122 +++++++++++++++++++-------- src/Manager/InstallerManager.h | 10 +-- src/Manager/SmackManager.cpp | 2 +- src/XmlHandler/ManifestHandler.cpp | 21 ++++- src/backend/backend.cpp | 159 ++++++++++++------------------------ 8 files changed, 169 insertions(+), 149 deletions(-) diff --git a/inc/InstallerDefs.h b/inc/InstallerDefs.h index a8803b3..de72d98 100755 --- a/inc/InstallerDefs.h +++ b/inc/InstallerDefs.h @@ -23,7 +23,7 @@ #include "InstallerUtil.h" -#define OSP_INSTALLER_VERSION "version=[20130409.2]" +#define OSP_INSTALLER_VERSION "version=[20130410.1]" #define DIR_BIN L"/bin" #define DIR_INFO L"/info" diff --git a/src/Context/InstallationContext.cpp b/src/Context/InstallationContext.cpp index 3b994ba..a72aa61 100755 --- a/src/Context/InstallationContext.cpp +++ b/src/Context/InstallationContext.cpp @@ -65,6 +65,7 @@ InstallationContext::InstallationContext(void) ,__pAuthorCertList(null) ,__pDistributorCertList(null) ,__certType(0) +,__pPkgmgrInstaller(null) { } diff --git a/src/Context/InstallationContext.h b/src/Context/InstallationContext.h index abb9f99..e6aadef 100755 --- a/src/Context/InstallationContext.h +++ b/src/Context/InstallationContext.h @@ -138,6 +138,7 @@ public: Tizen::Base::String __description; int __certType; + void* __pPkgmgrInstaller; }; // InstallationContext diff --git a/src/Manager/InstallerManager.cpp b/src/Manager/InstallerManager.cpp index 923c20f..d233b2f 100755 --- a/src/Manager/InstallerManager.cpp +++ b/src/Manager/InstallerManager.cpp @@ -24,6 +24,7 @@ #include #include +#include #include #include @@ -83,7 +84,7 @@ InstallerManager::GetInstance() } InstallerError -InstallerManager::Construct(const String& path, InstallerOperation operation, InstallerOption option) +InstallerManager::Construct(const String& path, InstallerOperation operation, InstallerOption option, void* pPkgmgrInstaller, const PackageId* pPackageId) { InstallerError error = INSTALLER_ERROR_NONE; InstallerType installerType = INSTALLER_TYPE_INSTALLER; @@ -119,6 +120,8 @@ InstallerManager::Construct(const String& path, InstallerOperation operation, In error = __pContext->Construct(); TryReturn(error == INSTALLER_ERROR_NONE, INSTALLER_ERROR_INTERNAL_STATE, "__pContext->Construct() failed."); + __pContext->__pPkgmgrInstaller = pPkgmgrInstaller; + if (operation == INSTALLER_OPERATION_INSTALL) { FileAttributes attr; @@ -150,6 +153,18 @@ InstallerManager::Construct(const String& path, InstallerOperation operation, In installerType = INSTALLER_TYPE_PACKAGE; __pContext->__packagePath = newPath; } + + if (pPackageId) + { + AppLog(" # packageId = [%ls]", pPackageId->GetPointer()); + __pContext->__packageId = (*pPackageId); + + SendEvent(__pContext, __pContext->__packageId, "start", "install"); + } + else + { + AppLog("Input param(packageId) is null in case of cmd, hybrid package."); + } } else if (operation == INSTALLER_OPERATION_UNINSTALL) { @@ -158,6 +173,8 @@ InstallerManager::Construct(const String& path, InstallerOperation operation, In AppLog("operation is INSTALLER_OPERATION_UNINSTALL"); __pContext->SetCurrentInstallationStep(INSTALLER_STEP_INIT_UNINSTALL); __pContext->__packageId = newPath; + + SendEvent(__pContext, __pContext->__packageId, "start", "uninstall"); } else if (operation == INSTALLER_OPERATION_REINSTALL) { @@ -167,6 +184,8 @@ InstallerManager::Construct(const String& path, InstallerOperation operation, In __pContext->SetCurrentInstallationStep(INSTALLER_STEP_RDS_INIT); __pContext->__packageId = newPath; + + SendEvent(__pContext, __pContext->__packageId, "start", "install"); } __pContext->SetInstallerOperation(operation); @@ -253,6 +272,7 @@ InstallerManager::GetNext(void) InstallerError InstallerManager::Init(void) { + SendEvent(__pContext, __pContext->__packageId, "install_percent", "0"); return __pInstaller->OnInit(); } @@ -265,12 +285,14 @@ InstallerManager::Error(void) InstallerError InstallerManager::Register(void) { + SendEvent(__pContext, __pContext->__packageId, "install_percent", "60"); return __pInstaller->OnRegister(); } InstallerError InstallerManager::End(void) { + SendEvent(__pContext, __pContext->__packageId, "install_percent", "100"); return __pInstaller->OnEnd(); } @@ -307,22 +329,22 @@ InstallerManager::Activate(void) { __pContext->SetError(error); Error(); - return error; + goto CATCH; } } if (currentStep == INSTALLER_STEP_INIT) { error = Init(); - TryReturn(error == INSTALLER_ERROR_NONE, error, "error is occurred."); + TryCatch(error == INSTALLER_ERROR_NONE, , "error is occurred."); } else if (currentStep == INSTALLER_STEP_END) { error = Register(); - TryReturn(error == INSTALLER_ERROR_NONE, error, "error is occurred."); + TryCatch(error == INSTALLER_ERROR_NONE, , "error is occurred."); error = End(); - TryReturn(error == INSTALLER_ERROR_NONE, error, "error is occurred."); + TryCatch(error == INSTALLER_ERROR_NONE, , "error is occurred."); } else if (currentStep == INSTALLER_STEP_RDS) { @@ -341,6 +363,19 @@ InstallerManager::Activate(void) } } +CATCH: + if (error == INSTALLER_ERROR_NONE) + { + SendEvent(__pContext, __pContext->__packageId, "end", "ok"); + } + else + { + char errorMsg[11] = {0}; + snprintf(errorMsg, sizeof(errorMsg) - 1, "%d", error); + SendEvent(__pContext, __pContext->__packageId, "error", errorMsg); + SendEvent(__pContext, __pContext->__packageId, "end", "fail"); + } + return error; } @@ -499,7 +534,6 @@ InstallerManager::ReqeustByTest(void) Tizen::Io::FileAttributes attr; result r = E_SUCCESS; char readBuf[512] = {0}; - PackageId packageId; r = File::GetAttributes(L"/opt/apps/cmtamb4mtv/data/configuration", attr); TryCatch(!IsFailed(r), errorType = INSTALLER_ERROR_PACKAGE_NOT_FOUND, "file not found"); @@ -514,11 +548,11 @@ InstallerManager::ReqeustByTest(void) if (readBuf[0] == '+') { - errorType = InstallerManager::Request(path, INSTALLER_OPERATION_INSTALL, INSTALLER_OPTION_NORMAL, packageId); + errorType = InstallerManager::Request(path, INSTALLER_OPERATION_INSTALL, INSTALLER_OPTION_NORMAL, null); } else if (readBuf[0] == '-') { - errorType = InstallerManager::Request(path, INSTALLER_OPERATION_UNINSTALL, INSTALLER_OPTION_NORMAL, packageId); + errorType = InstallerManager::Request(path, INSTALLER_OPERATION_UNINSTALL, INSTALLER_OPTION_NORMAL, null); } else if (readBuf[0] == '*') { @@ -534,7 +568,7 @@ InstallerManager::ReqeustByTest(void) } else if (readBuf[0] == '#') { - errorType = InstallerManager::Request(path, INSTALLER_OPERATION_REINSTALL, INSTALLER_OPTION_NORMAL, packageId); + errorType = InstallerManager::Request(path, INSTALLER_OPERATION_REINSTALL, INSTALLER_OPTION_NORMAL, null); } } @@ -675,18 +709,6 @@ InstallerManager::PrintError(int errorType) AppLog(" # Error = %s(%d)", pError, errorType); } -const PackageId& -InstallerManager::GetId(void) const -{ - return __packageId; -} - -void -InstallerManager::SetId(const PackageId& packageId) -{ - __packageId = packageId; -} - int InstallerManager::GetErrorType(void) const { @@ -723,10 +745,48 @@ InstallerManager::IsFileLogOn() const return __isFileLogOn; } +bool +InstallerManager::SendEvent(InstallationContext* pContext, const PackageId& packageId, const String& key, const String& val) +{ + TryReturn(pContext, false, "pContext is null."); + TryReturn(key.IsEmpty() == false, false, "key is empty."); + TryReturn(val.IsEmpty() == false, false, "val is empty."); + + InstallerOperation operation = pContext->GetInstallerOperation(); + + if (pContext->__pPkgmgrInstaller == null) + { + AppLog("pContext->__pPkgmgrInstaller is null. [%ls]", packageId.GetPointer()); + return false; + } + + if (operation == INSTALLER_OPERATION_UNINSTALL) + { + if (key == L"install_percent") + { + AppLog("install_percent is skipped. [%ls]", packageId.GetPointer()); + return true; + } + } + + std::unique_ptr pPackageId(_StringConverter::CopyToCharArrayN(packageId)); + TryReturn(pPackageId, false, "pPackageId is null."); + + std::unique_ptr pKey(_StringConverter::CopyToCharArrayN(key)); + TryReturn(pKey, false, "pKey is null."); + + std::unique_ptr pVal(_StringConverter::CopyToCharArrayN(val)); + TryReturn(pVal, false, "pVal is null."); + + pkgmgr_installer_send_signal((pkgmgr_installer*) pContext->__pPkgmgrInstaller, "tpk", pPackageId.get(), pKey.get(), pVal.get()); + AppLog("pkgmgr_installer_send_signal(tpk, %s, %s, %s)", pPackageId.get(), pKey.get(), pVal.get()); + + return true; +} + int -InstallerManager::Request(const String& path, InstallerOperation operation, InstallerOption option, PackageId& packageId) +InstallerManager::Request(const String& path, InstallerOperation operation, InstallerOption option, void* pPkgmgrInstaller, const PackageId* pPackageId) { - InstallationContext* pContext = null; InstallerError errorType = INSTALLER_ERROR_NONE; InstallerManager* pInstallManager = null; @@ -737,16 +797,12 @@ InstallerManager::Request(const String& path, InstallerOperation operation, Inst pInstallManager = InstallerManager::GetInstance(); TryCatch(pInstallManager, errorType = INSTALLER_ERROR_INTERNAL_STATE, "pInstallManager is null."); - errorType = pInstallManager->Construct(path, operation, option); + errorType = pInstallManager->Construct(path, operation, option, pPkgmgrInstaller, pPackageId); TryCatch(errorType == INSTALLER_ERROR_NONE, , "pInstallManager->Construct() failed."); errorType = pInstallManager->Activate(); TryCatch(errorType == INSTALLER_ERROR_NONE, , "pInstallManager->Activate() failed."); - pContext = pInstallManager->GetContext(); - TryCatch(pContext, errorType = INSTALLER_ERROR_INTERNAL_STATE, "pInstallManager->GetContext failed."); - packageId = pContext->__packageId; - CATCH: if (pInstallManager) { @@ -785,7 +841,6 @@ InstallerManager::RequestRecursiveDirectory(const Tizen::Base::String& path, int int totalCount = 0; int successCount = 0; int failureCount = 0; - PackageId packageId; pDir = new (std::nothrow) Directory; // Allocate %Directory instance TryCatch(pDir, res = false, "pDir is null"); @@ -850,7 +905,7 @@ InstallerManager::RequestRecursiveDirectory(const Tizen::Base::String& path, int AppLog("------------------------------------------"); AppLog(" # Directory = [%ls]", entryDir.GetPointer()); - errorType = Request(entryDir, INSTALLER_OPERATION_INSTALL, INSTALLER_OPTION_NORMAL, packageId); + errorType = Request(entryDir, INSTALLER_OPERATION_INSTALL, INSTALLER_OPTION_NORMAL, null); if (errorType == 0) { successCount++; @@ -880,7 +935,6 @@ InstallerManager::RequestByCommand(int argc, char **argv) { int mode = 0; char buf[BUFSIZE] = {0}; - PackageId packageId; int errorType = 0; bool output = false; InstallerOption option = INSTALLER_OPTION_NORMAL; @@ -907,7 +961,7 @@ InstallerManager::RequestByCommand(int argc, char **argv) AppLog(" # Directory = [%s]", buf); option = (InstallerOption)(option | INSTALLER_OPTION_FILELOG_ON); - errorType = InstallerManager::Request(buf, INSTALLER_OPERATION_INSTALL, option, packageId); + errorType = InstallerManager::Request(buf, INSTALLER_OPERATION_INSTALL, option, null); if (errorType != 0) { // in case of command, garbage directory is not deleted. @@ -922,7 +976,7 @@ InstallerManager::RequestByCommand(int argc, char **argv) AppLog(" # Directory = [%s]", buf); option = (InstallerOption)(option | INSTALLER_OPTION_FILELOG_ON); - errorType = InstallerManager::Request(buf, INSTALLER_OPERATION_UNINSTALL, option, packageId); + errorType = InstallerManager::Request(buf, INSTALLER_OPERATION_UNINSTALL, option, null); } break; @@ -940,7 +994,7 @@ InstallerManager::RequestByCommand(int argc, char **argv) AppLog(" # Directory = [%s]", buf); option = (InstallerOption)(option | INSTALLER_OPTION_FILELOG_ON); - errorType = InstallerManager::Request(buf, INSTALLER_OPERATION_REINSTALL, option, packageId); + errorType = InstallerManager::Request(buf, INSTALLER_OPERATION_REINSTALL, option, null); } break; diff --git a/src/Manager/InstallerManager.h b/src/Manager/InstallerManager.h index 3c62391..694ddb7 100755 --- a/src/Manager/InstallerManager.h +++ b/src/Manager/InstallerManager.h @@ -38,7 +38,7 @@ class InstallerManager { public: InstallerManager(void); - InstallerError Construct(const Tizen::Base::String& path, InstallerOperation op, InstallerOption option); + InstallerError Construct(const Tizen::Base::String& path, InstallerOperation op, InstallerOption option, void* pPkgmgrInstaller, const Tizen::App::PackageId* pPackageId = null); virtual ~InstallerManager(void); static InstallerManager* GetInstance(void); @@ -49,9 +49,6 @@ public: void PrintResult(void); void PrintError(int errorType); - const Tizen::App::PackageId& GetId(void) const; - void SetId(const Tizen::App::PackageId& appId); - int GetErrorType(void) const; void SetErrorType(int errorType); @@ -61,7 +58,9 @@ public: Tizen::Base::String GetLogFilePath() const; bool IsFileLogOn() const; - static int Request(const Tizen::Base::String& path, InstallerOperation operation, InstallerOption option, Tizen::Base::String& packageId); + static bool SendEvent(InstallationContext* pContext, const Tizen::App::PackageId& packageId, const Tizen::Base::String& key, const Tizen::Base::String& val); + + static int Request(const Tizen::Base::String& path, InstallerOperation operation, InstallerOption option, void* pPkgmgrInstaller, const Tizen::App::PackageId* pPackageId = null); static int RequestRecursiveDirectory(const Tizen::Base::String& path, int& errorType); static int RequestByCommand(int argc, char **argv); static int ReqeustByTest(void); @@ -94,7 +93,6 @@ private: InstallationContext* __pContext; Installer* __pInstaller; - Tizen::App::PackageId __packageId; int __errorType; InstallerOperation __operation; diff --git a/src/Manager/SmackManager.cpp b/src/Manager/SmackManager.cpp index 2194c83..2cc6d3b 100755 --- a/src/Manager/SmackManager.cpp +++ b/src/Manager/SmackManager.cpp @@ -206,7 +206,7 @@ SmackManager::AddLabelSharedDir(const PackageId& packageId, const String& dirPat TryReturn(!IsFailed(r), false, "base64Value.Replace() is failed."); std::unique_ptr pHashEncodedValue(_StringConverter::CopyToCharArrayN(base64Value)); - TryReturn(!IsFailed(r), false, "pHashEncodedValue is null."); + TryReturn(pHashEncodedValue, false, "pHashEncodedValue is null."); label = pHashEncodedValue.get(); AppLog("pHashEncodedValue = [%s]", pHashEncodedValue.get()); diff --git a/src/XmlHandler/ManifestHandler.cpp b/src/XmlHandler/ManifestHandler.cpp index 6e27307..2e9a093 100755 --- a/src/XmlHandler/ManifestHandler.cpp +++ b/src/XmlHandler/ManifestHandler.cpp @@ -833,10 +833,27 @@ ManifestHandler::OnManifestEndElement(void) } bool -ManifestHandler::OnIdValue(const char *pCharacters) +ManifestHandler::OnIdValue(const char* pCharacters) { AppLog("%s", pCharacters); - __pContext->__packageId = pCharacters; + + if (__pContext->__packageId.IsEmpty() == true) + { + __pContext->__packageId = pCharacters; + } + else + { + String id(pCharacters); + if (__pContext->__packageId != id) + { + AppLog("input packageId = [%ls], id(manifest) = [%s] is different.", __pContext->__packageId.GetPointer(), pCharacters); + return false; + } + else + { + AppLog("input packageId = [%ls], id(manifest) = [%s] is the same.", __pContext->__packageId.GetPointer(), pCharacters); + } + } return true; } diff --git a/src/backend/backend.cpp b/src/backend/backend.cpp index 65d2100..176f76f 100755 --- a/src/backend/backend.cpp +++ b/src/backend/backend.cpp @@ -27,17 +27,19 @@ #include -#include +#include +#include +#include #include "InstallerManager.h" -#include "InstallerDefs.h" -#include "InstallerUtil.h" -using namespace Tizen::Base; using namespace Tizen::App; +using namespace Tizen::App::Package; +using namespace Tizen::Base; +using namespace Tizen::Io; extern "C" void Osp_Initialize(); -static bool __osp_installer_report_result(const Tizen::App::PackageId& packageId, int errorType); +static bool __osp_installer_report_result(const PackageId& packageId, int errorType); static pkgmgr_installer *_pi = null; @@ -45,8 +47,9 @@ int main(int argc, char **argv) { int ret = 0; - const char *pkg_info = NULL; - char* pkg_path = NULL; + const char *pkg_info = null; + char* pkg_path = null; + const char* pOptional = null; String path; PackageId packageId; int errorType = 0; @@ -106,25 +109,47 @@ main(int argc, char **argv) { case PKGMGR_REQ_INSTALL: { - errorType = InstallerManager::Request(path, INSTALLER_OPERATION_INSTALL, INSTALLER_OPTION_NORMAL, packageId); - if (_pi != 0) + pOptional = pkgmgr_installer_get_optional_data(pi); + if (pOptional) { - char resultBuf[128] = {0}; - snprintf(resultBuf, sizeof(resultBuf), "%ls", packageId.GetPointer()); - pkgmgr_installer_send_signal(_pi, "tpk", resultBuf, "start", "install"); - - // temp - pkgmgr_installer_send_signal(_pi, "tpk", resultBuf, "install_percent", "0"); - usleep(50000); - pkgmgr_installer_send_signal(_pi, "tpk", resultBuf, "install_percent", "30"); - usleep(50000); + packageId = pOptional; + AppLog(" # optional = [%s]", pOptional); } else { - AppLog("_pi is null"); + FileAttributes attr; + result r = File::GetAttributes(path, attr); + if (IsFailed(r)) + { + AppLog("GetAttributes() failed. [%ls]", path.GetPointer()); + goto CATCH; + } + + if (attr.IsDirectory()) + { + if (path.EndsWith("/") == true) + { + int length = path.GetLength(); + path.Remove(length - 1, 1); + } + + path.SubString(path.GetLength() - PACKAGE_ID_LENGTH, PACKAGE_ID_LENGTH, packageId); + } + else + { + std::unique_ptr< PackageInfo > pPackageInfo(_PackageManagerImpl::GetInstance()->GetPackageInfoFromFileN(path)); + if (pPackageInfo) + { + packageId = pPackageInfo->GetId(); + } + } + + AppLog(" # path = [%ls] -> packageId = [%ls]", path.GetPointer(), packageId.GetPointer()); } -// if (errorType != 0) + errorType = InstallerManager::Request(path, INSTALLER_OPERATION_INSTALL, INSTALLER_OPTION_NORMAL, pi, &packageId); + +// if (errorType != 0) // { // manager.RemoveGarbage(path); // } @@ -140,20 +165,9 @@ main(int argc, char **argv) path.SubString(0, PACKAGE_ID_LENGTH, reqeustPackageId); AppLog("reqeustPackageId = %ls", reqeustPackageId.GetPointer()); - ret = InstallerManager::Request(reqeustPackageId, INSTALLER_OPERATION_UNINSTALL, INSTALLER_OPTION_NORMAL, packageId); - - if (_pi != 0) - { - char resultBuf[128] = {0}; - snprintf(resultBuf, sizeof(resultBuf), "%ls", packageId.GetPointer()); - pkgmgr_installer_send_signal(_pi, "tpk", resultBuf, "start", "uninstall"); - } - else - { - AppLog("_pi is null"); - } + ret = InstallerManager::Request(reqeustPackageId, INSTALLER_OPERATION_UNINSTALL, INSTALLER_OPTION_NORMAL, _pi); - __osp_installer_report_result(packageId, errorType); + __osp_installer_report_result(reqeustPackageId, errorType); } break; @@ -164,20 +178,9 @@ main(int argc, char **argv) path.SubString(0, PACKAGE_ID_LENGTH, rdsPackageId); AppLog("rdsPackageId = %ls", rdsPackageId.GetPointer()); - ret = InstallerManager::Request(rdsPackageId, INSTALLER_OPERATION_REINSTALL, INSTALLER_OPTION_NORMAL, packageId); + ret = InstallerManager::Request(rdsPackageId, INSTALLER_OPERATION_REINSTALL, INSTALLER_OPTION_NORMAL, _pi, &rdsPackageId); - if (_pi != 0) - { - char resultBuf[128] = {0}; - snprintf(resultBuf, sizeof(resultBuf), "%ls", packageId.GetPointer()); - pkgmgr_installer_send_signal(_pi, "tpk", resultBuf, "start", "install"); - } - else - { - AppLog("_pi is null"); - } - - __osp_installer_report_result(packageId, errorType); + __osp_installer_report_result(rdsPackageId, errorType); } break; @@ -213,41 +216,18 @@ CATCH: } bool -__osp_installer_send_error(int errorType) -{ - char errorMsg[11] = {0}; - int error = 0; - - if (errorType >= INSTALLER_ERROR_USER_CANCEL) - { - error = INSTALLER_ERROR_FATAL_ERROR; - } - else - { - error = errorType; - } - - snprintf(errorMsg, sizeof(errorMsg) - 1, "%d", error); - pkgmgr_installer_send_signal(_pi, "tpk", "", "error", errorMsg); - - return true; -} - -bool __osp_installer_report_result(const PackageId& packageId, int errorType) { - int ret = 0; - char resultBuf[128] = {0}; - InstallerManager manager; - const char* pPkgType = "tpk"; - const char* pKey = "end"; - const char* pValue = null; - AppLog("------------------------------------------"); AppLog("osp_installer_report_result"); AppLog(" # request_type = [%d]", pkgmgr_installer_get_request_type(_pi)); AppLog(" # request_info = [%s]", pkgmgr_installer_get_request_info(_pi)); AppLog(" # session_id = [%s]", pkgmgr_installer_get_session_id(_pi)); + if (packageId.IsEmpty() == false) + { + AppLog(" # packageId = [%ls]", packageId.GetPointer()); + } + AppLog(" # errorType = [%d]", errorType); AppLog("------------------------------------------"); if (_pi == 0) @@ -256,37 +236,6 @@ __osp_installer_report_result(const PackageId& packageId, int errorType) return false; } - if (errorType == 0) - { - pValue = "ok"; - } - else - { - pValue = "fail"; - __osp_installer_send_error(errorType); - } - - if (packageId.IsEmpty() == false) - { - snprintf(resultBuf, sizeof(resultBuf), "%ls", packageId.GetPointer()); - } - - // temp - pkgmgr_installer_send_signal(_pi, pPkgType, resultBuf, "install_percent", "65"); - usleep(50000); - pkgmgr_installer_send_signal(_pi, pPkgType, resultBuf, "install_percent", "100"); - usleep(50000); - - ret = pkgmgr_installer_send_signal(_pi, pPkgType, resultBuf, pKey, pValue); - AppLog("------------------------------------------"); - AppLog("pkgmgr_installer_send_signal"); - AppLog(" # type = [%s]", pPkgType); - AppLog(" # pkg id = [%s]", resultBuf); - AppLog(" # key = [%s]", pKey); - AppLog(" # val = [%s]", pValue); - AppLog(" # ret = [%s]", (ret == 0)?"success":"failure"); - AppLog("------------------------------------------"); - pkgmgr_installer_free(_pi); _pi = null; -- 2.7.4