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

!23525 告警清理

Merge pull request !23525 from 耿文广/master
......@@ -58,13 +58,13 @@ let appId = "com.example.myapplication_xxxxx";
let want:Want = {bundleName: 'com.example.myapplication'};
try {
appControl.setDisposedStatus(appId, want)
.then(() => {
console.info('setDisposedStatus success');
}).catch((error: BusinessError) => {
let message = (error as BusinessError).message;
console.error('setDisposedStatus failed ' + message);
});
appControl.setDisposedStatus(appId, want)
.then(() => {
console.info('setDisposedStatus success');
}).catch((error: BusinessError) => {
let message = (error as BusinessError).message;
console.error('setDisposedStatus failed ' + message);
});
} catch (error) {
let message = (error as BusinessError).message;
console.error('setDisposedStatus failed ' + message);
......
......@@ -68,13 +68,16 @@ on(type: BundleChangedEvent, callback: Callback\<BundleChangedInfo>): void;
```ts
import bundleMonitor from '@ohos.bundle.bundleMonitor';
import { BusinessError } from '@ohos.base';
try {
bundleMonitor.on('add', (bundleChangeInfo) => {
console.info(`bundleName : ${bundleChangeInfo.bundleName} userId : ${bundleChangeInfo.userId}`);
})
} catch (errData) {
console.log(`errData is errCode:${errData.errCode} message:${errData.message}`);
let message = (errData as BusinessError).message;
let errCode = (errData as BusinessError).code;
console.log(`errData is errCode:${errCode} message:${message}`);
}
```
......@@ -101,10 +104,13 @@ off(type: BundleChangedEvent, callback?: Callback\<BundleChangedInfo>): void;
```ts
import bundleMonitor from '@ohos.bundle.bundleMonitor';
import { BusinessError } from '@ohos.base';
try {
bundleMonitor.off('add');
} catch (errData) {
console.log(`errData is errCode:${errData.errCode} message:${errData.message}`);
let message = (errData as BusinessError).message;
let errCode = (errData as BusinessError).code;
console.log(`errData is errCode:${errCode} message:${message}`);
}
```
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册