提交 231cd535 编写于 作者: Z zhouyan

on|off接口示例代码使用bundleManager替换废弃的bundle

Signed-off-by: Nzhouyan <zhouyan160@huawei.com>
Change-Id: I8fbdecd130fecf4541a886db27fc86f26930f4f7
上级 3351d1d3
......@@ -461,10 +461,10 @@ on(type: 'permissionStateChange', tokenIDList: Array&lt;number&gt;, 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.
先完成此消息的编辑!
想要评论请 注册