From 1744e63475f19d051b96331018c5d2b1b85fcdf7 Mon Sep 17 00:00:00 2001 From: chennian Date: Mon, 20 Jun 2022 12:58:29 +0800 Subject: [PATCH 01/15] Signed-off-by:chennianchennian1@huawei.com Signed-off-by: chennian --- api/@ohos.privacyManager.d.ts | 34 ++++++++++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/api/@ohos.privacyManager.d.ts b/api/@ohos.privacyManager.d.ts index d5d0c94d98..6503541d73 100644 --- a/api/@ohos.privacyManager.d.ts +++ b/api/@ohos.privacyManager.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import {AsyncCallback} from './basic' +import {AsyncCallback, Callback} from './basic' /** * @syscap SystemCapability.Security.AccessToken @@ -36,7 +36,7 @@ import {AsyncCallback} from './basic' /** * Queries the access records of sensitive permission. * @param request The request of permission used records. - * @return Return the reponse of permission used records. + * @return Return the response of permission used records. * @permission ohos.permission.PERMISSION_USED_STATS. * @systemapi hide this for inner system use * @since 9 @@ -44,6 +44,36 @@ import {AsyncCallback} from './basic' function getPermissionUsedRecords(request: PermissionUsedRequest): Promise; function getPermissionUsedRecords(request: PermissionUsedRequest, callback: AsyncCallback): void; + /** + * Register a permission used state callback. + * @param permissionName The permission to be listened. + * @param callback The permission used change callback to be registered. + * @permission ohos.permission.PERMISSION_USED_STATS. + * @systemapi hide this for inner system use + * @since 9 + */ + function addPermissionUsedStateListener(permissionName: string, callback: Callback<{tokenID: number, permissionName: string, status: PermissionUsedState}>): void; + + /** + * PermissionUsedState. + * @systemapi hide this for inner system use + * @since 9 + */ + enum PermissionUsedState { + /** + * active in foreground + */ + ACTIVE_FOREGROUND = 0, + /** + * active in background + */ + ACTIVE_BACKGROUND = 1, + /** + * inactive + */ + INACTIVE = 2, + } + /** * PermissionUsageFlag. * @systemapi hide this for inner system use -- Gitee From 471f89432938e8b337f468b08e3f56f0bb7dc837 Mon Sep 17 00:00:00 2001 From: chennian Date: Mon, 20 Jun 2022 13:37:27 +0800 Subject: [PATCH 02/15] Signed-off-by:chennianchennian1@huawei.com Signed-off-by: chennian --- api/@ohos.privacyManager.d.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/api/@ohos.privacyManager.d.ts b/api/@ohos.privacyManager.d.ts index 6503541d73..b19a759a30 100644 --- a/api/@ohos.privacyManager.d.ts +++ b/api/@ohos.privacyManager.d.ts @@ -53,7 +53,17 @@ import {AsyncCallback, Callback} from './basic' * @since 9 */ function addPermissionUsedStateListener(permissionName: string, callback: Callback<{tokenID: number, permissionName: string, status: PermissionUsedState}>): void; - + + /** + * Unregister a permission used state callback. + * @param permissionName The permission to be listened. + * @param callback The permission used change callback to be registered. + * @permission ohos.permission.PERMISSION_USED_STATS. + * @systemapi hide this for inner system use + * @since 9 + */ + function removePermissionUsedStateListener(permissionName: string, callback: Callback<{tokenID: number, permissionName: string, status: PermissionUsedState}>): void; + /** * PermissionUsedState. * @systemapi hide this for inner system use -- Gitee From 582e0d47eb355bac71379dd8a83e90bd35417303 Mon Sep 17 00:00:00 2001 From: chennian Date: Mon, 20 Jun 2022 17:02:24 +0800 Subject: [PATCH 03/15] Signed-off-by:chennianchennian1@huawei.com Signed-off-by: chennian --- api/@ohos.privacyManager.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/@ohos.privacyManager.d.ts b/api/@ohos.privacyManager.d.ts index b19a759a30..da8cbe2d8d 100644 --- a/api/@ohos.privacyManager.d.ts +++ b/api/@ohos.privacyManager.d.ts @@ -52,7 +52,7 @@ import {AsyncCallback, Callback} from './basic' * @systemapi hide this for inner system use * @since 9 */ - function addPermissionUsedStateListener(permissionName: string, callback: Callback<{tokenID: number, permissionName: string, status: PermissionUsedState}>): void; + function startListenUsingState(tokenID: number, permissionName: string, callback: Callback<{tokenID: number, permissionName: string, status: PermissionUsedState}>): void; /** * Unregister a permission used state callback. @@ -62,7 +62,7 @@ import {AsyncCallback, Callback} from './basic' * @systemapi hide this for inner system use * @since 9 */ - function removePermissionUsedStateListener(permissionName: string, callback: Callback<{tokenID: number, permissionName: string, status: PermissionUsedState}>): void; + function stopListenUsingState(tokenID: number, permissionName: string, callback: Callback<{tokenID: number, permissionName: string, status: PermissionUsedState}>): void; /** * PermissionUsedState. -- Gitee From 5d99f398aa644c49fc05e62a561fc80f9b105775 Mon Sep 17 00:00:00 2001 From: chennian Date: Mon, 20 Jun 2022 17:05:18 +0800 Subject: [PATCH 04/15] Signed-off-by:chennianchennian1@huawei.com Signed-off-by: chennian --- api/@ohos.privacyManager.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/@ohos.privacyManager.d.ts b/api/@ohos.privacyManager.d.ts index da8cbe2d8d..594d705e4d 100644 --- a/api/@ohos.privacyManager.d.ts +++ b/api/@ohos.privacyManager.d.ts @@ -52,7 +52,7 @@ import {AsyncCallback, Callback} from './basic' * @systemapi hide this for inner system use * @since 9 */ - function startListenUsingState(tokenID: number, permissionName: string, callback: Callback<{tokenID: number, permissionName: string, status: PermissionUsedState}>): void; + function startListenUsingState(permissionName: string, callback: Callback<{tokenID: number, permissionName: string, status: PermissionUsedState}>): void; /** * Unregister a permission used state callback. @@ -62,7 +62,7 @@ import {AsyncCallback, Callback} from './basic' * @systemapi hide this for inner system use * @since 9 */ - function stopListenUsingState(tokenID: number, permissionName: string, callback: Callback<{tokenID: number, permissionName: string, status: PermissionUsedState}>): void; + function stopListenUsingState(permissionName: string, callback: Callback<{tokenID: number, permissionName: string, status: PermissionUsedState}>): void; /** * PermissionUsedState. -- Gitee From 461086fc5929f84ccf35a2d4e78c326207ff5e35 Mon Sep 17 00:00:00 2001 From: chennian Date: Tue, 21 Jun 2022 14:43:08 +0800 Subject: [PATCH 05/15] Signed-off-by:chennianchennian1@huawei.com Signed-off-by: chennian --- api/@ohos.privacyManager.d.ts | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/api/@ohos.privacyManager.d.ts b/api/@ohos.privacyManager.d.ts index 594d705e4d..b066f710b3 100644 --- a/api/@ohos.privacyManager.d.ts +++ b/api/@ohos.privacyManager.d.ts @@ -20,7 +20,7 @@ import {AsyncCallback, Callback} from './basic' */ declare namespace privacyManager { /** - * Add access record of sensitive permission. + * Adds access record of sensitive permission. * @param tokenID The tokenId of specified application. * @param permissionName The permission name to be added. * @param successCount Access count. @@ -45,24 +45,25 @@ import {AsyncCallback, Callback} from './basic' function getPermissionUsedRecords(request: PermissionUsedRequest, callback: AsyncCallback): void; /** - * Register a permission used state callback. - * @param permissionName The permission to be listened. + * Starts listening the change of permission used state. + * @param tokenIDLists The tokenId lists of specified applications to be listened. + * @param permissionNameLists The permission lists to be listened. * @param callback The permission used change callback to be registered. * @permission ohos.permission.PERMISSION_USED_STATS. * @systemapi hide this for inner system use * @since 9 */ - function startListenUsingState(permissionName: string, callback: Callback<{tokenID: number, permissionName: string, status: PermissionUsedState}>): void; + function startListenUsingState(tokenIDLists: Array, permissionNameLists: Array, callback: Callback<{tokenID: number, permissionName: string, status: PermissionUsedState}>): void; /** - * Unregister a permission used state callback. - * @param permissionName The permission to be listened. - * @param callback The permission used change callback to be registered. + * Stops listening the change of permission used state. + * @param tokenIDLists The tokenId lists of specified applications to be listened. + * @param permissionNameLists The permission lists to be listened. * @permission ohos.permission.PERMISSION_USED_STATS. * @systemapi hide this for inner system use * @since 9 */ - function stopListenUsingState(permissionName: string, callback: Callback<{tokenID: number, permissionName: string, status: PermissionUsedState}>): void; + function stopListenUsingState(tokenIDLists: Array, permissionNameLists: Array): void; /** * PermissionUsedState. -- Gitee From eaf8e45951a6f29979736cc25ddbe8caa9f9328a Mon Sep 17 00:00:00 2001 From: chennian Date: Tue, 21 Jun 2022 19:02:28 +0800 Subject: [PATCH 06/15] Signed-off-by:chennianchennian1@huawei.com Signed-off-by: chennian --- api/@ohos.privacyManager.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/@ohos.privacyManager.d.ts b/api/@ohos.privacyManager.d.ts index b066f710b3..d79acf8797 100644 --- a/api/@ohos.privacyManager.d.ts +++ b/api/@ohos.privacyManager.d.ts @@ -53,7 +53,7 @@ import {AsyncCallback, Callback} from './basic' * @systemapi hide this for inner system use * @since 9 */ - function startListenUsingState(tokenIDLists: Array, permissionNameLists: Array, callback: Callback<{tokenID: number, permissionName: string, status: PermissionUsedState}>): void; + function startListenUsingState(tokenIDList: Array, permissionNameList: Array, callback: Callback<{tokenID: number, permissionName: string, status: PermissionUsedState}>): void; /** * Stops listening the change of permission used state. @@ -63,7 +63,7 @@ import {AsyncCallback, Callback} from './basic' * @systemapi hide this for inner system use * @since 9 */ - function stopListenUsingState(tokenIDLists: Array, permissionNameLists: Array): void; + function stopListenUsingState(tokenIDList: Array, permissionNameList: Array): void; /** * PermissionUsedState. -- Gitee From 67f8c70a2c006a23488b8e035c734fabe8703cf0 Mon Sep 17 00:00:00 2001 From: chennian Date: Wed, 22 Jun 2022 10:33:10 +0800 Subject: [PATCH 07/15] Signed-off-by:chennianchennian1@huawei.com Signed-off-by: chennian --- api/@ohos.privacyManager.d.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/api/@ohos.privacyManager.d.ts b/api/@ohos.privacyManager.d.ts index d79acf8797..6f45964222 100644 --- a/api/@ohos.privacyManager.d.ts +++ b/api/@ohos.privacyManager.d.ts @@ -46,6 +46,7 @@ import {AsyncCallback, Callback} from './basic' /** * Starts listening the change of permission used state. + * @param type startListenUsingState. * @param tokenIDLists The tokenId lists of specified applications to be listened. * @param permissionNameLists The permission lists to be listened. * @param callback The permission used change callback to be registered. @@ -53,17 +54,18 @@ import {AsyncCallback, Callback} from './basic' * @systemapi hide this for inner system use * @since 9 */ - function startListenUsingState(tokenIDList: Array, permissionNameList: Array, callback: Callback<{tokenID: number, permissionName: string, status: PermissionUsedState}>): void; + function on(type: "startListenUsingState", tokenIDList: Array, permissionNameList: Array, callback: Callback<{tokenID: number, permissionName: string, status: PermissionUsedState}>): void; /** * Stops listening the change of permission used state. + * @param type stopListenUsingState. * @param tokenIDLists The tokenId lists of specified applications to be listened. * @param permissionNameLists The permission lists to be listened. * @permission ohos.permission.PERMISSION_USED_STATS. * @systemapi hide this for inner system use * @since 9 */ - function stopListenUsingState(tokenIDList: Array, permissionNameList: Array): void; + function off(type: "stopListenUsingState", tokenIDList: Array, permissionNameList: Array): void; /** * PermissionUsedState. -- Gitee From a2938e2b55ffac32f4136a8264352b362b453599 Mon Sep 17 00:00:00 2001 From: chennian Date: Wed, 22 Jun 2022 10:34:43 +0800 Subject: [PATCH 08/15] Signed-off-by:chennianchennian1@huawei.com Signed-off-by: chennian --- api/@ohos.privacyManager.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/@ohos.privacyManager.d.ts b/api/@ohos.privacyManager.d.ts index 6f45964222..b201613829 100644 --- a/api/@ohos.privacyManager.d.ts +++ b/api/@ohos.privacyManager.d.ts @@ -54,7 +54,7 @@ import {AsyncCallback, Callback} from './basic' * @systemapi hide this for inner system use * @since 9 */ - function on(type: "startListenUsingState", tokenIDList: Array, permissionNameList: Array, callback: Callback<{tokenID: number, permissionName: string, status: PermissionUsedState}>): void; + function on(type: 'startListenUsingState', tokenIDList: Array, permissionNameList: Array, callback: Callback<{tokenID: number, permissionName: string, status: PermissionUsedState}>): void; /** * Stops listening the change of permission used state. @@ -65,7 +65,7 @@ import {AsyncCallback, Callback} from './basic' * @systemapi hide this for inner system use * @since 9 */ - function off(type: "stopListenUsingState", tokenIDList: Array, permissionNameList: Array): void; + function off(type: 'stopListenUsingState', tokenIDList: Array, permissionNameList: Array): void; /** * PermissionUsedState. -- Gitee From c9161fb31490840d274f7ff08c78617d7ea26581 Mon Sep 17 00:00:00 2001 From: chennian Date: Mon, 27 Jun 2022 08:25:42 +0800 Subject: [PATCH 09/15] Signed-off-by:chennianchennian1@huawei.com Signed-off-by: chennian --- api/@ohos.privacyManager.d.ts | 32 ++++++-------------------------- 1 file changed, 6 insertions(+), 26 deletions(-) diff --git a/api/@ohos.privacyManager.d.ts b/api/@ohos.privacyManager.d.ts index b201613829..f544a9a254 100644 --- a/api/@ohos.privacyManager.d.ts +++ b/api/@ohos.privacyManager.d.ts @@ -45,8 +45,8 @@ import {AsyncCallback, Callback} from './basic' function getPermissionUsedRecords(request: PermissionUsedRequest, callback: AsyncCallback): void; /** - * Starts listening the change of permission used state. - * @param type startListenUsingState. + * Starts listening the change of permission active state. + * @param type activeStateChange. * @param tokenIDLists The tokenId lists of specified applications to be listened. * @param permissionNameLists The permission lists to be listened. * @param callback The permission used change callback to be registered. @@ -54,38 +54,18 @@ import {AsyncCallback, Callback} from './basic' * @systemapi hide this for inner system use * @since 9 */ - function on(type: 'startListenUsingState', tokenIDList: Array, permissionNameList: Array, callback: Callback<{tokenID: number, permissionName: string, status: PermissionUsedState}>): void; + function on(type: 'activeStateChange', tokenIDList: Array, permissionNameList: Array, callback: Callback<{tokenID: number, permissionName: string, isActive: boolean}>): void; /** - * Stops listening the change of permission used state. - * @param type stopListenUsingState. + * Stops listening the change of permission active state. + * @param type activeStateChange. * @param tokenIDLists The tokenId lists of specified applications to be listened. * @param permissionNameLists The permission lists to be listened. * @permission ohos.permission.PERMISSION_USED_STATS. * @systemapi hide this for inner system use * @since 9 */ - function off(type: 'stopListenUsingState', tokenIDList: Array, permissionNameList: Array): void; - - /** - * PermissionUsedState. - * @systemapi hide this for inner system use - * @since 9 - */ - enum PermissionUsedState { - /** - * active in foreground - */ - ACTIVE_FOREGROUND = 0, - /** - * active in background - */ - ACTIVE_BACKGROUND = 1, - /** - * inactive - */ - INACTIVE = 2, - } + function off(type: 'activeStateChange', tokenIDList: Array, permissionNameList: Array): void; /** * PermissionUsageFlag. -- Gitee From c284ff6814b7d897565807d1ae5f5e5ddd531a06 Mon Sep 17 00:00:00 2001 From: chennian Date: Thu, 30 Jun 2022 16:44:16 +0800 Subject: [PATCH 10/15] =?UTF-8?q?=E6=9B=B4=E6=96=B0API=20Signed-off-by:che?= =?UTF-8?q?nnian?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: chennian --- api/@ohos.privacyManager.d.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/api/@ohos.privacyManager.d.ts b/api/@ohos.privacyManager.d.ts index f544a9a254..6f8bfa5203 100644 --- a/api/@ohos.privacyManager.d.ts +++ b/api/@ohos.privacyManager.d.ts @@ -47,25 +47,23 @@ import {AsyncCallback, Callback} from './basic' /** * Starts listening the change of permission active state. * @param type activeStateChange. - * @param tokenIDLists The tokenId lists of specified applications to be listened. * @param permissionNameLists The permission lists to be listened. * @param callback The permission used change callback to be registered. * @permission ohos.permission.PERMISSION_USED_STATS. * @systemapi hide this for inner system use * @since 9 */ - function on(type: 'activeStateChange', tokenIDList: Array, permissionNameList: Array, callback: Callback<{tokenID: number, permissionName: string, isActive: boolean}>): void; + function on(type: 'activeStateChange', permissionNameList: Array, callback: Callback<{tokenID: number, permissionName: string, isActive: boolean}>): void; /** * Stops listening the change of permission active state. * @param type activeStateChange. - * @param tokenIDLists The tokenId lists of specified applications to be listened. * @param permissionNameLists The permission lists to be listened. * @permission ohos.permission.PERMISSION_USED_STATS. * @systemapi hide this for inner system use * @since 9 */ - function off(type: 'activeStateChange', tokenIDList: Array, permissionNameList: Array): void; + function off(type: 'activeStateChange', permissionNameList: Array): void; /** * PermissionUsageFlag. -- Gitee From ab27881a248996e4a85f38a7ea231d29c9b3485f Mon Sep 17 00:00:00 2001 From: chennian Date: Mon, 4 Jul 2022 16:38:54 +0800 Subject: [PATCH 11/15] =?UTF-8?q?=E9=9A=90=E7=A7=81=E6=96=B0=E5=A2=9EJS=20?= =?UTF-8?q?API=20Signed-off-by:chennian?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: chennian --- api/@ohos.privacyManager.d.ts | 38 +++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/api/@ohos.privacyManager.d.ts b/api/@ohos.privacyManager.d.ts index 6f8bfa5203..fdbae0471e 100644 --- a/api/@ohos.privacyManager.d.ts +++ b/api/@ohos.privacyManager.d.ts @@ -65,6 +65,44 @@ import {AsyncCallback, Callback} from './basic' */ function off(type: 'activeStateChange', permissionNameList: Array): void; + /** + * Sets the switch status for sensitive resource. + * @param sensor The sensitive resource. + * @param status The switch status. + * @permission ohos.permission.PERMISSION_USED_STATS. + * @systemapi hide this for inner system use + * @since 9 + */ + function setSensitiveResourceSwitch(sensor: SensitiveResource, status: boolean): Promise; + function setSensitiveResourceSwitch(sensor: SensitiveResource, status: boolean, callback: AsyncCallback): void; + + /** + * Gets the switch status for sensitive resource. + * @param sensor The sensitive resource. + * @return Return the switch status of specified resource. + * @permission ohos.permission.PERMISSION_USED_STATS. + * @systemapi hide this for inner system use + * @since 9 + */ + function getSensitiveResourceSwitch(sensor: SensitiveResource): Promise; + function getSensitiveResourceSwitch(sensor: SensitiveResource, callback: AsyncCallback): void; + + /** + * PermissionUsageFlag. + * @systemapi hide this for inner system use + * @since 9 + */ + enum SensitiveResource { + /** + * camera resource + */ + CAMERA = 0, + /** + * microphone resource + */ + MICROPHONE = 1, + } + /** * PermissionUsageFlag. * @systemapi hide this for inner system use -- Gitee From 090c097192109846e1741c555650274688d078ae Mon Sep 17 00:00:00 2001 From: chennian Date: Mon, 4 Jul 2022 16:41:57 +0800 Subject: [PATCH 12/15] =?UTF-8?q?=E9=9A=90=E7=A7=81=E6=96=B0=E5=A2=9EJS=20?= =?UTF-8?q?API=20Signed-off-by:chennian?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: chennian --- api/@ohos.privacyManager.d.ts | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/api/@ohos.privacyManager.d.ts b/api/@ohos.privacyManager.d.ts index fdbae0471e..41135e0528 100644 --- a/api/@ohos.privacyManager.d.ts +++ b/api/@ohos.privacyManager.d.ts @@ -44,27 +44,6 @@ import {AsyncCallback, Callback} from './basic' function getPermissionUsedRecords(request: PermissionUsedRequest): Promise; function getPermissionUsedRecords(request: PermissionUsedRequest, callback: AsyncCallback): void; - /** - * Starts listening the change of permission active state. - * @param type activeStateChange. - * @param permissionNameLists The permission lists to be listened. - * @param callback The permission used change callback to be registered. - * @permission ohos.permission.PERMISSION_USED_STATS. - * @systemapi hide this for inner system use - * @since 9 - */ - function on(type: 'activeStateChange', permissionNameList: Array, callback: Callback<{tokenID: number, permissionName: string, isActive: boolean}>): void; - - /** - * Stops listening the change of permission active state. - * @param type activeStateChange. - * @param permissionNameLists The permission lists to be listened. - * @permission ohos.permission.PERMISSION_USED_STATS. - * @systemapi hide this for inner system use - * @since 9 - */ - function off(type: 'activeStateChange', permissionNameList: Array): void; - /** * Sets the switch status for sensitive resource. * @param sensor The sensitive resource. -- Gitee From ce069237e081279ff3a8f28da4eb6100db72121a Mon Sep 17 00:00:00 2001 From: chennian Date: Mon, 4 Jul 2022 16:42:39 +0800 Subject: [PATCH 13/15] =?UTF-8?q?=E9=9A=90=E7=A7=81=E6=96=B0=E5=A2=9EJS=20?= =?UTF-8?q?API=20Signed-off-by:chennian?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: chennian --- api/@ohos.privacyManager.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/@ohos.privacyManager.d.ts b/api/@ohos.privacyManager.d.ts index 41135e0528..19b3e6244b 100644 --- a/api/@ohos.privacyManager.d.ts +++ b/api/@ohos.privacyManager.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import {AsyncCallback, Callback} from './basic' +import {AsyncCallback} from './basic' /** * @syscap SystemCapability.Security.AccessToken -- Gitee From a591b97721c2e6e547c25d8300fc42c904ae01fc Mon Sep 17 00:00:00 2001 From: chennian Date: Wed, 6 Jul 2022 10:27:03 +0800 Subject: [PATCH 14/15] =?UTF-8?q?=E9=9A=90=E7=A7=81=E6=96=B0=E5=A2=9EJS=20?= =?UTF-8?q?API=20Signed-off-by:chennian?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: chennian --- api/@ohos.privacyManager.d.ts | 53 ++++++++++++++++++++++++++++++++++- 1 file changed, 52 insertions(+), 1 deletion(-) diff --git a/api/@ohos.privacyManager.d.ts b/api/@ohos.privacyManager.d.ts index 19b3e6244b..3d1f52b575 100644 --- a/api/@ohos.privacyManager.d.ts +++ b/api/@ohos.privacyManager.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import {AsyncCallback} from './basic' +import {AsyncCallback, Callback} from './basic' /** * @syscap SystemCapability.Security.AccessToken @@ -44,6 +44,24 @@ import {AsyncCallback} from './basic' function getPermissionUsedRecords(request: PermissionUsedRequest): Promise; function getPermissionUsedRecords(request: PermissionUsedRequest, callback: AsyncCallback): void; + /** + * Subscribes to the change of active state of the specified permission. + * @param permissionNameLists Indicated the permission lists, which are specified. + * @permission ohos.permission.PERMISSION_USED_STATS. + * @systemapi hide this for inner system use + * @since 9 + */ + function on(type: 'activeStateChange', permissionNameList: Array, callback: Callback): void; + + /** + * Unsubscribes from . + * @param permissionNameLists Indicated the permission lists, which are specified. + * @permission ohos.permission.PERMISSION_USED_STATS. + * @systemapi hide this for inner system use + * @since 9 + */ + function off(type: 'activeStateChange', permissionNameList: Array, callback?: Callback): void; + /** * Sets the switch status for sensitive resource. * @param sensor The sensitive resource. @@ -82,6 +100,22 @@ import {AsyncCallback} from './basic' MICROPHONE = 1, } + /** + * ActiveStatus. + * @systemapi hide this for inner system use + * @since 9 + */ + enum ActiveStatus { + /** + * camera resource + */ + INACTIVE = 0, + /** + * microphone resource + */ + ACTIVE = 1, + } + /** * PermissionUsageFlag. * @systemapi hide this for inner system use @@ -267,6 +301,23 @@ import {AsyncCallback} from './basic' */ accessDuration: number; } + + interface ActiveChangeResponse { + /** + * AccessTokenID + */ + tokenId: number; + + /** + * The permission name + */ + permissionName: string; + + /** + * The active status name + */ + activeState: ActiveStatus + } } export default privacyManager; \ No newline at end of file -- Gitee From 563e7057d4d6bae6fe3af756d39f5033a9a00759 Mon Sep 17 00:00:00 2001 From: chennian Date: Thu, 7 Jul 2022 08:41:42 +0800 Subject: [PATCH 15/15] =?UTF-8?q?=E9=9A=90=E7=A7=81=E6=96=B0=E5=A2=9EJS=20?= =?UTF-8?q?API=20Signed-off-by:chennian?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: chennian --- api/@ohos.privacyManager.d.ts | 56 +---------------------------------- 1 file changed, 1 insertion(+), 55 deletions(-) diff --git a/api/@ohos.privacyManager.d.ts b/api/@ohos.privacyManager.d.ts index 3d1f52b575..1363d84cba 100644 --- a/api/@ohos.privacyManager.d.ts +++ b/api/@ohos.privacyManager.d.ts @@ -62,60 +62,6 @@ import {AsyncCallback, Callback} from './basic' */ function off(type: 'activeStateChange', permissionNameList: Array, callback?: Callback): void; - /** - * Sets the switch status for sensitive resource. - * @param sensor The sensitive resource. - * @param status The switch status. - * @permission ohos.permission.PERMISSION_USED_STATS. - * @systemapi hide this for inner system use - * @since 9 - */ - function setSensitiveResourceSwitch(sensor: SensitiveResource, status: boolean): Promise; - function setSensitiveResourceSwitch(sensor: SensitiveResource, status: boolean, callback: AsyncCallback): void; - - /** - * Gets the switch status for sensitive resource. - * @param sensor The sensitive resource. - * @return Return the switch status of specified resource. - * @permission ohos.permission.PERMISSION_USED_STATS. - * @systemapi hide this for inner system use - * @since 9 - */ - function getSensitiveResourceSwitch(sensor: SensitiveResource): Promise; - function getSensitiveResourceSwitch(sensor: SensitiveResource, callback: AsyncCallback): void; - - /** - * PermissionUsageFlag. - * @systemapi hide this for inner system use - * @since 9 - */ - enum SensitiveResource { - /** - * camera resource - */ - CAMERA = 0, - /** - * microphone resource - */ - MICROPHONE = 1, - } - - /** - * ActiveStatus. - * @systemapi hide this for inner system use - * @since 9 - */ - enum ActiveStatus { - /** - * camera resource - */ - INACTIVE = 0, - /** - * microphone resource - */ - ACTIVE = 1, - } - /** * PermissionUsageFlag. * @systemapi hide this for inner system use @@ -316,7 +262,7 @@ import {AsyncCallback, Callback} from './basic' /** * The active status name */ - activeState: ActiveStatus + isActive: boolean; } } -- Gitee