!38333 锁屏显示

Merge pull request !38333 from jiangzhijun8/master
This commit is contained in:
openharmony_ci 2024-07-23 09:13:37 +00:00 committed by Gitee
commit f88aad36af
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
3 changed files with 24 additions and 1 deletions

View File

@ -588,6 +588,7 @@ void FormPattern::OnModifyDone()
layoutProperty->UpdateRequestFormInfo(info);
UpdateBackgroundColorWhenUnTrustForm();
info.obscuredMode = isFormObscured_;
info.obscuredMode |= CheckFormBundleForbidden(info.bundleName);
HandleFormComponent(info);
}
@ -615,6 +616,7 @@ bool FormPattern::OnDirtyLayoutWrapperSwap(const RefPtr<LayoutWrapper>& dirty, c
UpdateBackgroundColorWhenUnTrustForm();
info.obscuredMode = isFormObscured_;
info.obscuredMode |= CheckFormBundleForbidden(info.bundleName);
HandleFormComponent(info);
return false;
}
@ -680,7 +682,7 @@ void FormPattern::AddFormComponent(const RequestFormInfo& info)
#else
formManagerBridge_->AddForm(host->GetContextRefPtr(), info);
#endif
if (formManagerBridge_->CheckFormBundleForbidden(info.bundleName)) {
if (CheckFormBundleForbidden(info.bundleName)) {
LoadDisableFormStyle(info);
}
}
@ -1893,4 +1895,10 @@ void FormPattern::UnregisterAccessibility()
CHECK_NULL_VOID(formNode);
formNode->ClearAccessibilityChildTreeRegisterFlag();
}
bool FormPattern::CheckFormBundleForbidden(const std::string &bundleName)
{
CHECK_NULL_RETURN(formManagerBridge_, false);
return formManagerBridge_->CheckFormBundleForbidden(bundleName);
}
} // namespace OHOS::Ace::NG

View File

@ -208,6 +208,7 @@ private:
bool IsMaskEnableForm(const RequestFormInfo &info);
void UpdateChildNodeOpacity(FormChildNodeType formChildNodeType, double opacity);
void SnapshotSurfaceNode();
bool CheckFormBundleForbidden(const std::string &bundleName);
// used by ArkTS Card, for RSSurfaceNode from FRS,
RefPtr<RenderContext> externalRenderContext_;

View File

@ -1526,4 +1526,18 @@ HWTEST_F(FormTestNg, SnapshotSurfaceNode, TestSize.Level1)
pattern->SnapshotSurfaceNode();
ASSERT_NE(host, nullptr);
}
/**
* @tc.name: CheckFormBundleForbidden
* @tc.desc: Test CheckFormBundleForbidden in Form Pattern.
* @tc.type: FUNC
*/
HWTEST_F(FormTestNg, CheckFormBundleForbidden, TestSize.Level1)
{
RefPtr<FrameNode> frameNode = CreateFromNode();
auto pattern = frameNode->GetPattern<FormPattern>();
ASSERT_NE(pattern, nullptr);
bool isForbidden = pattern->CheckFormBundleForbidden("MyBundleName");
ASSERT_EQ(isForbidden, false);
}
} // namespace OHOS::Ace::NG