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

!23525 告警清理

Merge pull request !23525 from 耿文广/master
...@@ -58,13 +58,13 @@ let appId = "com.example.myapplication_xxxxx"; ...@@ -58,13 +58,13 @@ let appId = "com.example.myapplication_xxxxx";
let want:Want = {bundleName: 'com.example.myapplication'}; let want:Want = {bundleName: 'com.example.myapplication'};
try { try {
appControl.setDisposedStatus(appId, want) appControl.setDisposedStatus(appId, want)
.then(() => { .then(() => {
console.info('setDisposedStatus success'); console.info('setDisposedStatus success');
}).catch((error: BusinessError) => { }).catch((error: BusinessError) => {
let message = (error as BusinessError).message; let message = (error as BusinessError).message;
console.error('setDisposedStatus failed ' + message); console.error('setDisposedStatus failed ' + message);
}); });
} catch (error) { } catch (error) {
let message = (error as BusinessError).message; let message = (error as BusinessError).message;
console.error('setDisposedStatus failed ' + message); console.error('setDisposedStatus failed ' + message);
......
...@@ -68,13 +68,16 @@ on(type: BundleChangedEvent, callback: Callback\<BundleChangedInfo>): void; ...@@ -68,13 +68,16 @@ on(type: BundleChangedEvent, callback: Callback\<BundleChangedInfo>): void;
```ts ```ts
import bundleMonitor from '@ohos.bundle.bundleMonitor'; import bundleMonitor from '@ohos.bundle.bundleMonitor';
import { BusinessError } from '@ohos.base';
try { try {
bundleMonitor.on('add', (bundleChangeInfo) => { bundleMonitor.on('add', (bundleChangeInfo) => {
console.info(`bundleName : ${bundleChangeInfo.bundleName} userId : ${bundleChangeInfo.userId}`); console.info(`bundleName : ${bundleChangeInfo.bundleName} userId : ${bundleChangeInfo.userId}`);
}) })
} catch (errData) { } 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; ...@@ -101,10 +104,13 @@ off(type: BundleChangedEvent, callback?: Callback\<BundleChangedInfo>): void;
```ts ```ts
import bundleMonitor from '@ohos.bundle.bundleMonitor'; import bundleMonitor from '@ohos.bundle.bundleMonitor';
import { BusinessError } from '@ohos.base';
try { try {
bundleMonitor.off('add'); bundleMonitor.off('add');
} catch (errData) { } 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.
先完成此消息的编辑!
想要评论请 注册