From c2e730dfcaf0ff263427ffebdedbe1842b93bc0f Mon Sep 17 00:00:00 2001 From: chennian Date: Thu, 12 May 2022 13:21:49 +0800 Subject: [PATCH 01/19] Signed-off-by:chennian Signed-off-by: chennian --- api/@ohos.abilityAccessCtrl.d.ts | 159 ++++++++++++++++++++++++++++++- 1 file changed, 157 insertions(+), 2 deletions(-) diff --git a/api/@ohos.abilityAccessCtrl.d.ts b/api/@ohos.abilityAccessCtrl.d.ts index a7e2c44790..e77942461e 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,150 @@ 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 bundle name + */ + bundleName: string; + + /** + * The list of permision name + */ + permissionList: 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 d15e2ee8b4a5c2cd2ff2132e80481e2d3f648641 Mon Sep 17 00:00:00 2001 From: chennian Date: Thu, 12 May 2022 13:57:39 +0800 Subject: [PATCH 02/19] Signed-off-by:chennian Signed-off-by: chennian --- api/@ohos.abilityAccessCtrl.d.ts | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/api/@ohos.abilityAccessCtrl.d.ts b/api/@ohos.abilityAccessCtrl.d.ts index e77942461e..5dcd1a8b27 100644 --- a/api/@ohos.abilityAccessCtrl.d.ts +++ b/api/@ohos.abilityAccessCtrl.d.ts @@ -135,7 +135,7 @@ import { AsyncCallback } from "./basic"; /** * The list of permision name */ - permissionList: Array; + permNames: Array; /** * The begin time @@ -225,23 +225,33 @@ import { AsyncCallback } from "./basic"; */ rejectCountBg: number; + /** + * The last access time + */ + lastAccessTime: number; + + /** + * The last access time + */ + lastRejectTime: number; + /** * The list of access records in the foreground */ accessRecordFg: Array; /** - * The list of access records in the foreground + * The list of reject records in the foreground */ - rejectRecordFg: Array; + rejectRecordFg: Array; /** - * The list of access records in the background + * The list of access records in the background */ accessRecordBg: Array; /** - * The list of access records in the background + * The list of reject records in the background */ rejectRecordBg: Array; } -- Gitee From bb97a9b4000d5032a76b27e93ecddcf71c274d64 Mon Sep 17 00:00:00 2001 From: chennian Date: Thu, 12 May 2022 13:59:56 +0800 Subject: [PATCH 03/19] Signed-off-by:chennian Signed-off-by: chennian --- api/@ohos.abilityAccessCtrl.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/@ohos.abilityAccessCtrl.d.ts b/api/@ohos.abilityAccessCtrl.d.ts index 5dcd1a8b27..2dc1722a38 100644 --- a/api/@ohos.abilityAccessCtrl.d.ts +++ b/api/@ohos.abilityAccessCtrl.d.ts @@ -231,7 +231,7 @@ import { AsyncCallback } from "./basic"; lastAccessTime: number; /** - * The last access time + * The last reject time */ lastRejectTime: number; -- Gitee From 6db5930427dc32a4d511e83a12c756f925c62d6a Mon Sep 17 00:00:00 2001 From: chennian Date: Mon, 23 May 2022 10:19:07 +0800 Subject: [PATCH 04/19] Signed-off-by:chennian Signed-off-by: chennian --- api/@ohos.abilityAccessCtrl.d.ts | 57 ++++++++++++++++++++------------ 1 file changed, 36 insertions(+), 21 deletions(-) diff --git a/api/@ohos.abilityAccessCtrl.d.ts b/api/@ohos.abilityAccessCtrl.d.ts index 2dc1722a38..113ea7dab5 100644 --- a/api/@ohos.abilityAccessCtrl.d.ts +++ b/api/@ohos.abilityAccessCtrl.d.ts @@ -171,23 +171,7 @@ import { AsyncCallback } from "./basic"; /** * 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; + bundleRecords: Array; } /** @@ -205,6 +189,22 @@ import { AsyncCallback } from "./basic"; */ bundleName: string; + /** + * The list of bundle used records + */ + permissionRecords: Array; + } + + /** + * PermissionUsedRecord. + * @since 9 + */ + interface PermissionUsedRecord { + /** + * The permission name + */ + permissionName: string; + /** * The access counts in the foreground */ @@ -236,24 +236,39 @@ import { AsyncCallback } from "./basic"; lastRejectTime: number; /** - * The list of access records in the foreground + * The last access duration + */ + lastAccessDurationTime: number; + + /** + * The list of access timestamp records in the foreground */ accessRecordFg: Array; /** - * The list of reject records in the foreground + * The list of reject timestamp records in the foreground */ rejectRecordFg: Array; /** - * The list of access records in the background + * The list of access timestamp records in the background */ accessRecordBg: Array; /** - * The list of reject records in the background + * The list of reject timestamp records in the background */ rejectRecordBg: Array; + + /** + * The list of access duration records in the foreground + */ + accessDurationFg: Array; + + /** + * The list of access duration records in the background + */ + accessDurationBg: Array; } } -- Gitee From 1598b0caa50e5ea4871db44c3777386f00a1f61b Mon Sep 17 00:00:00 2001 From: chennian Date: Mon, 23 May 2022 10:22:58 +0800 Subject: [PATCH 05/19] Signed-off-by:chennian Signed-off-by: chennian --- api/@ohos.abilityAccessCtrl.d.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/api/@ohos.abilityAccessCtrl.d.ts b/api/@ohos.abilityAccessCtrl.d.ts index 113ea7dab5..cb28d20954 100644 --- a/api/@ohos.abilityAccessCtrl.d.ts +++ b/api/@ohos.abilityAccessCtrl.d.ts @@ -169,9 +169,9 @@ import { AsyncCallback } from "./basic"; endTimeMillis: number; /** - * The list of permision used records + * The list of permision used records of bundle */ - bundleRecords: Array; + bundleRecords: Array; } /** @@ -190,7 +190,7 @@ import { AsyncCallback } from "./basic"; bundleName: string; /** - * The list of bundle used records + * The list of permission used records */ permissionRecords: Array; } -- Gitee From cf0505e6668152fc886efdf5a94f1c6a06ff994b Mon Sep 17 00:00:00 2001 From: chennian Date: Tue, 24 May 2022 16:32:28 +0800 Subject: [PATCH 06/19] Signed-off-by:chennian Signed-off-by: chennian --- api/@ohos.abilityAccessCtrl.d.ts | 38 ++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/api/@ohos.abilityAccessCtrl.d.ts b/api/@ohos.abilityAccessCtrl.d.ts index cb28d20954..e46937511a 100644 --- a/api/@ohos.abilityAccessCtrl.d.ts +++ b/api/@ohos.abilityAccessCtrl.d.ts @@ -75,6 +75,44 @@ import { AsyncCallback } from "./basic"; */ getPermissionFlags(tokenID: number, permissionName: string): Promise; + /** + * Add access record of sensitive permission. + * @param tokenID The tokenId of specified application. + * @param permissionName The permission name to be added. + * @param successCount Access count. + * @param failCount Reject account. + * @return NA. + * @permission ohos.permission.PERMISSION_USED_STATS. + * @systemapi hid this for inner system use + * @since 9 + */ + addPermissionUsedRecord(tokenID: number, permissionName: string, successCount: number, failCount: number): Promise; + addPermissionUsedRecord(tokenID: number, permissionName: string, successCount: number, failCount: number, callback: AsyncCallback): void; + + /** + * Start using sensitive permission. + * @param tokenID The tokenId of specified application. + * @param permissionName The permission name to be started. + * @return NA. + * @permission ohos.permission.PERMISSION_USED_STATS. + * @systemapi hid this for inner system use + * @since 9 + */ + startUsingPermission(tokenID: number, permissionName: string): Promise; + startUsingPermission(tokenID: number, permissionName: string, callback: AsyncCallback): void; + + /** + * Stop using sensitive permission. + * @param tokenID The tokenId of specified application. + * @param permissionName The permission name to be stopped. + * @return NA. + * @permission ohos.permission.PERMISSION_USED_STATS. + * @systemapi hid this for inner system use + * @since 9 + */ + stopUsingPermission(tokenID: number, permissionName: string): Promise; + stopUsingPermission(tokenID: number, permissionName: string, callback: AsyncCallback): void; + /** * Queries the access records of sensitive permission. * @param request The request of permission used records. -- Gitee From fcb604704a9c2f407cb99ce0dbfe8eac95d9ba30 Mon Sep 17 00:00:00 2001 From: chennian Date: Tue, 24 May 2022 17:22:21 +0800 Subject: [PATCH 07/19] Signed-off-by:chennian Signed-off-by: chennian --- api/@ohos.abilityAccessCtrl.d.ts | 48 ++++++++++---------------------- 1 file changed, 14 insertions(+), 34 deletions(-) diff --git a/api/@ohos.abilityAccessCtrl.d.ts b/api/@ohos.abilityAccessCtrl.d.ts index e46937511a..1d16a98873 100644 --- a/api/@ohos.abilityAccessCtrl.d.ts +++ b/api/@ohos.abilityAccessCtrl.d.ts @@ -237,7 +237,7 @@ import { AsyncCallback } from "./basic"; * PermissionUsedRecord. * @since 9 */ - interface PermissionUsedRecord { + interface PermissionUsedRecord { /** * The permission name */ @@ -246,22 +246,12 @@ import { AsyncCallback } from "./basic"; /** * The access counts in the foreground */ - accessCountFg: number; + accessCount: 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; + rejectCount: number; /** * The last access time @@ -281,32 +271,22 @@ import { AsyncCallback } from "./basic"; /** * The list of access timestamp records in the foreground */ - accessRecordFg: Array; + accessRecord: Array; /** * The list of reject timestamp records in the foreground */ - rejectRecordFg: Array; - - /** - * The list of access timestamp records in the background - */ - accessRecordBg: Array; - - /** - * The list of reject timestamp records in the background - */ - rejectRecordBg: Array; - - /** - * The list of access duration records in the foreground - */ - accessDurationFg: Array; + rejectRecord: Array; + } - /** - * The list of access duration records in the background - */ - accessDurationBg: Array; + /** + * PermissionUsedRecord. + * @since 9 + */ + interface UsedRecordDetail { + isForeground: boolean; + isLockScreen: boolean; + accessDuration: number; } } -- Gitee From cea06d8884a7ad438d3ced1676d6e51052631e17 Mon Sep 17 00:00:00 2001 From: chennian Date: Tue, 24 May 2022 17:38:57 +0800 Subject: [PATCH 08/19] Signed-off-by:chennian Signed-off-by: chennian --- api/@ohos.abilityAccessCtrl.d.ts | 32 ++++++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/api/@ohos.abilityAccessCtrl.d.ts b/api/@ohos.abilityAccessCtrl.d.ts index 1d16a98873..a7efbde687 100644 --- a/api/@ohos.abilityAccessCtrl.d.ts +++ b/api/@ohos.abilityAccessCtrl.d.ts @@ -244,12 +244,12 @@ import { AsyncCallback } from "./basic"; permissionName: string; /** - * The access counts in the foreground + * The access counts */ accessCount: number; /** - * The reject counts in the foreground + * The reject counts */ rejectCount: number; @@ -266,26 +266,42 @@ import { AsyncCallback } from "./basic"; /** * The last access duration */ - lastAccessDurationTime: number; + lastAccessDuration: number; /** - * The list of access timestamp records in the foreground + * The list of access timestamp records */ - accessRecord: Array; + accessRecords: Array; /** - * The list of reject timestamp records in the foreground + * The list of reject timestamp records */ - rejectRecord: Array; + rejectRecords: Array; } /** - * PermissionUsedRecord. + * UsedRecordDetail. * @since 9 */ interface UsedRecordDetail { + /** + * The status of foreground/background + */ isForeground: boolean; + + /** + * The status of lockscreen + */ isLockScreen: boolean; + + /** + * Access timestamp + */ + accessTimestamp: number; + + /** + * Access duration + */ accessDuration: number; } } -- Gitee From 38ca5e3e19ffe72852edcd0e65e9ba107b4490e6 Mon Sep 17 00:00:00 2001 From: chennian Date: Tue, 24 May 2022 18:07:57 +0800 Subject: [PATCH 09/19] Signed-off-by:chennian Signed-off-by: chennian --- api/@ohos.abilityAccessCtrl.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/@ohos.abilityAccessCtrl.d.ts b/api/@ohos.abilityAccessCtrl.d.ts index a7efbde687..949a8a3e25 100644 --- a/api/@ohos.abilityAccessCtrl.d.ts +++ b/api/@ohos.abilityAccessCtrl.d.ts @@ -295,9 +295,9 @@ import { AsyncCallback } from "./basic"; isLockScreen: boolean; /** - * Access timestamp + * Access/reject timestamp */ - accessTimestamp: number; + timestamp: number; /** * Access duration -- Gitee From 7face416c3c177a46600bda8b0f0cfa0122bf875 Mon Sep 17 00:00:00 2001 From: chennian Date: Tue, 24 May 2022 19:06:42 +0800 Subject: [PATCH 10/19] Signed-off-by:chennian Signed-off-by: chennian --- api/@ohos.abilityAccessCtrl.d.ts | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/api/@ohos.abilityAccessCtrl.d.ts b/api/@ohos.abilityAccessCtrl.d.ts index 949a8a3e25..bdfb297304 100644 --- a/api/@ohos.abilityAccessCtrl.d.ts +++ b/api/@ohos.abilityAccessCtrl.d.ts @@ -285,14 +285,9 @@ import { AsyncCallback } from "./basic"; */ interface UsedRecordDetail { /** - * The status of foreground/background + * The status */ - isForeground: boolean; - - /** - * The status of lockscreen - */ - isLockScreen: boolean; + status: number; /** * Access/reject timestamp -- Gitee From a0808082e962fdb8e8a90e9ab887000b16ff1647 Mon Sep 17 00:00:00 2001 From: chennian Date: Tue, 24 May 2022 20:07:58 +0800 Subject: [PATCH 11/19] Signed-off-by:chennian Signed-off-by: chennian --- api/@ohos.abilityAccessCtrl.d.ts | 209 ---------------------------- api/@ohos.privacyManager.d.ts | 232 +++++++++++++++++++++++++++++++ 2 files changed, 232 insertions(+), 209 deletions(-) create mode 100644 api/@ohos.privacyManager.d.ts diff --git a/api/@ohos.abilityAccessCtrl.d.ts b/api/@ohos.abilityAccessCtrl.d.ts index bdfb297304..a6e824da3a 100644 --- a/api/@ohos.abilityAccessCtrl.d.ts +++ b/api/@ohos.abilityAccessCtrl.d.ts @@ -74,55 +74,6 @@ import { AsyncCallback } from "./basic"; * @since 8 */ getPermissionFlags(tokenID: number, permissionName: string): Promise; - - /** - * Add access record of sensitive permission. - * @param tokenID The tokenId of specified application. - * @param permissionName The permission name to be added. - * @param successCount Access count. - * @param failCount Reject account. - * @return NA. - * @permission ohos.permission.PERMISSION_USED_STATS. - * @systemapi hid this for inner system use - * @since 9 - */ - addPermissionUsedRecord(tokenID: number, permissionName: string, successCount: number, failCount: number): Promise; - addPermissionUsedRecord(tokenID: number, permissionName: string, successCount: number, failCount: number, callback: AsyncCallback): void; - - /** - * Start using sensitive permission. - * @param tokenID The tokenId of specified application. - * @param permissionName The permission name to be started. - * @return NA. - * @permission ohos.permission.PERMISSION_USED_STATS. - * @systemapi hid this for inner system use - * @since 9 - */ - startUsingPermission(tokenID: number, permissionName: string): Promise; - startUsingPermission(tokenID: number, permissionName: string, callback: AsyncCallback): void; - - /** - * Stop using sensitive permission. - * @param tokenID The tokenId of specified application. - * @param permissionName The permission name to be stopped. - * @return NA. - * @permission ohos.permission.PERMISSION_USED_STATS. - * @systemapi hid this for inner system use - * @since 9 - */ - stopUsingPermission(tokenID: number, permissionName: string): Promise; - stopUsingPermission(tokenID: number, permissionName: string, callback: AsyncCallback): void; - - /** - * 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; } /** @@ -139,166 +90,6 @@ import { AsyncCallback } from "./basic"; */ PERMISSION_GRANTED = 0, } - - /** - * 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 bundle name - */ - bundleName: string; - - /** - * The list of permision name - */ - permNames: 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 of bundle - */ - bundleRecords: Array; - } - - /** - * BundleUsedRecord. - * @since 9 - */ - interface BundleUsedRecord { - /** - * The device id - */ - deviceId: string; - - /** - * The bundle name - */ - bundleName: string; - - /** - * The list of permission used records - */ - permissionRecords: Array; - } - - /** - * PermissionUsedRecord. - * @since 9 - */ - interface PermissionUsedRecord { - /** - * The permission name - */ - permissionName: string; - - /** - * The access counts - */ - accessCount: number; - - /** - * The reject counts - */ - rejectCount: number; - - /** - * The last access time - */ - lastAccessTime: number; - - /** - * The last reject time - */ - lastRejectTime: number; - - /** - * The last access duration - */ - lastAccessDuration: number; - - /** - * The list of access timestamp records - */ - accessRecords: Array; - - /** - * The list of reject timestamp records - */ - rejectRecords: Array; - } - - /** - * UsedRecordDetail. - * @since 9 - */ - interface UsedRecordDetail { - /** - * The status - */ - status: number; - - /** - * Access/reject timestamp - */ - timestamp: number; - - /** - * Access duration - */ - accessDuration: number; - } } export default abilityAccessCtrl; diff --git a/api/@ohos.privacyManager.d.ts b/api/@ohos.privacyManager.d.ts new file mode 100644 index 0000000000..68bb9c8124 --- /dev/null +++ b/api/@ohos.privacyManager.d.ts @@ -0,0 +1,232 @@ +/* + * Copyright (c) 2021-2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import {AsyncCallback} from './basic' + +/** + * @syscap SystemCapability.Security.AccessToken + */ + declare namespace privacyManager { + /** + * Add access record of sensitive permission. + * @param tokenID The tokenId of specified application. + * @param permissionName The permission name to be added. + * @param successCount Access count. + * @param failCount Reject account. + * @return NA. + * @permission ohos.permission.PERMISSION_USED_STATS. + * @systemapi hid this for inner system use + * @since 9 + */ + function addPermissionUsedRecord(tokenID: number, permissionName: string, successCount: number, failCount: number): Promise; + function addPermissionUsedRecord(tokenID: number, permissionName: string, successCount: number, failCount: number, callback: AsyncCallback): void; + + /** + * Start using sensitive permission. + * @param tokenID The tokenId of specified application. + * @param permissionName The permission name to be started. + * @return NA. + * @permission ohos.permission.PERMISSION_USED_STATS. + * @systemapi hid this for inner system use + * @since 9 + */ + function startUsingPermission(tokenID: number, permissionName: string): Promise; + function startUsingPermission(tokenID: number, permissionName: string, callback: AsyncCallback): void; + + /** + * Stop using sensitive permission. + * @param tokenID The tokenId of specified application. + * @param permissionName The permission name to be stopped. + * @return NA. + * @permission ohos.permission.PERMISSION_USED_STATS. + * @systemapi hid this for inner system use + * @since 9 + */ + function stopUsingPermission(tokenID: number, permissionName: string): Promise; + function stopUsingPermission(tokenID: number, permissionName: string, callback: AsyncCallback): void; + + /** + * 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 + */ + function getPermissionUsedRecords(request: PermissionUsedRequest): Promise; + function getPermissionUsedRecords(request: PermissionUsedRequest, callback: AsyncCallback): void; + + /** + * 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 bundle name + */ + bundleName: string; + + /** + * The list of permision name + */ + permNames: 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 of bundle + */ + bundleRecords: Array; + } + + /** + * BundleUsedRecord. + * @since 9 + */ + interface BundleUsedRecord { + /** + * The device id + */ + deviceId: string; + + /** + * The bundle name + */ + bundleName: string; + + /** + * The list of permission used records + */ + permissionRecords: Array; + } + + /** + * PermissionUsedRecord. + * @since 9 + */ + interface PermissionUsedRecord { + /** + * The permission name + */ + permissionName: string; + + /** + * The access counts + */ + accessCount: number; + + /** + * The reject counts + */ + rejectCount: number; + + /** + * The last access time + */ + lastAccessTime: number; + + /** + * The last reject time + */ + lastRejectTime: number; + + /** + * The last access duration + */ + lastAccessDuration: number; + + /** + * The list of access timestamp records + */ + accessRecords: Array; + + /** + * The list of reject timestamp records + */ + rejectRecords: Array; + } + + /** + * UsedRecordDetail. + * @since 9 + */ + interface UsedRecordDetail { + /** + * The status + */ + status: number; + + /** + * Access/reject timestamp + */ + timestamp: number; + + /** + * Access duration + */ + accessDuration: number; + } +} + +export default privacyManager; \ No newline at end of file -- Gitee From 2aa339d2f7363216d327017e5c8107b3a0e44a8e Mon Sep 17 00:00:00 2001 From: chennian Date: Tue, 24 May 2022 20:09:57 +0800 Subject: [PATCH 12/19] Signed-off-by:chennian Signed-off-by: chennian --- api/@ohos.abilityAccessCtrl.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/@ohos.abilityAccessCtrl.d.ts b/api/@ohos.abilityAccessCtrl.d.ts index a6e824da3a..a7e2c44790 100644 --- a/api/@ohos.abilityAccessCtrl.d.ts +++ b/api/@ohos.abilityAccessCtrl.d.ts @@ -90,6 +90,6 @@ import { AsyncCallback } from "./basic"; */ PERMISSION_GRANTED = 0, } -} + } -export default abilityAccessCtrl; + export default abilityAccessCtrl; -- Gitee From ab749181793f2a1d9e08d4e6b39fe420f55bbc37 Mon Sep 17 00:00:00 2001 From: chennian Date: Wed, 25 May 2022 08:56:53 +0800 Subject: [PATCH 13/19] Signed-off-by:chennian Signed-off-by: chennian --- api/@ohos.privacyManager.d.ts | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/api/@ohos.privacyManager.d.ts b/api/@ohos.privacyManager.d.ts index 68bb9c8124..a877a3e8dd 100644 --- a/api/@ohos.privacyManager.d.ts +++ b/api/@ohos.privacyManager.d.ts @@ -31,7 +31,6 @@ import {AsyncCallback} from './basic' * @since 9 */ function addPermissionUsedRecord(tokenID: number, permissionName: string, successCount: number, failCount: number): Promise; - function addPermissionUsedRecord(tokenID: number, permissionName: string, successCount: number, failCount: number, callback: AsyncCallback): void; /** * Start using sensitive permission. @@ -42,8 +41,7 @@ import {AsyncCallback} from './basic' * @systemapi hid this for inner system use * @since 9 */ - function startUsingPermission(tokenID: number, permissionName: string): Promise; - function startUsingPermission(tokenID: number, permissionName: string, callback: AsyncCallback): void; + function startUsingPermission(tokenID: number, permissionName: string): Promise; /** * Stop using sensitive permission. @@ -54,8 +52,7 @@ import {AsyncCallback} from './basic' * @systemapi hid this for inner system use * @since 9 */ - function stopUsingPermission(tokenID: number, permissionName: string): Promise; - function stopUsingPermission(tokenID: number, permissionName: string, callback: AsyncCallback): void; + function stopUsingPermission(tokenID: number, permissionName: string): Promise; /** * Queries the access records of sensitive permission. -- Gitee From 0da3bbef42a8f235e8c5499532ea9b94e1e33ae1 Mon Sep 17 00:00:00 2001 From: chennian Date: Wed, 25 May 2022 10:00:13 +0800 Subject: [PATCH 14/19] Signed-off-by:chennian Signed-off-by: chennian --- api/@ohos.privacyManager.d.ts | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/api/@ohos.privacyManager.d.ts b/api/@ohos.privacyManager.d.ts index a877a3e8dd..d4ecc165dd 100644 --- a/api/@ohos.privacyManager.d.ts +++ b/api/@ohos.privacyManager.d.ts @@ -25,34 +25,37 @@ import {AsyncCallback} from './basic' * @param permissionName The permission name to be added. * @param successCount Access count. * @param failCount Reject account. - * @return NA. + * @return Returns 0 if the method is called successfully, returns -1 otherwise. * @permission ohos.permission.PERMISSION_USED_STATS. * @systemapi hid this for inner system use * @since 9 */ - function addPermissionUsedRecord(tokenID: number, permissionName: string, successCount: number, failCount: number): Promise; + function addPermissionUsedRecord(tokenID: number, permissionName: string, successCount: number, failCount: number): Promise; + function addPermissionUsedRecord(tokenID: number, permissionName: string, successCount: number, failCount: number, callback: AsyncCallback): void; /** * Start using sensitive permission. * @param tokenID The tokenId of specified application. * @param permissionName The permission name to be started. - * @return NA. + * @return Returns 0 if the method is called successfully, returns -1 otherwise. * @permission ohos.permission.PERMISSION_USED_STATS. * @systemapi hid this for inner system use * @since 9 */ - function startUsingPermission(tokenID: number, permissionName: string): Promise; + function startUsingPermission(tokenID: number, permissionName: string): Promise; + function startUsingPermission(tokenID: number, permissionName: string, callback: AsyncCallback): void; /** * Stop using sensitive permission. * @param tokenID The tokenId of specified application. * @param permissionName The permission name to be stopped. - * @return NA. + * @return Returns 0 if the method is called successfully, returns -1 otherwise. * @permission ohos.permission.PERMISSION_USED_STATS. * @systemapi hid this for inner system use * @since 9 */ - function stopUsingPermission(tokenID: number, permissionName: string): Promise; + function stopUsingPermission(tokenID: number, permissionName: string): Promise; + function stopUsingPermission(tokenID: number, permissionName: string, callback: AsyncCallback): void; /** * Queries the access records of sensitive permission. -- Gitee From c6a5729c052dcb6a242ecfd22e8d54dd261a56bc Mon Sep 17 00:00:00 2001 From: chennian Date: Thu, 26 May 2022 09:14:17 +0800 Subject: [PATCH 15/19] Signed-off-by:chennian 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 d4ecc165dd..4a6e1417ea 100644 --- a/api/@ohos.privacyManager.d.ts +++ b/api/@ohos.privacyManager.d.ts @@ -101,7 +101,7 @@ import {AsyncCallback} from './basic' /** * The list of permision name */ - permNames: Array; + permissionNames: Array; /** * The begin time -- Gitee From 4bf58460b44e9179397b755a295bb2bbfd53946c Mon Sep 17 00:00:00 2001 From: chennian Date: Thu, 26 May 2022 09:22:17 +0800 Subject: [PATCH 16/19] Signed-off-by:chennian Signed-off-by: chennian --- api/@ohos.privacyManager.d.ts | 38 +++++++++++++++++------------------ 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/api/@ohos.privacyManager.d.ts b/api/@ohos.privacyManager.d.ts index 4a6e1417ea..6a07455438 100644 --- a/api/@ohos.privacyManager.d.ts +++ b/api/@ohos.privacyManager.d.ts @@ -27,7 +27,7 @@ import {AsyncCallback} from './basic' * @param failCount Reject account. * @return Returns 0 if the method is called successfully, returns -1 otherwise. * @permission ohos.permission.PERMISSION_USED_STATS. - * @systemapi hid this for inner system use + * @systemapi hide this for inner system use * @since 9 */ function addPermissionUsedRecord(tokenID: number, permissionName: string, successCount: number, failCount: number): Promise; @@ -39,7 +39,7 @@ import {AsyncCallback} from './basic' * @param permissionName The permission name to be started. * @return Returns 0 if the method is called successfully, returns -1 otherwise. * @permission ohos.permission.PERMISSION_USED_STATS. - * @systemapi hid this for inner system use + * @systemapi hide this for inner system use * @since 9 */ function startUsingPermission(tokenID: number, permissionName: string): Promise; @@ -51,7 +51,7 @@ import {AsyncCallback} from './basic' * @param permissionName The permission name to be stopped. * @return Returns 0 if the method is called successfully, returns -1 otherwise. * @permission ohos.permission.PERMISSION_USED_STATS. - * @systemapi hid this for inner system use + * @systemapi hide this for inner system use * @since 9 */ function stopUsingPermission(tokenID: number, permissionName: string): Promise; @@ -62,7 +62,7 @@ import {AsyncCallback} from './basic' * @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 + * @systemapi hide this for inner system use * @since 9 */ function getPermissionUsedRecords(request: PermissionUsedRequest): Promise; @@ -104,14 +104,14 @@ import {AsyncCallback} from './basic' permissionNames: Array; /** - * The begin time + * The begin time, in milliseconds */ - beginTimeMillis: number; + beginTime: number; /** - * The end time + * The end time, in milliseconds */ - endTimeMillis: number; + endTime: number; /** * The permission usage flag @@ -125,14 +125,14 @@ import {AsyncCallback} from './basic' */ interface PermissionUsedResponse { /** - * The begin time + * The begin time, in milliseconds */ - beginTimeMillis: number; + beginTime: number; /** - * The end time + * The end time, in milliseconds */ - endTimeMillis: number; + endTime: number; /** * The list of permision used records of bundle @@ -182,27 +182,27 @@ import {AsyncCallback} from './basic' rejectCount: number; /** - * The last access time + * The last access time, in milliseconds */ lastAccessTime: number; /** - * The last reject time + * The last reject time, in milliseconds */ lastRejectTime: number; /** - * The last access duration + * The last access duration, in milliseconds */ lastAccessDuration: number; /** - * The list of access timestamp records + * The list of access records of details */ accessRecords: Array; /** - * The list of reject timestamp records + * The list of reject records of details */ rejectRecords: Array; } @@ -218,12 +218,12 @@ import {AsyncCallback} from './basic' status: number; /** - * Access/reject timestamp + * Timestamp, in milliseconds */ timestamp: number; /** - * Access duration + * Access duration, in milliseconds */ accessDuration: number; } -- Gitee From 4b62616f9221c1349872faa4c12d15cb2630c28a Mon Sep 17 00:00:00 2001 From: chennian Date: Thu, 26 May 2022 10:27:24 +0800 Subject: [PATCH 17/19] Signed-off-by:chennian Signed-off-by: chennian --- api/@ohos.privacyManager.d.ts | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/api/@ohos.privacyManager.d.ts b/api/@ohos.privacyManager.d.ts index 6a07455438..616319266f 100644 --- a/api/@ohos.privacyManager.d.ts +++ b/api/@ohos.privacyManager.d.ts @@ -89,6 +89,16 @@ import {AsyncCallback} from './basic' */ interface PermissionUsedRequest { /** + * AccessTokenID + */ + tokenId: number; + + /** + * Distribute flag + */ + isRemote: boolean; + + /** * The device id */ deviceId: string; @@ -145,6 +155,16 @@ import {AsyncCallback} from './basic' * @since 9 */ interface BundleUsedRecord { + /** + * AccessTokenID + */ + tokenId: number; + + /** + * Distribute flag + */ + isRemote: boolean; + /** * The device id */ -- Gitee From 654358d38b9c2d5c9ba3415b36d04b1c7f73d1e4 Mon Sep 17 00:00:00 2001 From: chennian Date: Sat, 28 May 2022 10:27:39 +0800 Subject: [PATCH 18/19] privacyManager js api Signed-off-by: chennian --- api/@ohos.privacyManager.d.ts | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/api/@ohos.privacyManager.d.ts b/api/@ohos.privacyManager.d.ts index 616319266f..d7526c8a23 100644 --- a/api/@ohos.privacyManager.d.ts +++ b/api/@ohos.privacyManager.d.ts @@ -33,30 +33,6 @@ import {AsyncCallback} from './basic' function addPermissionUsedRecord(tokenID: number, permissionName: string, successCount: number, failCount: number): Promise; function addPermissionUsedRecord(tokenID: number, permissionName: string, successCount: number, failCount: number, callback: AsyncCallback): void; - /** - * Start using sensitive permission. - * @param tokenID The tokenId of specified application. - * @param permissionName The permission name to be started. - * @return Returns 0 if the method is called successfully, returns -1 otherwise. - * @permission ohos.permission.PERMISSION_USED_STATS. - * @systemapi hide this for inner system use - * @since 9 - */ - function startUsingPermission(tokenID: number, permissionName: string): Promise; - function startUsingPermission(tokenID: number, permissionName: string, callback: AsyncCallback): void; - - /** - * Stop using sensitive permission. - * @param tokenID The tokenId of specified application. - * @param permissionName The permission name to be stopped. - * @return Returns 0 if the method is called successfully, returns -1 otherwise. - * @permission ohos.permission.PERMISSION_USED_STATS. - * @systemapi hide this for inner system use - * @since 9 - */ - function stopUsingPermission(tokenID: number, permissionName: string): Promise; - function stopUsingPermission(tokenID: number, permissionName: string, callback: AsyncCallback): void; - /** * Queries the access records of sensitive permission. * @param request The request of permission used records. -- Gitee From 8c2f2520fa16eca6057b74b69cad4467d1b406c6 Mon Sep 17 00:00:00 2001 From: chennian Date: Mon, 30 May 2022 17:07:42 +0800 Subject: [PATCH 19/19] Signed-off-by:chennian Signed-off-by: chennian --- api/@ohos.privacyManager.d.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/api/@ohos.privacyManager.d.ts b/api/@ohos.privacyManager.d.ts index d7526c8a23..d5d0c94d98 100644 --- a/api/@ohos.privacyManager.d.ts +++ b/api/@ohos.privacyManager.d.ts @@ -46,6 +46,7 @@ import {AsyncCallback} from './basic' /** * PermissionUsageFlag. + * @systemapi hide this for inner system use * @since 9 */ enum PermissionUsageFlag { @@ -61,6 +62,7 @@ import {AsyncCallback} from './basic' /** * Provides request of querying permission used records. + * @systemapi hide this for inner system use * @since 9 */ interface PermissionUsedRequest { @@ -107,6 +109,7 @@ import {AsyncCallback} from './basic' /** * Provides response of querying permission used records. + * @systemapi hide this for inner system use * @since 9 */ interface PermissionUsedResponse { @@ -128,6 +131,7 @@ import {AsyncCallback} from './basic' /** * BundleUsedRecord. + * @systemapi hide this for inner system use * @since 9 */ interface BundleUsedRecord { @@ -159,6 +163,7 @@ import {AsyncCallback} from './basic' /** * PermissionUsedRecord. + * @systemapi hide this for inner system use * @since 9 */ interface PermissionUsedRecord { @@ -205,6 +210,7 @@ import {AsyncCallback} from './basic' /** * UsedRecordDetail. + * @systemapi hide this for inner system use * @since 9 */ interface UsedRecordDetail { -- Gitee