mirror of
https://gitee.com/openharmony/print_print_fwk
synced 2024-11-23 08:59:47 +00:00
commit
9343f6624e
@ -249,7 +249,7 @@ bool MemSetScannerOptions(Scan_ScannerOptions* scannerOptions, int32_t &optionCo
|
||||
{
|
||||
for (int i = 0; i < optionCount; i++) {
|
||||
auto bufferSize = paraTable.titBuff[i].length() + 1;
|
||||
char* titBuff = new(std::nothrow) char[bufferSize];
|
||||
char* titBuff = new (std::nothrow) char[bufferSize];
|
||||
if (!CopySingleBuf(titBuff, paraTable.titBuff[i].c_str(), bufferSize)) {
|
||||
if (titBuff != nullptr) {
|
||||
delete[] titBuff;
|
||||
|
@ -60,7 +60,7 @@ private:
|
||||
bool ParseAbilityContextReq(napi_env env, const napi_value &obj,
|
||||
std::shared_ptr<OHOS::AbilityRuntime::AbilityContext> &abilityContext,
|
||||
std::shared_ptr<OHOS::AbilityRuntime::UIExtensionContext> &uiExtensionContext);
|
||||
void StartUIExtensionAbility(
|
||||
uint32_t StartUIExtensionAbility(
|
||||
std::shared_ptr<BaseContext> asyncContext, const std::shared_ptr<AdapterParam> &adapterParam);
|
||||
uint32_t StartUIExtensionAbility(OHOS::AAFwk::Want &want, std::shared_ptr<BaseContext> asyncContext);
|
||||
OHOS::Ace::UIContent* GetUIContent(const BaseContext *asyncContext);
|
||||
|
@ -198,7 +198,11 @@ uint32_t PrintTask::CallSpooler(
|
||||
PRINT_CALL_BASE(env, napi_create_promise(env, &asyncContext->deferred, &result), E_PRINT_INVALID_PARAMETER);
|
||||
PRINT_HILOGD("is a promise api");
|
||||
}
|
||||
StartUIExtensionAbility(asyncContext, adapterParam);
|
||||
uint32_t ret = StartUIExtensionAbility(asyncContext, adapterParam);
|
||||
if (ret != E_PRINT_NONE) {
|
||||
PRINT_HILOGE("StartUIExtensionAbility fail");
|
||||
return ret;
|
||||
}
|
||||
PRINT_HILOGI("end CallSpooler");
|
||||
return E_PRINT_NONE;
|
||||
}
|
||||
@ -236,18 +240,18 @@ bool PrintTask::ParseAbilityContextReq(napi_env env, const napi_value &obj,
|
||||
return true;
|
||||
}
|
||||
|
||||
void PrintTask::StartUIExtensionAbility(
|
||||
uint32_t PrintTask::StartUIExtensionAbility(
|
||||
std::shared_ptr<BaseContext> asyncContext, const std::shared_ptr<AdapterParam> &adapterParam)
|
||||
{
|
||||
PRINT_HILOGD("begin StartUIExtensionAbility");
|
||||
|
||||
if (adapterParam == nullptr) {
|
||||
PRINT_HILOGE("adapterParam is nullptr.");
|
||||
return;
|
||||
return E_PRINT_INVALID_PARAMETER;
|
||||
}
|
||||
if ((adapterParam->isCheckFdList && fileList_.empty() && fdList_.empty())) {
|
||||
PRINT_HILOGE("to be printed filelist and fdlist are empty.");
|
||||
return;
|
||||
return E_PRINT_INVALID_PARAMETER;
|
||||
}
|
||||
AAFwk::Want want;
|
||||
want.SetElementName(SPOOLER_BUNDLE_NAME, SPOOLER_PREVIEW_ABILITY_NAME);
|
||||
@ -266,9 +270,9 @@ void PrintTask::StartUIExtensionAbility(
|
||||
want.SetParam(ABILITY_PARAMS_STREAM, fileList_);
|
||||
want.SetFlags(AAFwk::Want::FLAG_AUTH_READ_URI_PERMISSION);
|
||||
|
||||
StartUIExtensionAbility(want, asyncContext);
|
||||
uint32_t ret = StartUIExtensionAbility(want, asyncContext);
|
||||
PRINT_HILOGD("end StartUIExtensionAbility");
|
||||
return;
|
||||
return ret;
|
||||
}
|
||||
|
||||
uint32_t PrintTask::StartUIExtensionAbility(OHOS::AAFwk::Want &want, std::shared_ptr<BaseContext> asyncContext)
|
||||
|
Loading…
Reference in New Issue
Block a user