From d99782d3dffdf85787d5210532650c1385f97a93 Mon Sep 17 00:00:00 2001 From: Tianshi Liu Date: Wed, 31 Aug 2022 14:43:28 +0800 Subject: [PATCH] face auth demo Change-Id: If3b34fa1163c15d208225e34932c24a1ed71d072 --- api/@ohos.userIAM.faceAuth.d.ts | 10 +++------- api/ohos_userIAM_faceAuth_demo.ts | 10 ++++++++++ 2 files changed, 13 insertions(+), 7 deletions(-) create mode 100644 api/ohos_userIAM_faceAuth_demo.ts diff --git a/api/@ohos.userIAM.faceAuth.d.ts b/api/@ohos.userIAM.faceAuth.d.ts index 50af8dd0bd..00dec0d479 100644 --- a/api/@ohos.userIAM.faceAuth.d.ts +++ b/api/@ohos.userIAM.faceAuth.d.ts @@ -42,9 +42,10 @@ declare namespace faceAuth { * @since 9 * @param surfaceId Indicates surface id for face enroll preview. * @return Operation result. + * @permission ohos.permission.MANAGER_USER_IDM * @systemapi Hide this for inner system use. */ - setSurfaceId(surfaceId: string): ResultCode; + setSurfaceId(surfaceId: string): void; } /** @@ -56,15 +57,10 @@ declare namespace faceAuth { * @systemapi Hide this for inner system use. */ enum ResultCode { - /** - * Indicates that operation is success. - */ - SUCCESS = 0, - /** * Indicates that operation is fail. */ - FAIL = 1, + FAIL = 12700001, } } diff --git a/api/ohos_userIAM_faceAuth_demo.ts b/api/ohos_userIAM_faceAuth_demo.ts new file mode 100644 index 0000000000..01d7883d76 --- /dev/null +++ b/api/ohos_userIAM_faceAuth_demo.ts @@ -0,0 +1,10 @@ +import faceAuth from @ohos.userIAM.faceAuth + +let surfaceId = "dummy surface id" + +let manager = new faceAuth.FaceAuthManager() +try { + manager.setSurfaceId(surfaceId) +} catch (err) { + console.error("set surfaceId fail, err " + err) +} \ No newline at end of file -- Gitee