diff --git a/common/interface/src/parcel/accessibility_element_info_parcel.cpp b/common/interface/src/parcel/accessibility_element_info_parcel.cpp index 25614af1a..78f45615e 100644 --- a/common/interface/src/parcel/accessibility_element_info_parcel.cpp +++ b/common/interface/src/parcel/accessibility_element_info_parcel.cpp @@ -109,6 +109,7 @@ bool AccessibilityElementInfoParcel::ReadFromParcel(Parcel &parcel) READ_PARCEL_AND_RETURN_FALSE_IF_FAIL(Int32, parcel, inputType_); READ_PARCEL_AND_RETURN_FALSE_IF_FAIL(Bool, parcel, validElement_); READ_PARCEL_AND_RETURN_FALSE_IF_FAIL(String, parcel, inspectorKey_); + READ_PARCEL_AND_RETURN_FALSE_IF_FAIL(String, parcel, pagePath_); return true; } @@ -175,6 +176,7 @@ bool AccessibilityElementInfoParcel::Marshalling(Parcel &parcel) const WRITE_PARCEL_AND_RETURN_FALSE_IF_FAIL(Int32, parcel, inputType_); WRITE_PARCEL_AND_RETURN_FALSE_IF_FAIL(Bool, parcel, validElement_); WRITE_PARCEL_AND_RETURN_FALSE_IF_FAIL(String, parcel, inspectorKey_); + WRITE_PARCEL_AND_RETURN_FALSE_IF_FAIL(String, parcel, pagePath_); return true; } diff --git a/frameworks/common/src/accessibility_element_info.cpp b/frameworks/common/src/accessibility_element_info.cpp index c8dd96576..47c249d90 100644 --- a/frameworks/common/src/accessibility_element_info.cpp +++ b/frameworks/common/src/accessibility_element_info.cpp @@ -378,6 +378,18 @@ const std::string &AccessibilityElementInfo::GetInspectorKey() const return inspectorKey_; } +void AccessibilityElementInfo::SetPagePath(const std::string &path) +{ + HILOG_DEBUG("pagePath_[%{public}s]", path.c_str()); + pagePath_ = path; +} + +const std::string &AccessibilityElementInfo::GetPagePath() const +{ + HILOG_DEBUG("pagePath_[%{public}s]", pagePath_.c_str()); + return pagePath_; +} + bool AccessibilityElementInfo::IsValidElement() const { HILOG_DEBUG("validElement_[%{public}d]", validElement_); diff --git a/interfaces/innerkits/common/include/accessibility_element_info.h b/interfaces/innerkits/common/include/accessibility_element_info.h index 6a7ad4985..8113a0169 100644 --- a/interfaces/innerkits/common/include/accessibility_element_info.h +++ b/interfaces/innerkits/common/include/accessibility_element_info.h @@ -1212,6 +1212,20 @@ public: */ const std::string &GetInspectorKey() const; + /** + * @brief Set the path of page. + * @param path The unique identification of one page. + * @sysCap Accessibility + */ + void SetPagePath(const std::string &path); + + /** + * @brief Get the path of page + * @return Page path + * @sysCap Accessibility + */ + const std::string &GetPagePath() const; + /** * @brief Set page id * @param pageId page id. @@ -1310,6 +1324,7 @@ protected: std::string contentDescription_ = ""; std::string resourceName_ = ""; std::string inspectorKey_ = ""; + std::string pagePath_ = ""; std::vector childNodeIds_; int32_t childCount_ = 0; std::vector operations_;