IssueNo:#I3ZJ0J

Description:Add interface non null judgment
Sig:startup
Feature or Bugfix:Bugfix
Binary Source:No
This commit is contained in:
wangdengjia
2021-07-07 16:16:28 +08:00
parent 494d8af459
commit e6cbb671fa
2 changed files with 8 additions and 17 deletions
@@ -67,7 +67,6 @@ public:
uint8_t GetBundleInfo(const char *bundleName, int32_t flags, BundleInfo& bundleInfo);
uint8_t GetBundleInfos(const int flags, BundleInfo **bundleInfos, int32_t *len);
void ScanPackages();
void SendBundleListChangedToLauncher(BundleState state, const char *bundleName);
BundleInfo *QueryBundleInfo(const char *bundleName);
void RemoveBundleInfo(const char *bundleName);
void AddBundleInfo(BundleInfo *info);
@@ -38,7 +38,6 @@
namespace OHOS {
const uint8_t PAIR_VALUE = 2;
const uint8_t FINISHED_PROCESS = 100;
const uint8_t OPERATION_DOING = 200;
const uint8_t BMS_INSTALLATION_START = 101;
const uint8_t BMS_UNINSTALLATION_START = 104;
@@ -175,12 +174,20 @@ bool GtManagerService::Uninstall(const char *bundleName, const InstallParam *ins
bool GtManagerService::GetInstallState(const char *bundleName, InstallState *installState, uint8_t *installProcess)
{
if (bundleName == nullptr) {
retrun false;
}
BundleInfo *installedInfo = bundleMap_->Get(bundleName);
if (installedInfo != nullptr) {
*installState = BUNDLE_INSTALL_OK;
*installProcess = BMS_INSTALLATION_COMPLETED;
return true;
}
if (bundleInstallMsg_ == nullptr) {
*installState = BUNDLE_INSTALL_FAIL;
*installProcess = 0;
return true;
}
if (strcmp(bundleName, bundleInstallMsg_->bundleName) == 0) {
*installState = bundleInstallMsg_->installState;
*installProcess = bundleInstallMsg_->installProcess;
@@ -851,21 +858,6 @@ void GtManagerService::ReduceNumOfThirdBundles()
installedThirdBundleNum_--;
}
void GtManagerService::SendBundleListChangedToLauncher(BundleState state, const char *bundleName)
{
if (bundleName == nullptr) {
return;
}
char *innerBundleName = reinterpret_cast<char *>(SvrMalloc(strlen(bundleName) + 1));
if (innerBundleName == nullptr) {
return;
}
if (strncpy_s(innerBundleName, strlen(bundleName) + 1, bundleName, strlen(bundleName)) != EOK) {
SvrFree(innerBundleName);
return;
}
}
int32_t GtManagerService::ReportInstallCallback(uint8_t errCode, uint8_t installState,
uint8_t process, InstallerCallback installerCallback)
{