Skip to main content Crate ohos_asset_sys Copy item path Source Asset_Attr @brief Defines an asset attribute. Asset_Blob @brief Defines an asset value in the forma of a binary array, that is, a variable-length byte array. Asset_Result @brief Represents information about an asset. Asset_ResultSet @brief Represents information about a set of assets. ASSET_TAG_TYPE_MASK Asset_Accessibility_ASSET_ACCESSIBILITY_DEVICE_FIRST_UNLOCKED The asset can be accessed only after the device is unlocked for the first time. Asset_Accessibility_ASSET_ACCESSIBILITY_DEVICE_POWERED_ON The asset can be accessed after the device is powered on. Asset_Accessibility_ASSET_ACCESSIBILITY_DEVICE_UNLOCKED The asset can be accessed only after the device is unlocked. Asset_AuthType_ASSET_AUTH_TYPE_ANY The asset can be accessed if any user authentication (such as PIN, facial, or fingerprint authentication) is
successful. Asset_AuthType_ASSET_AUTH_TYPE_NONE No user authentication is required before the asset is accessed. Asset_ConflictResolution_ASSET_CONFLICT_OVERWRITE Overwrite the existing asset. Asset_ConflictResolution_ASSET_CONFLICT_THROW_ERROR Throw an exception for the service to perform subsequent processing. Asset_OperationType_ASSET_NEED_LOGOUT Logout is required during operation. Asset_OperationType_ASSET_NEED_SYNC Synchronization is required during operation. Asset_ResultCode_ASSET_ACCESS_DENIED @error Access to the asset is denied. Asset_ResultCode_ASSET_ACCESS_TOKEN_ERROR @error Calling the Access Token service failed. Asset_ResultCode_ASSET_ACCOUNT_ERROR @error Calling the OS Account service failed. Asset_ResultCode_ASSET_BMS_ERROR @error Calling the Bundle Manager service failed. Asset_ResultCode_ASSET_CRYPTO_ERROR @error The cryptography operation failed. Asset_ResultCode_ASSET_DATABASE_ERROR @error The database operation failed. Asset_ResultCode_ASSET_DATA_CORRUPTED @error The asset is corrupted. Asset_ResultCode_ASSET_DUPLICATED @error The asset already exists. Asset_ResultCode_ASSET_FILE_OPERATION_ERROR @error The file operation failed. Asset_ResultCode_ASSET_GET_SYSTEM_TIME_ERROR @error Getting the system time failed. Asset_ResultCode_ASSET_INVALID_ARGUMENT @error The parameter is invalid. Asset_ResultCode_ASSET_IPC_ERROR @error IPC failed. Asset_ResultCode_ASSET_LIMIT_EXCEEDED @error The cache exceeds the limit. Asset_ResultCode_ASSET_NOT_FOUND @error The asset is not found. Asset_ResultCode_ASSET_OUT_OF_MEMORY @error Insufficient memory. Asset_ResultCode_ASSET_PERMISSION_DENIED @error The caller doesn’t have the permission. Asset_ResultCode_ASSET_SERVICE_UNAVAILABLE @error The ASSET service is unavailable. Asset_ResultCode_ASSET_STATUS_MISMATCH @error The screen lock status does not match. Asset_ResultCode_ASSET_SUCCESS @error The operation is successful. Asset_ResultCode_ASSET_UNSUPPORTED @error The capability is not supported. Asset_ReturnType_ASSET_RETURN_ALL The query result contains the asset in plaintext and its attributes. Asset_ReturnType_ASSET_RETURN_ATTRIBUTES The query result contains only the asset attributes. Asset_SyncType_ASSET_SYNC_TYPE_NEVER Asset synchronization is not allowed. Asset_SyncType_ASSET_SYNC_TYPE_THIS_DEVICE Asset synchronization is allowed only on the local device, for example, in data restoration on the local device. Asset_SyncType_ASSET_SYNC_TYPE_TRUSTED_ACCOUNT Asset synchronization is allowed only between devices with trusted accounts. Asset_SyncType_ASSET_SYNC_TYPE_TRUSTED_DEVICE Asset synchronization is allowed only between trusted devices, for example, in the case of cloning. Asset_TagType_ASSET_TYPE_BOOL The asset attribute tag is a Boolean value. Asset_TagType_ASSET_TYPE_BYTES The asset attribute tag is an array of bytes. Asset_TagType_ASSET_TYPE_NUMBER The asset attribute tag is a number. Asset_Tag_ASSET_TAG_ACCESSIBILITY Time when the asset is accessible. The value is of the uint32 type, which is a 32-bit unsigned integer. Asset_Tag_ASSET_TAG_ALIAS Asset alias (identifier) in the form of bytes. Asset_Tag_ASSET_TAG_AUTH_CHALLENGE Challenge value, in the form of bytes, used for anti-replay during the authentication. Asset_Tag_ASSET_TAG_AUTH_TOKEN Authentication token, in the form of bytes, obtained after a successful user authentication. Asset_Tag_ASSET_TAG_AUTH_TYPE User authentication type for the asset. The value is of the uint32 type. Asset_Tag_ASSET_TAG_AUTH_VALIDITY_PERIOD Validity period of the user authentication, in seconds. The value is of the uint32 type. Asset_Tag_ASSET_TAG_CONFLICT_RESOLUTION Policy used to resolve the conflict occurred when an asset is added. The value is of the uint32 type. Asset_Tag_ASSET_TAG_DATA_LABEL_CRITICAL_1 An immutable custom field, in the form of bytes. Asset_Tag_ASSET_TAG_DATA_LABEL_CRITICAL_2 An immutable custom field, in the form of bytes. Asset_Tag_ASSET_TAG_DATA_LABEL_CRITICAL_3 An immutable custom field, in the form of bytes. Asset_Tag_ASSET_TAG_DATA_LABEL_CRITICAL_4 An immutable custom field, in the form of bytes. Asset_Tag_ASSET_TAG_DATA_LABEL_NORMAL_1 A mutable custom field, in the form of bytes. Asset_Tag_ASSET_TAG_DATA_LABEL_NORMAL_2 A mutable custom field, in the form of bytes. Asset_Tag_ASSET_TAG_DATA_LABEL_NORMAL_3 A mutable custom field, in the form of bytes. Asset_Tag_ASSET_TAG_DATA_LABEL_NORMAL_4 A mutable custom field, in the form of bytes. Asset_Tag_ASSET_TAG_DATA_LABEL_NORMAL_LOCAL_1 A mutable custom field, in the form of bytes. The information of a local tag will not be synchronized. Asset_Tag_ASSET_TAG_DATA_LABEL_NORMAL_LOCAL_2 A mutable custom field, in the form of bytes. The information of a local tag will not be synchronized. Asset_Tag_ASSET_TAG_DATA_LABEL_NORMAL_LOCAL_3 A mutable custom field, in the form of bytes. The information of a local tag will not be synchronized. Asset_Tag_ASSET_TAG_DATA_LABEL_NORMAL_LOCAL_4 A mutable custom field, in the form of bytes. The information of a local tag will not be synchronized. Asset_Tag_ASSET_TAG_IS_PERSISTENT A Boolean value indicating whether the asset needs to be stored persistently. Asset_Tag_ASSET_TAG_OPERATION_TYPE A tag whose value is the uint32 type indicating the additional action. Asset_Tag_ASSET_TAG_REQUIRE_PASSWORD_SET A Boolean value indicating whether the asset is available only with a lock screen password. Asset_Tag_ASSET_TAG_RETURN_LIMIT Maximum number of assets that can be returned at a time if multiple asset records match the specified conditions.
The value is of the uint32 type. Asset_Tag_ASSET_TAG_RETURN_OFFSET Offset that indicates the start asset when multiple asset records are returned. The value is of the uint32 type. Asset_Tag_ASSET_TAG_RETURN_ORDERED_BY Sorting order of the assets in the query result. The value is of the uint32 type. Asset_Tag_ASSET_TAG_RETURN_TYPE Return type of the queried asset. The value is of the uint32 type. Asset_Tag_ASSET_TAG_SECRET Sensitive user data in the form of bytes, such as passwords and tokens. Asset_Tag_ASSET_TAG_SYNC_TYPE Asset synchronization type. The value is of the uint32 type. Asset_Tag_ASSET_TAG_UPDATE_TIME A tag whose value is a byte array indicating the update time of an Asset. OH_Asset_Add ⚠ @brief Adds an asset. Permission ohos.permission.STORE_PERSISTENT_DATA is required when the Asset needs to be stored
persistently by setting {@link ASSET_TAG_IS_PERSISTENT} tag. OH_Asset_FreeBlob ⚠ @brief Releases the memory occupied by the challenge value. OH_Asset_FreeResultSet ⚠ @brief Releases the memory occupied by the query result. OH_Asset_ParseAttr ⚠ @brief Parses the query result to obtain the specified attribute value. OH_Asset_PostQuery ⚠ @brief Processes data after the query of the asset that requires user authentication. OH_Asset_PreQuery ⚠ @brief Preprocesses data before querying the asset that can be accessed only after a successful user authentication. OH_Asset_Query ⚠ @brief Queries assets. OH_Asset_Remove ⚠ @brief Removes one or more assets. OH_Asset_Update ⚠ @brief Updates an asset. Asset_Accessibility @brief Enumerates the types of the access control based on the lock screen status. Asset_AuthType @brief Enumerates the user authentication types supported for assets. Asset_ConflictResolution @brief Enumerates the policies for resolving the conflict (for example, duplicate alias) occurred when
an asset is added. Asset_OperationType @brief Enumerates the types of the additional action. Asset_ResultCode @brief Enumerates the result codes used in the ASSET APIs. Asset_ReturnType @brief Enumerates the types of the asset query result. Asset_SyncType @brief Enumerates the asset synchronization types. Asset_Tag @brief Enumerates the asset attribute tags. Asset_TagType @brief Enumerates the types of the asset attribute tags. Asset_Value @brief Defines the value (content) of an asset attribute.