提交 0bbf700c 编写于 作者: W wusongqing

updated docs against TR5091

Signed-off-by: Nwusongqing <wusongqing@huawei.com>
上级 9024154a
......@@ -41,7 +41,7 @@ If a service needs to be continued when the application or service module is run
backgroundTaskManager.getRemainingDelayTime(id).then( res => {
console.log('promise => Operation getRemainingDelayTime succeeded. Data: ' + JSON.stringify(res));
}).catch( err => {
console.log('promise => Operation getRemainingDelayTime failed. Cause: ' + err.data);
console.log('promise => Operation getRemainingDelayTime failed. Cause: ' + err.code);
});
```
......@@ -74,7 +74,7 @@ console.info("The actualDelayTime is: " + time);
backgroundTaskManager.getRemainingDelayTime(id).then( res => {
console.log('promise => Operation getRemainingDelayTime succeeded. Data: ' + JSON.stringify(res));
}).catch( err => {
console.log('promise => Operation getRemainingDelayTime failed. Cause: ' + err.data);
console.log('promise => Operation getRemainingDelayTime failed. Cause: ' + err.code);
});
// Cancel the suspension delay.
......
......@@ -67,10 +67,10 @@ Obtains the remaining duration before the application is suspended. This API use
```js
let id = 1;
backgroundTaskManager.getRemainingDelayTime(id, (err, res) => {
if(err.data === 0) {
console.log('callback => Operation getRemainingDelayTime succeeded. Data: ' + JSON.stringify(res));
if(err) {
console.log('callback => Operation getRemainingDelayTime failed. Cause: ' + err.code);
} else {
console.log('callback => Operation getRemainingDelayTime failed. Cause: ' + err.data);
console.log('callback => Operation getRemainingDelayTime succeeded. Data: ' + JSON.stringify(res));
}
})
```
......@@ -100,7 +100,7 @@ Obtains the remaining duration before the application is suspended. This API use
backgroundTaskManager.getRemainingDelayTime(id).then( res => {
console.log('promise => Operation getRemainingDelayTime succeeded. Data: ' + JSON.stringify(res));
}).catch( err => {
console.log('promise => Operation getRemainingDelayTime failed. Cause: ' + err.data);
console.log('promise => Operation getRemainingDelayTime failed. Cause: ' + err.code);
})
```
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册