From 84c21073ab6e3bced4764556f5e5f46b97f1a43e Mon Sep 17 00:00:00 2001 From: qianyong325 Date: Tue, 3 Jun 2025 20:02:46 +0800 Subject: [PATCH] =?UTF-8?q?UDMF=E5=85=AC=E5=85=B1=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E9=80=9A=E8=B7=AF=E5=8F=AF=E8=A7=81=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: qianyong325 --- distributeddatamgr/udmf/include/udmf.h | 40 ++++++++++++++++++++++++ distributeddatamgr/udmf/libudmf.ndk.json | 8 +++++ 2 files changed, 48 insertions(+) diff --git a/distributeddatamgr/udmf/include/udmf.h b/distributeddatamgr/udmf/include/udmf.h index e3c38a098..595301e03 100644 --- a/distributeddatamgr/udmf/include/udmf.h +++ b/distributeddatamgr/udmf/include/udmf.h @@ -146,6 +146,23 @@ typedef enum Udmf_ProgressIndicator { UDMF_DEFAULT = 1 } Udmf_ProgressIndicator; +/** + * @brief Describe the visibility range of data + * + * @since 20 + */ +typedef enum Udmf_Visibility { + /** + * @brief The visibility level that specifies that any hap or native can be obtained. + */ + UDMF_ALL, + + /** + * @brief The visibility level that specifies that only data providers can be obtained. + */ + UDMF_OWN_PROCESS +} Udmf_Visibility; + /** * @brief Describes the unified data type. * @@ -910,6 +927,29 @@ int OH_UdmfOptions_SetIntention(OH_UdmfOptions* pThis, Udmf_Intention intention) */ int OH_UdmfOptions_Reset(OH_UdmfOptions* pThis); +/** + * @brief Get visibility from the {@link OH_UdmfOptions}. + * + * @param pThis Represents a pointer to an instance of {@link OH_UdmfOptions}. + * @return Returns {@link Udmf_Visibility} value. + * @see OH_UdmfOptions Udmf_Visibility + * @since 20 + */ +Udmf_Visibility OH_UdmfOptions_GetVisibility(OH_UdmfOptions* pThis); + +/** + * @brief Set visibility value to {@link OH_UdmfOptions}. + * + * @param pThis Represents a pointer to an instance of {@link OH_UdmfOptions}. + * @param visibility Represents new {@link Udmf_Visibility} param. + * @return Returns the status code of the execution. See {@link Udmf_ErrCode}. + * {@link UDMF_E_OK} success. + * {@link UDMF_E_INVALID_PARAM} The error code for common invalid args. + * @see OH_UdmfOptions Udmf_Visibility Udmf_ErrCode. + * @since 20 + */ +int OH_UdmfOptions_SetVisibility(OH_UdmfOptions* pThis, Udmf_Visibility visibility); + /** * @brief Get {@link OH_UdmfData} data from udmf database. * diff --git a/distributeddatamgr/udmf/libudmf.ndk.json b/distributeddatamgr/udmf/libudmf.ndk.json index 27336bceb..7b8eed1fe 100644 --- a/distributeddatamgr/udmf/libudmf.ndk.json +++ b/distributeddatamgr/udmf/libudmf.ndk.json @@ -650,5 +650,13 @@ { "first_introduced": "20", "name": "OH_UdmfDataLoadInfo_SetRecordCount" + }, + { + "first_introduced": "20", + "name": "OH_UdmfOptions_GetVisibility" + }, + { + "first_introduced": "20", + "name": "OH_UdmfOptions_SetVisibility" } ] \ No newline at end of file -- Gitee