You need to sign in or sign up before continuing.
提交 496caac5 编写于 作者: C chennian

修改参考示例问bug

Signed-off-by:chennian<chennian1@huawei.com>
Signed-off-by: Nchennian <chennian1@huawei.com>
上级 fd889723
...@@ -214,7 +214,7 @@ var AtManager = abilityAccessCtrl.createAtManager(); ...@@ -214,7 +214,7 @@ var AtManager = abilityAccessCtrl.createAtManager();
let tokenID = 0; // 可以通过getApplicationInfo获取accessTokenId let tokenID = 0; // 可以通过getApplicationInfo获取accessTokenId
let permissionFlag = 1; let permissionFlag = 1;
try { try {
AtManager.grantUserGrantedPermission(tokenID, "ohos.permission.GRANT_SENSITIVE_PERMISSIONS", permissionFlag, (data, err) => { AtManager.grantUserGrantedPermission(tokenID, "ohos.permission.GRANT_SENSITIVE_PERMISSIONS", permissionFlag, (err, data) => {
if (err) { if (err) {
console.log(`grantUserGrantedPermission fail, err->${JSON.stringify(err)}`); console.log(`grantUserGrantedPermission fail, err->${JSON.stringify(err)}`);
} else { } else {
...@@ -321,7 +321,7 @@ var AtManager = abilityAccessCtrl.createAtManager(); ...@@ -321,7 +321,7 @@ var AtManager = abilityAccessCtrl.createAtManager();
let tokenID = 0; // 可以通过getApplicationInfo获取accessTokenId let tokenID = 0; // 可以通过getApplicationInfo获取accessTokenId
let permissionFlag = 1; let permissionFlag = 1;
try { try {
AtManager.revokeUserGrantedPermission(tokenID, "ohos.permission.GRANT_SENSITIVE_PERMISSIONS", permissionFlag, (data, err) => { AtManager.revokeUserGrantedPermission(tokenID, "ohos.permission.GRANT_SENSITIVE_PERMISSIONS", permissionFlag, (err, data) => {
if (err) { if (err) {
console.log(`revokeUserGrantedPermission fail, err->${JSON.stringify(err)}`); console.log(`revokeUserGrantedPermission fail, err->${JSON.stringify(err)}`);
} else { } else {
......
...@@ -102,7 +102,7 @@ import privacyManager from '@ohos.privacyManager'; ...@@ -102,7 +102,7 @@ import privacyManager from '@ohos.privacyManager';
let tokenID = 0; // 可以通过getApplicationInfo获取accessTokenId let tokenID = 0; // 可以通过getApplicationInfo获取accessTokenId
try { try {
privacyManager.addPermissionUsedRecord(tokenID, "ohos.permission.PERMISSION_USED_STATS", 1, 0, (data, err) => { privacyManager.addPermissionUsedRecord(tokenID, "ohos.permission.PERMISSION_USED_STATS", 1, 0, (err, data) => {
if (err) { if (err) {
console.log(`addPermissionUsedRecord fail, err->${JSON.stringify(err)}`); console.log(`addPermissionUsedRecord fail, err->${JSON.stringify(err)}`);
} else { } else {
...@@ -310,7 +310,7 @@ import privacyManager from '@ohos.privacyManager'; ...@@ -310,7 +310,7 @@ import privacyManager from '@ohos.privacyManager';
let tokenID = 0; // 可以通过getApplicationInfo获取accessTokenId let tokenID = 0; // 可以通过getApplicationInfo获取accessTokenId
try { try {
privacyManager.startUsingPermission(tokenID, "ohos.permission.PERMISSION_USED_STATS", (data, err) => { privacyManager.startUsingPermission(tokenID, "ohos.permission.PERMISSION_USED_STATS", (err, data) => {
if (err) { if (err) {
console.log(`startUsingPermission fail, err->${JSON.stringify(err)}`); console.log(`startUsingPermission fail, err->${JSON.stringify(err)}`);
} else { } else {
...@@ -407,7 +407,7 @@ import privacyManager from '@ohos.privacyManager'; ...@@ -407,7 +407,7 @@ import privacyManager from '@ohos.privacyManager';
let tokenID = 0; // 可以通过getApplicationInfo获取accessTokenId let tokenID = 0; // 可以通过getApplicationInfo获取accessTokenId
try { try {
privacyManager.stopUsingPermission(tokenID, "ohos.permission.PERMISSION_USED_STATS", (data, err) => { privacyManager.stopUsingPermission(tokenID, "ohos.permission.PERMISSION_USED_STATS", (err, data) => {
if (err) { if (err) {
console.log(`stopUsingPermission fail, err->${JSON.stringify(err)}`); console.log(`stopUsingPermission fail, err->${JSON.stringify(err)}`);
} else { } else {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册