!2140 添加stage模型下的minSDKVersion

Merge pull request !2140 from yangfan229/minsdk
This commit is contained in:
openharmony_ci
2022-04-06 10:07:48 +00:00
committed by Gitee
3 changed files with 14 additions and 2 deletions
@@ -475,6 +475,14 @@ void UIContentImpl::CommonInitialize(OHOS::Rosen::Window* window, const std::str
Platform::AceContainer::SetView(flutterAceView, density, 0, 0, window_->GetWindowId(), callback);
Platform::FlutterAceView::SurfaceChanged(flutterAceView, 0, 0, deviceHeight >= deviceWidth ? 0 : 1);
auto nativeEngine = reinterpret_cast<NativeEngine*>(runtime_);
// Set sdk version in module json mode
if (isModelJson) {
auto pipeline = container->GetPipelineContext();
if (pipeline && appInfo) {
LOGI("SetMinPlatformVersion code is %{public}d", appInfo->minCompatibleVersionCode);
pipeline->SetMinPlatformVersion(appInfo->minCompatibleVersionCode);
}
}
if (!storage) {
container->SetLocalStorage(nullptr, context->GetBindingObject()->Get<NativeReference>());
} else {
@@ -1306,7 +1306,9 @@ void FrontendDelegateDeclarative::LoadPage(
page->FlushCommands();
// just make sure the pipelineContext is created.
auto pipeline = delegate->pipelineContextHolder_.Get();
pipeline->SetMinPlatformVersion(delegate->GetMinPlatformVersion());
if (delegate->GetMinPlatformVersion() > 0) {
pipeline->SetMinPlatformVersion(delegate->GetMinPlatformVersion());
}
delegate->taskExecutor_->PostTask(
[weak, page] {
auto delegate = weak.Upgrade();
@@ -1144,7 +1144,9 @@ void FrontendDelegateImpl::LoadPage(int32_t pageId, const std::string& url, bool
LOGE("the pipeline context is nullptr");
return;
}
pipelineContext->SetMinPlatformVersion(delegate->GetMinPlatformVersion());
if (delegate->GetMinPlatformVersion() > 0) {
pipelineContext->SetMinPlatformVersion(delegate->GetMinPlatformVersion());
}
delegate->taskExecutor_->PostTask(
[weak, page] {
auto delegate = weak.Upgrade();