From 3c30cfdaa52f5016c40ef3c3523fc5f383c244b3 Mon Sep 17 00:00:00 2001 From: chennian Date: Tue, 10 May 2022 19:39:13 +0800 Subject: [PATCH 1/2] Signed-off-by:chennian Signed-off-by: chennian --- api/@ohos.abilityAccessCtrl.d.ts | 154 ++++++++++++++++++++++++++++++- 1 file changed, 152 insertions(+), 2 deletions(-) diff --git a/api/@ohos.abilityAccessCtrl.d.ts b/api/@ohos.abilityAccessCtrl.d.ts index a7e2c44790..8356df406e 100644 --- a/api/@ohos.abilityAccessCtrl.d.ts +++ b/api/@ohos.abilityAccessCtrl.d.ts @@ -74,6 +74,17 @@ import { AsyncCallback } from "./basic"; * @since 8 */ getPermissionFlags(tokenID: number, permissionName: string): Promise; + + /** + * Queries the access records of sensitive permission. + * @param request The request of permission used records. + * @return Return the reponse of permission used records. + * @permission ohos.permission.PERMISSION_USED_STATS. + * @systemapi hid this for inner system use + * @since 9 + */ + getPermissionUsedRecords(request: PermissionUsedRequest): Promise; + getPermissionUsedRecords(request: PermissionUsedRequest, callback: AsyncCallback): void; } /** @@ -90,6 +101,145 @@ import { AsyncCallback } from "./basic"; */ PERMISSION_GRANTED = 0, } - } - export default abilityAccessCtrl; + /** + * PermissionUsageFlag. + * @since 9 + */ + enum PermissionUsageFlag { + /** + * permission used summary + */ + FLAG_PERMISSION_USAGE_SUMMARY = 0, + /** + * permission used detail + */ + FLAG_PERMISSION_USAGE_DETAIL = 1, + } + + /** + * Provides request of querying permission used records. + * @since 9 + */ + interface PermissionUsedRequest { + /** + * The device id + */ + deviceId: string; + + /** + * The list of permision name + */ + permissionName: Array; + + /** + * The begin time + */ + beginTimeMillis: number; + + /** + * The end time + */ + endTimeMillis: number; + + /** + * The permission usage flag + */ + flag: PermissionUsageFlag; + } + + /** + * Provides response of querying permission used records. + * @since 9 + */ + interface PermissionUsedResponse { + /** + * The begin time + */ + beginTimeMillis: number; + + /** + * The end time + */ + endTimeMillis: number; + + /** + * The list of permision used records + */ + permissionRecords: Array; + } + + /** + * PermissionUsedRecord. + * @since 9 + */ + interface PermissionUsedRecord { + /** + * The permission name + */ + permissionName: string; + + /** + * The list of bundle used records + */ + bundleRecords: Array; + } + + /** + * BundleUsedRecord. + * @since 9 + */ + interface BundleUsedRecord { + /** + * The device id + */ + deviceId: string; + + /** + * The bundle name + */ + bundleName: string; + + /** + * The access counts in the foreground + */ + accessCountFg: number; + + /** + * The reject counts in the foreground + */ + rejectCountFg: number; + + /** + * The access counts in the background + */ + accessCountBg: number; + + /** + * The reject counts in the background + */ + rejectCountBg: number; + + /** + * The list of access records in the foreground + */ + accessRecordFg: Array; + + /** + * The list of access records in the foreground + */ + rejectRecordFg: Array; + + /** + * The list of access records in the background + */ + accessRecordBg: Array; + + /** + * The list of access records in the background + */ + rejectRecordBg: Array; + } +} + +export default abilityAccessCtrl; -- Gitee From ae0364d27530ed0dacebc1e5d1d955885bdac59b Mon Sep 17 00:00:00 2001 From: chennian Date: Thu, 12 May 2022 12:34:51 +0800 Subject: [PATCH 2/2] Signed-off-by:chennian Signed-off-by: chennian --- api/@ohos.abilityAccessCtrl.d.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/api/@ohos.abilityAccessCtrl.d.ts b/api/@ohos.abilityAccessCtrl.d.ts index 8356df406e..015e4f2f53 100644 --- a/api/@ohos.abilityAccessCtrl.d.ts +++ b/api/@ohos.abilityAccessCtrl.d.ts @@ -127,10 +127,15 @@ import { AsyncCallback } from "./basic"; */ deviceId: string; + /** + * The bundle name + */ + bundleName: string; + /** * The list of permision name */ - permissionName: Array; + permNames: Array; /** * The begin time -- Gitee