未验证 提交 4c2579eb 编写于 作者: O openharmony_ci 提交者: Gitee

!14267 api检视意见闭环

Merge pull request !14267 from shuqinglin/lsq23_0203_01
......@@ -120,9 +120,9 @@ try {
}
```
## privacyManager.getPermissionUsedRecords
## privacyManager.getPermissionUsedRecord
getPermissionUsedRecords(request: PermissionUsedRequest): Promise<PermissionUsedResponse>
getPermissionUsedRecord(request: PermissionUsedRequest): Promise<PermissionUsedResponse>
Obtains historical permission usage records. This API uses a promise to return the result.
......@@ -170,19 +170,19 @@ let request = {
"flag":privacyManager.PermissionUsageFlag.FLAG_PERMISSION_USAGE_DETAIL,
};
try {
privacyManager.getPermissionUsedRecords(request).then((data) => {
console.log(`getPermissionUsedRecords success, data->${JSON.stringify(data)}`);
privacyManager.getPermissionUsedRecord(request).then((data) => {
console.log(`getPermissionUsedRecord success, data->${JSON.stringify(data)}`);
}).catch((err) => {
console.log(`getPermissionUsedRecords fail, err->${JSON.stringify(err)}`);
console.log(`getPermissionUsedRecord fail, err->${JSON.stringify(err)}`);
});
} catch(err) {
console.log(`catch err->${JSON.stringify(err)}`);
}
```
## privacyManager.getPermissionUsedRecords
## privacyManager.getPermissionUsedRecord
getPermissionUsedRecords(request: PermissionUsedRequest, callback: AsyncCallback<PermissionUsedResponse>): void
getPermissionUsedRecord(request: PermissionUsedRequest, callback: AsyncCallback<PermissionUsedResponse>): void
Obtains historical permission usage records. This API uses an asynchronous callback to return the result.
......@@ -225,11 +225,11 @@ let request = {
"flag":privacyManager.PermissionUsageFlag.FLAG_PERMISSION_USAGE_DETAIL,
};
try {
privacyManager.getPermissionUsedRecords(request, (err, data) => {
privacyManager.getPermissionUsedRecord(request, (err, data) => {
if (err) {
console.log(`getPermissionUsedRecords fail, err->${JSON.stringify(err)}`);
console.log(`getPermissionUsedRecord fail, err->${JSON.stringify(err)}`);
} else {
console.log(`getPermissionUsedRecords success, data->${JSON.stringify(data)}`);
console.log(`getPermissionUsedRecord success, data->${JSON.stringify(data)}`);
}
});
} catch(err) {
......
......@@ -120,9 +120,9 @@ try {
}
```
## privacyManager.getPermissionUsedRecords
## privacyManager.getPermissionUsedRecord
getPermissionUsedRecords(request: PermissionUsedRequest): Promise<PermissionUsedResponse>
getPermissionUsedRecord(request: PermissionUsedRequest): Promise<PermissionUsedResponse>
获取历史权限使用记录。使用Promise异步回调。
......@@ -170,19 +170,19 @@ let request = {
"flag":privacyManager.PermissionUsageFlag.FLAG_PERMISSION_USAGE_DETAIL,
};
try {
privacyManager.getPermissionUsedRecords(request).then((data) => {
console.log(`getPermissionUsedRecords success, data->${JSON.stringify(data)}`);
privacyManager.getPermissionUsedRecord(request).then((data) => {
console.log(`getPermissionUsedRecord success, data->${JSON.stringify(data)}`);
}).catch((err) => {
console.log(`getPermissionUsedRecords fail, err->${JSON.stringify(err)}`);
console.log(`getPermissionUsedRecord fail, err->${JSON.stringify(err)}`);
});
} catch(err) {
console.log(`catch err->${JSON.stringify(err)}`);
}
```
## privacyManager.getPermissionUsedRecords
## privacyManager.getPermissionUsedRecord
getPermissionUsedRecords(request: PermissionUsedRequest, callback: AsyncCallback<PermissionUsedResponse>): void
getPermissionUsedRecord(request: PermissionUsedRequest, callback: AsyncCallback<PermissionUsedResponse>): void
获取历史权限使用记录。使用callback异步回调。
......@@ -225,11 +225,11 @@ let request = {
"flag":privacyManager.PermissionUsageFlag.FLAG_PERMISSION_USAGE_DETAIL,
};
try {
privacyManager.getPermissionUsedRecords(request, (err, data) => {
privacyManager.getPermissionUsedRecord(request, (err, data) => {
if (err) {
console.log(`getPermissionUsedRecords fail, err->${JSON.stringify(err)}`);
console.log(`getPermissionUsedRecord fail, err->${JSON.stringify(err)}`);
} else {
console.log(`getPermissionUsedRecords success, data->${JSON.stringify(data)}`);
console.log(`getPermissionUsedRecord success, data->${JSON.stringify(data)}`);
}
});
} catch(err) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册