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

!17075 on|off接口示例代码使用bundleManager替换废弃的bundle-3.2beta5挑单

Merge pull request !17075 from zhouyan/cherry-pick-1681176458
......@@ -461,10 +461,10 @@ on(type: 'permissionStateChange', tokenIDList: Array<number>, permissionLi
```js
import abilityAccessCtrl, {Permissions} from '@ohos.abilityAccessCtrl';
import bundle from '@ohos.bundle.bundleManager';
import bundleManager from '@ohos.bundle.bundleManager';
let atManager = abilityAccessCtrl.createAtManager();
let appInfo = bundle.getApplicationInfoSync('com.example.myapplication', 0, 100);
let appInfo = bundleManager.getApplicationInfoSync('com.example.myapplication', 0, 100);
let tokenIDList: Array<number> = [appInfo.accessTokenId];
let permissionList: Array<Permissions> = ["ohos.permission.DISTRIBUTED_DATASYNC"];
try {
......@@ -512,10 +512,10 @@ off(type: 'permissionStateChange', tokenIDList: Array&lt;number&gt;, permissionL
```js
import abilityAccessCtrl, {Permissions} from '@ohos.abilityAccessCtrl';
import bundle from '@ohos.bundle.bundleManager';
import bundleManager from '@ohos.bundle.bundleManager';
let atManager = abilityAccessCtrl.createAtManager();
let appInfo = bundle.getApplicationInfoSync('com.example.myapplication', 0, 100);
let appInfo = bundleManager.getApplicationInfoSync('com.example.myapplication', 0, 100);
let tokenIDList: Array<number> = [appInfo.accessTokenId];
let permissionList: Array<Permissions> = ["ohos.permission.DISTRIBUTED_DATASYNC"];
try {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册