Merge pull request !1034 from SoftSquirrel/master
This commit is contained in:
openharmony_ci 2022-03-23 02:04:45 +00:00 committed by Gitee
commit 68f9b0abbd
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
10 changed files with 38 additions and 27 deletions

View File

@ -1797,7 +1797,7 @@ ErrCode BundleMgrHost::HandleGetAppIdByBundleName(Parcel &data, Parcel &reply)
std::string bundleName = data.ReadString();
int32_t userId = data.ReadInt32();
std::string appId = GetAppIdByBundleName(bundleName, userId);
APP_LOGD("appId is %{public}s", appId.c_str());
APP_LOGD("appId is %{private}s", appId.c_str());
if (!reply.WriteString(appId)) {
APP_LOGE("write failed");
return ERR_APPEXECFWK_PARCEL_ERROR;

View File

@ -377,7 +377,7 @@ std::string BundleMgrProxy::GetAppIdByBundleName(const std::string &bundleName,
return Constants::EMPTY_STRING;
}
std::string appId = reply.ReadString();
APP_LOGD("appId is %{public}s", appId.c_str());
APP_LOGD("appId is %{private}s", appId.c_str());
return appId;
}

View File

@ -1524,7 +1524,7 @@ static bool ParseWant(napi_env env, Want &want, napi_value args)
}
APP_LOGD("deviceId:%{public}s, bundleName:%{public}s, abilityName:%{public}s",
elementDeviceId.c_str(), elementBundleName.c_str(), elementAbilityName.c_str());
APP_LOGD("action:%{public}s, uri:%{public}s, type:%{public}s, flags:%{public}d",
APP_LOGD("action:%{public}s, uri:%{private}s, type:%{public}s, flags:%{public}d",
wantAction.c_str(), elementUri.c_str(), wantType.c_str(), wantFlags);
want.SetAction(wantAction);
want.SetUri(elementUri);
@ -2882,6 +2882,7 @@ napi_value Install(napi_env env, napi_callback_info info)
NAPI_CALL(env, napi_typeof(env, argv[ARGS_SIZE_TWO], &valuetype));
if (valuetype != napi_function) {
APP_LOGE("Wrong argument type. Function expected.");
delete asyncCallbackInfo;
return nullptr;
}
napi_create_reference(env, argv[ARGS_SIZE_TWO], NAPI_RETURN_ONE, &asyncCallbackInfo->callback);
@ -6212,7 +6213,7 @@ static bool InnerQueryExtensionInfo(napi_env env, AsyncExtensionInfoCallbackInfo
APP_LOGE("can not get iBundleMgr");
return false;
}
APP_LOGD("action:%{public}s, uri:%{public}s, type:%{public}s, flags:%{public}d",
APP_LOGD("action:%{public}s, uri:%{private}s, type:%{public}s, flags:%{public}d",
info.want.GetAction().c_str(), info.want.GetUriString().c_str(), info.want.GetType().c_str(), info.flags);
if (info.extensionAbilityType < 0) {
@ -6250,6 +6251,7 @@ napi_value QueryExtensionInfoByWant(napi_env env, napi_callback_info info)
if (argc < ARGS_SIZE_TWO || argc > ARGS_SIZE_FOUR) {
APP_LOGE("the number of input arguments is invalid");
delete callBackInfo;
return nullptr;
}
for (size_t i = 0; i < argc; ++i) {

View File

@ -58,6 +58,7 @@ void PermissionCallback::OnChanged(const int32_t uid)
};
if (callbackInfo == nullptr) {
APP_LOGE("new CallbackInfo failed");
delete work;
return;
}
work->data = (void *)callbackInfo;

View File

@ -1344,9 +1344,9 @@ ErrCode BaseBundleInstaller::CheckMultipleHapsSignInfo(const std::vector<std::st
return ERR_APPEXECFWK_INSTALL_FAILED_INCOMPATIBLE_SIGNATURE;
}
auto appId = hapVerifyRes[0].GetProvisionInfo().appId;
APP_LOGD("bundle appid is %{public}s", appId.c_str());
APP_LOGD("bundle appid is %{private}s", appId.c_str());
auto isValid = std::any_of(hapVerifyRes.begin(), hapVerifyRes.end(), [&](auto &hapVerifyResult) {
APP_LOGD("module appid is %{public}s", hapVerifyResult.GetProvisionInfo().appId.c_str());
APP_LOGD("module appid is %{private}s", hapVerifyResult.GetProvisionInfo().appId.c_str());
return appId != hapVerifyResult.GetProvisionInfo().appId;
});
if (isValid) {
@ -1356,7 +1356,7 @@ ErrCode BaseBundleInstaller::CheckMultipleHapsSignInfo(const std::vector<std::st
auto apl = hapVerifyRes[0].GetProvisionInfo().bundleInfo.apl;
APP_LOGD("bundle apl is %{public}s", apl.c_str());
isValid = std::any_of(hapVerifyRes.begin(), hapVerifyRes.end(), [&](auto &hapVerifyResult) {
APP_LOGD("module appid is %{public}s", hapVerifyResult.GetProvisionInfo().bundleInfo.apl.c_str());
APP_LOGD("module appid is %{private}s", hapVerifyResult.GetProvisionInfo().bundleInfo.apl.c_str());
return apl != hapVerifyResult.GetProvisionInfo().bundleInfo.apl;
});
if (isValid) {

View File

@ -525,7 +525,7 @@ bool BundleDataMgr::ImplicitQueryAbilityInfos(
APP_LOGE("param invalid");
return false;
}
APP_LOGD("action:%{public}s, uri:%{public}s, type:%{public}s",
APP_LOGD("action:%{public}s, uri:%{private}s, type:%{public}s",
want.GetAction().c_str(), want.GetUriString().c_str(), want.GetType().c_str());
APP_LOGD("flags:%{public}d, userId:%{public}d", flags, userId);
std::lock_guard<std::mutex> lock(bundleInfoMutex_);
@ -677,7 +677,7 @@ bool BundleDataMgr::QueryLauncherAbilityInfos(
bool BundleDataMgr::QueryAbilityInfoByUri(
const std::string &abilityUri, int32_t userId, AbilityInfo &abilityInfo) const
{
APP_LOGD("abilityUri is %{public}s", abilityUri.c_str());
APP_LOGD("abilityUri is %{private}s", abilityUri.c_str());
int32_t requestUserId = GetUserId(userId);
if (requestUserId == Constants::INVALID_USERID) {
return false;
@ -740,13 +740,13 @@ bool BundleDataMgr::QueryAbilityInfoByUri(
return true;
}
APP_LOGE("query abilityUri(%{public}s) failed.", abilityUri.c_str());
APP_LOGE("query abilityUri(%{private}s) failed.", abilityUri.c_str());
return false;
}
bool BundleDataMgr::QueryAbilityInfosByUri(const std::string &abilityUri, std::vector<AbilityInfo> &abilityInfos)
{
APP_LOGI("abilityUri is %{public}s", abilityUri.c_str());
APP_LOGI("abilityUri is %{private}s", abilityUri.c_str());
if (abilityUri.empty()) {
return false;
}
@ -2402,7 +2402,6 @@ bool BundleDataMgr::GetClonedBundleName(const std::string &bundleName, std::stri
}
}
return false;
APP_LOGI("GetCloneBundleName finish");
}
bool BundleDataMgr::SavePreInstallBundleInfo(
@ -2749,7 +2748,7 @@ bool BundleDataMgr::ImplicitQueryExtensionInfos(
APP_LOGE("param invalid");
return false;
}
APP_LOGD("action:%{public}s, uri:%{public}s, type:%{public}s",
APP_LOGD("action:%{public}s, uri:%{private}s, type:%{public}s",
want.GetAction().c_str(), want.GetUriString().c_str(), want.GetType().c_str());
APP_LOGD("flags:%{public}d, userId:%{public}d", flags, userId);
@ -2905,7 +2904,7 @@ bool BundleDataMgr::QueryExtensionAbilityInfoByUri(const std::string &uri, int32
// 2. replace :/// with ://
convertUri.replace(schemePos, Constants::PARAM_URI_SEPARATOR_LEN,
Constants::URI_SEPARATOR);
APP_LOGD("convertUri : %{public}s", convertUri.c_str());
APP_LOGD("convertUri : %{private}s", convertUri.c_str());
std::lock_guard<std::mutex> lock(bundleInfoMutex_);
if (bundleInfos_.empty()) {
@ -2937,7 +2936,7 @@ bool BundleDataMgr::QueryExtensionAbilityInfoByUri(const std::string &uri, int32
ApplicationFlag::GET_BASIC_APPLICATION_INFO, responseUserId, extensionAbilityInfo.applicationInfo);
return true;
}
APP_LOGE("QueryExtensionAbilityInfoByUri (%{public}s) failed.", uri.c_str());
APP_LOGE("QueryExtensionAbilityInfoByUri (%{private}s) failed.", uri.c_str());
return false;
}

View File

@ -294,7 +294,7 @@ bool BundleMgrHostImpl::QueryAllAbilityInfos(const Want &want, int32_t userId, s
bool BundleMgrHostImpl::QueryAbilityInfoByUri(const std::string &abilityUri, AbilityInfo &abilityInfo)
{
APP_LOGD("start QueryAbilityInfoByUri, uri : %{public}s", abilityUri.c_str());
APP_LOGD("start QueryAbilityInfoByUri, uri : %{private}s", abilityUri.c_str());
auto dataMgr = GetDataMgrFromService();
if (dataMgr == nullptr) {
APP_LOGE("DataMgr is nullptr");
@ -305,7 +305,7 @@ bool BundleMgrHostImpl::QueryAbilityInfoByUri(const std::string &abilityUri, Abi
bool BundleMgrHostImpl::QueryAbilityInfosByUri(const std::string &abilityUri, std::vector<AbilityInfo> &abilityInfos)
{
APP_LOGD("start QueryAbilityInfosByUri, uri : %{public}s", abilityUri.c_str());
APP_LOGD("start QueryAbilityInfosByUri, uri : %{private}s", abilityUri.c_str());
auto dataMgr = GetDataMgrFromService();
if (dataMgr == nullptr) {
APP_LOGE("DataMgr is nullptr");
@ -317,7 +317,7 @@ bool BundleMgrHostImpl::QueryAbilityInfosByUri(const std::string &abilityUri, st
bool BundleMgrHostImpl::QueryAbilityInfoByUri(
const std::string &abilityUri, int32_t userId, AbilityInfo &abilityInfo)
{
APP_LOGD("start QueryAbilityInfoByUri, uri : %{public}s, userId : %{public}d", abilityUri.c_str(), userId);
APP_LOGD("start QueryAbilityInfoByUri, uri : %{private}s, userId : %{public}d", abilityUri.c_str(), userId);
auto dataMgr = GetDataMgrFromService();
if (dataMgr == nullptr) {
APP_LOGE("DataMgr is nullptr");
@ -1160,7 +1160,7 @@ bool BundleMgrHostImpl::QueryExtensionAbilityInfos(const Want &want, const int32
APP_LOGE("verify permission failed");
return false;
}
APP_LOGD("want uri is %{public}s", want.GetUriString().c_str());
APP_LOGD("want uri is %{private}s", want.GetUriString().c_str());
auto dataMgr = GetDataMgrFromService();
if (dataMgr == nullptr) {
APP_LOGE("DataMgr is nullptr");
@ -1314,7 +1314,7 @@ std::vector<std::string> BundleMgrHostImpl::GetAccessibleAppCodePaths(int32_t us
bool BundleMgrHostImpl::QueryExtensionAbilityInfoByUri(const std::string &uri, int32_t userId,
ExtensionAbilityInfo &extensionAbilityInfo)
{
APP_LOGD("uri : %{public}s, userId : %{public}d", uri.c_str(), userId);
APP_LOGD("uri : %{private}s, userId : %{public}d", uri.c_str(), userId);
auto dataMgr = GetDataMgrFromService();
if (dataMgr == nullptr) {
APP_LOGE("DataMgr is nullptr");
@ -1337,7 +1337,7 @@ std::string BundleMgrHostImpl::GetAppIdByBundleName(const std::string &bundleNam
APP_LOGE("get bundleInfo failed");
return Constants::EMPTY_STRING;
}
APP_LOGD("appId is %{public}s", bundleInfo.appId.c_str());
APP_LOGD("appId is %{private}s", bundleInfo.appId.c_str());
return bundleInfo.appId;
}

View File

@ -123,10 +123,12 @@ ErrCode BundleParser::ParseSysCap(const std::string &pathName, std::vector<std::
if (!ParseStr(outBuffer, SINGLE_SYSCAP_LENGTH, outLen, sysCaps)) {
APP_LOGE("Parse syscaps str failed");
free(outBuffer);
return ERR_APPEXECFWK_PARSE_RPCID_FAILED;
}
APP_LOGE("Parse sysCaps str success");
APP_LOGD("Parse sysCaps str success");
free(outBuffer);
return ERR_OK;
}
} // namespace AppExecFwk

View File

@ -115,30 +115,30 @@ int32_t RPCIDStreamDecodeToBuffer(
contextBufferTail = contextBuffer + bufferLen;
sysCapArrayPtr = contextBuffer + sizeof(RPCIDHead) + APP_SYSCAP_TYPE * sizeof(uint16_t);
if (contextBufferTail <= sysCapArrayPtr) {
HILOG_ERROR(LOG_CORE, "format errorsysCapArray head over to buffer\n");
HILOG_ERROR(LOG_CORE, "format error:sysCapArray head over to buffer\n");
return ERROR;
}
headPtr = (RPCIDHead *)contextBuffer;
if (headPtr->apiVersionType != API_VERSION_TYPE) {
HILOG_ERROR(LOG_CORE, "format errorapiVersionType is invaild\n");
HILOG_ERROR(LOG_CORE, "format error:apiVersionType is invaild\n");
return ERROR;
}
sysCaptype = ntohs(*(uint16_t *)(sysCapArrayPtr - APP_SYSCAP_TYPE * sizeof(uint16_t)));
if (sysCaptype != APP_SYSCAP_TYPE) {
HILOG_ERROR(LOG_CORE, "format errorsysCaptype is invaild\n");
HILOG_ERROR(LOG_CORE, "format error:sysCaptype is invaild\n");
return ERROR;
}
sysCapLength = ntohs(*(uint16_t *)(sysCapArrayPtr - sizeof(uint16_t)));
if (contextBufferTail < sysCapArrayPtr + sysCapLength) {
HILOG_ERROR(LOG_CORE, "format errorsysCapArray tail over to buffer\n");
HILOG_ERROR(LOG_CORE, "format error:sysCapArray tail over to buffer\n");
return ERROR;
}
if (sysCapLength == 0 || (sysCapLength % SINGLE_FEAT_LENGTH) != 0) {
HILOG_ERROR(LOG_CORE, "format errorsysCapLength is invalid\n");
HILOG_ERROR(LOG_CORE, "format error:sysCapLength is invalid\n");
return ERROR;
}

View File

@ -230,6 +230,10 @@ int ImageCompress::DecodePngFile(std::string fileName, std::shared_ptr<ImageBuff
}
FILE* inFile = fopen(fileName.c_str(), "rb");
if (inFile == nullptr) {
APP_LOGE("open file %{private}s failed", fileName.c_str());
return -1;
}
imageBuffer->SetRatio(ratio);
png_structp png = png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL);
if (!png) {
@ -272,6 +276,7 @@ int32_t ImageCompress::EncodePngFile(std::shared_ptr<ImageBuffer>& imageBuffer)
{
if (imageBuffer == nullptr) {
APP_LOGE("ImageCompress: Encode none data");
return -1;
}
png_structp png = png_create_write_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL);
@ -314,6 +319,7 @@ int32_t ImageCompress::EncodePngFile(std::shared_ptr<ImageBuffer>& imageBuffer)
rowPointers = (png_bytep*)malloc(sizeof(png_bytep) * imageBuffer->GetHeight());
if (rowPointers == nullptr) {
APP_LOGE("ImageCompress: malloc failed");
free(memo.buffer);
return -1;
}
for (uint32_t h = 0; h < imageBuffer->GetHeight(); ++h) {
@ -443,6 +449,7 @@ int32_t ImageCompress::EncodeJPGFile(std::shared_ptr<ImageBuffer>& imageBuffer)
if (imageBuffer == nullptr) {
APP_LOGE("ImageCompress: EncodeJPGFile should read image buffer first");
return -1;
}
struct jpeg_compress_struct cinfo;