add ndk heads

Change-Id: I40cd6603bc4c61ef97999aaec5406d75929003ee

Match-id-9b7b677e35d930fde7f4c05f19f2dd3674a4a665
This commit is contained in:
authName 2023-11-25 17:53:47 +08:00 committed by userName
parent 3ba6ed4667
commit 049ff5b76e
2 changed files with 97 additions and 97 deletions

View File

@ -43,9 +43,9 @@
extern "C" {
#endif
/**
* @brief Asset数据
* @brief
*
* @param attributes Asset数据的属性数组的指
* @param attributes
* @param attrCnt attributes数组中元素的个数
* @return {@link Asset_ResultCode#ASSET_SUCCESS}
* @since 11
@ -53,9 +53,9 @@ extern "C" {
int32_t OH_Asset_Add(const Asset_Attr *attributes, uint32_t attrCnt);
/**
* @brief Asset数据
* @brief
*
* @param query Asset数据的属性数组的指
* @param query
* @param queryCnt query数组中元素的个数
* @return {@link Asset_ResultCode#ASSET_SUCCESS}
* @since 11
@ -63,11 +63,11 @@ int32_t OH_Asset_Add(const Asset_Attr *attributes, uint32_t attrCnt);
int32_t OH_Asset_Remove(const Asset_Attr *query, uint32_t queryCnt);
/**
* @brief Asset数据
* @brief
*
* @param query Asset数据的属性数组的指
* @param query
* @param queryCnt query数组中元素的个数
* @param attributesToUpdate Asset数据的属性数组的指
* @param attributesToUpdate
* @param updateCnt attributesToUpdate数组中元素的个数
* @return {@link Asset_ResultCode#ASSET_SUCCESS}
* @since 11
@ -76,9 +76,9 @@ int32_t OH_Asset_Update(const Asset_Attr *query, uint32_t queryCnt,
const Asset_Attr *attributesToUpdate, uint32_t updateCnt);
/**
* @brief Asset数据的查询前的预处challenge
* @brief challenge
*
* @param query Asset数据的属性数组的指
* @param query
* @param queryCnt query数组中元素的个数
* @param challenge {@link OH_Asset_Query}使
* @return {@link Asset_ResultCode#ASSET_SUCCESS}
@ -87,9 +87,9 @@ int32_t OH_Asset_Update(const Asset_Attr *query, uint32_t queryCnt,
int32_t OH_Asset_PreQuery(const Asset_Attr *query, uint32_t queryCnt, Asset_Blob *challenge);
/**
* @brief Asset数据
* @brief
*
* @param query Asset数据的属性数组的指
* @param query
* @param queryCnt query数组中元素的个数
* @param result
* @return {@link Asset_ResultCode#ASSET_SUCCESS}
@ -98,7 +98,7 @@ int32_t OH_Asset_PreQuery(const Asset_Attr *query, uint32_t queryCnt, Asset_Blob
int32_t OH_Asset_Query(const Asset_Attr *query, uint32_t queryCnt, Asset_ResultSet *resultSet);
/**
* @brief Asset数据的查询后的后置处
* @brief
*
* @param handle {@link OH_Asset_PreQuery}
* @param handleCnt handle数组中元素的个数

View File

@ -20,7 +20,7 @@
* @addtogroup AssetTypeApi
* @{
*
* @brief Defines the enumerated values, data structures and error codes used by Asset APIs.
* @brief Asset 使
*
* @syscap SystemCapability.Security.Asset
* @since 11
@ -29,7 +29,7 @@
/**
* @file asset_type.h
*
* @brief Defines the enumerated values, data structures and error codes used by Asset APIs.
* @brief Asset 使
*
* @since 11
*/
@ -42,388 +42,388 @@ extern "C" {
#endif
/**
* @brief An enum type containing the data type definitions for Asset attribute value.
* @brief Asset属性值的数据类型定义的枚举类型
*
* @since 11
*/
typedef enum {
/**
* The data type of Asset attribute value is bool.
* Asset属性值是bool数据类型
*/
ASSET_TYPE_BOOL = 0x1 << 28,
/**
* The data type of Asset attribute value is uint32.
* Asset属性值是uint32数据类型
*/
ASSET_TYPE_NUMBER = 0x2 << 28,
/**
* The data type of Asset attribute value is byte array.
* Asset属性值是byte数据类型
*/
ASSET_TYPE_BYTES = 0x3 << 28,
} Asset_TagType;
/**
* @brief The mask used to obtain the data type of Asset attribute value.
* @brief Asset属性值的数据类型的掩码
*
* @since 11
*/
#define ASSET_TAG_TYPE_MASK (0xF << 28)
/**
* @brief An enum type containing the Asset attribute tags.
* @brief Asset属性标记枚举
*
* @since 11
*/
typedef enum {
/**
* A tag whose value is a byte array indicating the sensitive user data such as passwords and tokens.
* bytes类型
*/
ASSET_TAG_SECRET = ASSET_TYPE_BYTES | 0x01,
/**
* A tag whose value is a byte array identifying an Asset.
* bytes类型
*/
ASSET_TAG_ALIAS = ASSET_TYPE_BYTES | 0x02,
/**
* A tag whose value is a 32-bit unsigned integer indicating when the Asset can be accessed.
* 访uint32类型
*/
ASSET_TAG_ACCESSIBILITY = ASSET_TYPE_NUMBER | 0x03,
/**
* A tag whose value is a bool indicating whether a screen lock password is set for the device.
* bool类型
*/
ASSET_TAG_REQUIRE_PASSWORD_SET = ASSET_TYPE_BOOL | 0x04,
/**
* A tag whose value is a 32-bit unsigned integer indicating the user authentication type for Asset access control.
* uint32类型
*/
ASSET_TAG_AUTH_TYPE = ASSET_TYPE_NUMBER | 0x05,
/**
* A tag whose value is a 32-bit unsigned integer indicating the validity period in seconds of user authentication.
* uint32类型
*/
ASSET_TAG_AUTH_VALIDITY_PERIOD = ASSET_TYPE_NUMBER | 0x06,
/**
* A tag whose value is a byte array indicating the authentication challenge for anti-replay protection.
* bytes类型
*/
ASSET_TAG_AUTH_CHALLENGE = ASSET_TYPE_BYTES | 0x07,
/**
* A tag whose value is a byte array indicating the authentication token after a user is verified.
* bytes类型
*/
ASSET_TAG_AUTH_TOKEN = ASSET_TYPE_BYTES | 0x08,
/**
* A tag whose value is a 32-bit unsigned integer indicating the type of Asset synchronization.
* uint32类型
*/
ASSET_TAG_SYNC_TYPE = ASSET_TYPE_NUMBER | 0x10,
/**
* A tag whose value is a bool indicating whether Asset is stored persistently.
* bool类型
*/
ASSET_TAG_IS_PERSISTENT = ASSET_TYPE_BOOL | 0x11,
/**
* A tag whose value is a byte array indicating the first user-defined Asset data label (not allow to update).
* bytes类型
*/
ASSET_TAG_DATA_LABEL_CRITICAL_1 = ASSET_TYPE_BYTES | 0x20,
/**
* A tag whose value is a byte array indicating the second user-defined Asset data label (not allow to update).
* bytes类型
*/
ASSET_TAG_DATA_LABEL_CRITICAL_2 = ASSET_TYPE_BYTES | 0x21,
/**
* A tag whose value is a byte array indicating the third user-defined Asset data label (not allow to update).
* bytes类型
*/
ASSET_TAG_DATA_LABEL_CRITICAL_3 = ASSET_TYPE_BYTES | 0x22,
/**
* A tag whose value is a byte array indicating the fourth user-defined Asset data label (not allow to update).
* bytes类型
*/
ASSET_TAG_DATA_LABEL_CRITICAL_4 = ASSET_TYPE_BYTES | 0x23,
/**
* A tag whose value is a byte array indicating the first user-defined Asset data label (allow to update).
* bytes类型
*/
ASSET_TAG_DATA_LABEL_NORMAL_1 = ASSET_TYPE_BYTES | 0x30,
/**
* A tag whose value is a byte array indicating the second user-defined Asset data label (allow to update).
* bytes类型
*/
ASSET_TAG_DATA_LABEL_NORMAL_2 = ASSET_TYPE_BYTES | 0x31,
/**
* A tag whose value is a byte array indicating the third user-defined Asset data label (allow to update).
* bytes类型
*/
ASSET_TAG_DATA_LABEL_NORMAL_3 = ASSET_TYPE_BYTES | 0x32,
/**
* A tag whose value is a byte array indicating the fourth user-defined Asset data label (allow to update).
* bytes类型
*/
ASSET_TAG_DATA_LABEL_NORMAL_4 = ASSET_TYPE_BYTES | 0x33,
/**
* A tag whose value is a 32-bit unsigned integer indicating the return type of the queried Asset.
* uint32类型
*/
ASSET_TAG_RETURN_TYPE = ASSET_TYPE_NUMBER | 0x40,
/**
* A tag whose value is a 32-bit unsigned integer indicating the maximum number of returned Assets in one query.
* uint32类型
*/
ASSET_TAG_RETURN_LIMIT = ASSET_TYPE_NUMBER | 0x41,
/**
* A tag whose value is a 32-bit unsigned integer indicating the offset of return data in batch query.
* uint32类型
*/
ASSET_TAG_RETURN_OFFSET = ASSET_TYPE_NUMBER | 0x42,
/**
* A tag whose value is a 32-bit unsigned integer indicating how the query results are sorted.
* uint32类型
*/
ASSET_TAG_RETURN_ORDERED_BY = ASSET_TYPE_NUMBER | 0x43,
/**
* A tag whose value is a 32-bit unsigned integer indicating the strategy for resolving Asset conflicts.
* uint32类型
*/
ASSET_TAG_CONFLICT_RESOLUTION = ASSET_TYPE_NUMBER | 0x44,
} Asset_Tag;
/**
* @brief An enum type containing the Asset result codes.
* @brief Asset操作的返回结果码
*
* @since 11
*/
typedef enum {
/**
* The result code indicates that the operation is successful.
*
*/
ASSET_SUCCESS = 0,
/**
* The error code indicates that the caller doesn't have permission to operate.
*
*/
ASSET_PERMISSION_DENIED = 201,
/**
* The error code indicates that the argument is invalid.
*
*/
ASSET_INVALID_ARGUMENT = 401,
/**
* The error code indicates that the Asset service is unavailable.
*
*/
ASSET_SERVICE_UNAVAILABLE = 24000001,
/**
* The error code indicates that the queried Asset can not be found.
*
*/
ASSET_NOT_FOUND = 24000002,
/**
* The error code indicates that the added Asset already exists.
*
*/
ASSET_DUPLICATED = 24000003,
/**
* The error code indicates that the access to Asset is denied.
* 访
*/
ASSET_ACCESS_DENIED = 24000004,
/**
* The error code indicates that the screen lock status mismatches.
*
*/
ASSET_STATUS_MISMATCH = 24000005,
/**
* The error code indicates insufficient memory.
*
*/
ASSET_OUT_OF_MEMRORY = 24000006,
/**
* The error code indicates that the Asset is corrupted.
*
*/
ASSET_DATA_CORRUPTED = 24000007,
/**
* The error code indicates that the database operation is failed.
*
*/
ASSET_DATABASE_ERROR = 24000008,
/**
* The error code indicates that the cryptography operation is failed.
*
*/
ASSET_CRYPTO_ERROR = 2400009,
/**
* The error code indicates that the ipc communication is failed.
*
*/
ASSET_IPC_ERROR = 24000010,
/**
* The error code indicates that the operation of calling bundle manager service is failed.
*
*/
ASSET_BMS_ERROR = 24000011,
/**
* The error code indicates that the operation of calling OS account service is failed.
*
*/
ASSET_ACCOUNT_ERROR = 24000012,
/**
* The error code indicates that the operation of calling access token service is failed.
* 访
*/
ASSET_ACCESS_TOKEN_ERROR = 24000013,
/**
* The error code indicates that the operation of file is failed.
*
*/
ASSET_FILE_OPERATION_ERROR = 24000014,
/**
* The error code indicates that the operation of getting system time is failed.
*
*/
ASSET_GET_SYSTEM_TIME_ERROR = 24000015,
/**
* The error code indicates that the amount of map element or other limited quotas exceed the limit.
*
*/
ASSET_LIMIT_EXCEEDED = 24000016,
/**
* The error code indicates that the capability is not supported.
*
*/
ASSET_UNSUPPORTED = 24000017,
} Asset_ResultCode;
/**
* @brief An enum type indicates when the Asset is accessible.
* @brief 访
*
* @since 11
*/
typedef enum {
/**
* The secret value in the Asset can only be accessed after the device is powered on.
* 访
*/
ASSET_ACCESSIBILITY_DEVICE_POWER_ON = 0,
/**
* The secret value in the Asset can only be accessed after the device is first unlocked.
* 访
*/
ASSET_ACCESSIBILITY_DEVICE_FIRST_UNLOCKED = 1,
/**
* The secret value in the Asset can only be accessed while the device is unlocked.
* 访
*/
ASSET_ACCESSIBILITY_DEVICE_UNLOCKED = 2,
} Asset_Accessibility;
/**
* @brief An enum type indicates the user authentication type for Asset access control.
* @brief
*
* @since 11
*/
typedef enum {
/**
* The access to an Asset doesn't require user authentication.
*
*/
ASSET_AUTH_TYPE_NONE = 0x00,
/**
* The access to an Asset requires user authentication using either PIN/pattern/password or biometric traits.
* PIN
*/
ASSET_AUTH_TYPE_ANY = 0xFF,
} Asset_AuthType;
/**
* @brief An enum type indicates the type of Asset synchronization.
* @brief
*
* @since 11
*/
typedef enum {
/**
* An Asset with this attribute value is never allowed to be transferred out.
*
*/
ASSET_SYNC_TYPE_NEVER = 0,
/**
* An Asset with this attribute value can only be restored to the device from which it was transferred out.
*
*/
ASSET_SYNC_TYPE_THIS_DEVICE = 1 << 0,
/**
* An Asset with this attribute value can only be transferred out to a trusted device (user authorized).
*
*/
ASSET_SYNC_TYPE_TRUSTED_DEVICE = 1 << 1,
} Asset_SyncType;
/**
* @brief An enum type indicates the strategy for conflict resolution when handling duplicated Asset alias.
* @brief
*
* @since 11
*/
typedef enum {
/**
* Directly overwrite an Asset with duplicated alias when a conflict is detected.
*
*/
ASSET_CONFLICT_OVERWRITE = 0,
/**
* Throw an error so that the caller can take measures when a conflict is detected.
* 便
*/
ASSET_CONFLICT_THROW_ERROR = 1,
} Asset_ConflictResolution;
/**
* @brief An enum type indicates the return type of the queried Asset.
* @brief
*
* @since 11
*/
typedef enum {
/**
* Specify that the return data should contain both secret value and attributes.
*
*/
ASSET_RETURN_ALL = 0,
/**
* Specify that the return data contains only attributes.
*
*/
ASSET_RETURN_ATTRIBUTES = 1,
} Asset_ReturnType;
/**
* @brief A type that indicates the Asset attribute whose value is a byte array.
* @brief 使bytes类型
*
* @since 11
*/
typedef struct {
/**
* The size of byte array.
*
*/
uint32_t size;
/**
* The data of byte array.
*
*/
uint8_t *data;
} Asset_Blob;
/**
* @brief A type that indicates the secret or attribute value of an Asset tag.
* @brief
*
* @since 11
*/
typedef union {
/**
* Value of the asset attribute whose data type is bool.
* bool类型的关键资产数据
*/
bool boolean;
/**
* Value of the asset attribute whose data type is uint32.
* uint32类型的关键资产数据
*/
uint32_t u32;
/**
* Value of the asset attribute whose data type is byte array.
* bytes类型的关键资产数据
*/
Asset_Blob blob;
} Asset_Value;
/**
* @brief A type that indicates the tag-value pair of the Asset attribute.
* @brief -
*
* @since 11
*/
typedef struct {
/**
* The tag of the Asset attribute.
*
*/
uint32_t tag;
/**
* The value of the Asset attribute.
*
*/
Asset_Value value;
} Asset_Attr;
/**
* @brief A type that indicates the query result of an Asset record.
* @brief -
*
* @since 11
*/
typedef struct {
/**
* The count of an Asset attributes.
*
*/
uint32_t count;
/**
* The attributes of an Asset.
*
*/
Asset_Attr *attrs;
} Asset_Result;
/**
* @brief A type that indicates the Asset query result set.
* @brief
*
* @since 11
*/
typedef struct {
/**
* The count of the result set.
* -
*/
uint32_t count;
/**
* The query result set.
* -
*/
Asset_Result *results;
} Asset_ResultSet;