mirror of
https://github.com/openharmony/bundlemanager_bundle_framework_lite.git
synced 2026-07-20 23:55:24 -04:00
!15 【OpenHarmony】【轻量级应用程序框架子系统】BMS添加日志接口
Merge pull request !15 from wangdengjia/issue_#I3RZRB
This commit is contained in:
@@ -16,9 +16,7 @@
|
||||
#ifndef OHOS_LOGGING_H
|
||||
#define OHOS_LOGGING_H
|
||||
|
||||
#ifndef APP_PLATFORM_WATCHGT
|
||||
#include "log.h"
|
||||
#endif
|
||||
|
||||
namespace OHOS {
|
||||
#undef LOG_TAG
|
||||
|
||||
@@ -76,14 +76,16 @@ BOOL BundleMgrService::ServiceMessageHandle(Service *service, Request *request)
|
||||
if (request == nullptr) {
|
||||
return FALSE;
|
||||
}
|
||||
if (request->msgId == BMS_INSTALL_MSG) {
|
||||
if (request->msgId == BMS_INSTALL_MSG && g_bmsbuff != nullptr) {
|
||||
OHOS::GtManagerService::GetInstance().Install(g_bmsbuff->bundleParameter, nullptr,
|
||||
g_bmsbuff->bundleInstallerCallback);
|
||||
} else if (request->msgId == BMS_UNINSTALL_MSG) {
|
||||
} else if (request->msgId == BMS_UNINSTALL_MSG && g_bmsbuff != nullptr) {
|
||||
OHOS::GtManagerService::GetInstance().Uninstall(g_bmsbuff->bundleParameter, nullptr,
|
||||
g_bmsbuff->bundleInstallerCallback);
|
||||
} else if (request->msgId == BMS_SCAN_PACKAGE_MSG) {
|
||||
OHOS::GtManagerService::GetInstance().ScanPackages();
|
||||
} else {
|
||||
return FALSE;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -754,9 +754,11 @@ bool BundleUtil::RemoveDir(const char *path)
|
||||
AdapterFree(curPath);
|
||||
}
|
||||
}
|
||||
#ifdef OHOS_APPEXECFWK_BMS_BUNDLEMANAGER
|
||||
for (auto node = list->Begin(); node != list->End(); node = node->next_) {
|
||||
AdapterFree(node->value_);
|
||||
}
|
||||
#endif
|
||||
if (!list->IsEmpty()) {
|
||||
delete list;
|
||||
#ifdef APP_PLATFORM_WATCHGT
|
||||
|
||||
@@ -197,7 +197,6 @@ uint8_t GtBundleInstaller::Install(const char *path, char* &resultBundleName)
|
||||
if (errorCode != ERR_OK) {
|
||||
return errorCode;
|
||||
}
|
||||
resultBundleName = Utils::Strdup(installRecord.bundleName);
|
||||
|
||||
// rename bundle.json
|
||||
if (!RenameJsonFile(installRecord.bundleName, randStr)) {
|
||||
|
||||
@@ -106,6 +106,7 @@ bool GtManagerService::Install(const char *hapPath, const InstallParam *installP
|
||||
return false;
|
||||
}
|
||||
char *resultMessage = Utils::Strdup(name);
|
||||
char *retMessage = Utils::Strdup(name);
|
||||
if (installerCallback != nullptr) {
|
||||
(*installerCallback)(OPERATION_DOING, resultMessage + 1);
|
||||
}
|
||||
@@ -114,7 +115,7 @@ bool GtManagerService::Install(const char *hapPath, const InstallParam *installP
|
||||
uint8_t ret = installer_->Install(path, resultBundleName);
|
||||
EnableServiceWdg();
|
||||
if (installerCallback != nullptr) {
|
||||
(*installerCallback)(ret, resultBundleName);
|
||||
(*installerCallback)(ret, retMessage + 1);
|
||||
}
|
||||
AdapterFree(path);
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user