harmony 鸿蒙Application Access Control Subsystem Changelog
Application Access Control Subsystem Changelog
cl.access_token.1 Change of the Value Returned by getPermissionUsedRecord
Change Impact
Before the change, the permission access record returned by getPermissionUsedRecord includes the foreground and background status, access timestamp, and access duration.
After the change, the permission access record also includes lockScreenStatus, which is optional.
For details, see UsedRecordDetail.
Adaptation Guide
For details, see getPermissionUsedRecord.
For example, call getPermissionUsedRecord to obtain information about the permission usage and parse lockScreenStatus.
Sample code:
import privacyManager from '@ohos.privacyManager';
try {
privacyManager.getPermissionUsedRecord({
flag:1
}, (err, data) => {
try {
let record = data.bundleRecords[0].permissionRecords[0];
let access = record.accessRecords;
let reject = record.rejectRecords;
for (let i = 0; i < access.length; i++) {
let detail = access[i];
console.log(`access record detail lockscreen status: ` + detail.lockScreenStatus);
}
for (let i = 0; i < reject.length; i++) {
let detail = reject[i];
console.log(`reject record detail lockscreen status: ` + detail.lockScreenStatus);
}
} catch(err) {
console.log(`catch err->${JSON.stringify(err)}`);
}
})
} catch(err) {
console.log(`catch err->${JSON.stringify(err)}`);
}
你可能感兴趣的鸿蒙文章
harmony 鸿蒙OpenHarmony Docker镜像
harmony 鸿蒙OpenHarmony Docker Image
harmony 鸿蒙IDL Specifications and User Guide (for System Applications Only)
0
赞
- 所属分类: 后端技术
- 本文标签:
热门推荐
-
2、 - 优质文章
-
3、 gate.io
-
8、 golang
-
9、 openharmony
-
10、 Vue中input框自动聚焦