diff --git a/api/@ohos.privacyManager.d.ts b/api/@ohos.privacyManager.d.ts index d5d0c94d986f22afc65153699c2b9dc0aa97adb9..1363d84cbaca31ed249ec2ce06d4e3ed32a63bf6 100644 --- a/api/@ohos.privacyManager.d.ts +++ b/api/@ohos.privacyManager.d.ts @@ -13,14 +13,14 @@ * limitations under the License. */ -import {AsyncCallback} from './basic' +import {AsyncCallback, Callback} from './basic' /** * @syscap SystemCapability.Security.AccessToken */ 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. @@ -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,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; + /** * PermissionUsageFlag. * @systemapi hide this for inner system use @@ -229,6 +247,23 @@ import {AsyncCallback} from './basic' */ accessDuration: number; } + + interface ActiveChangeResponse { + /** + * AccessTokenID + */ + tokenId: number; + + /** + * The permission name + */ + permissionName: string; + + /** + * The active status name + */ + isActive: boolean; + } } export default privacyManager; \ No newline at end of file