提交 0fa717c1 编写于 作者: 廖康康

update

Signed-off-by: N廖康康 <liaokangkang@huawei.com>
上级 8634359d
......@@ -34,11 +34,7 @@ import backgroundTaskManager from '@ohos.backgroundTaskManager';
import backgroundTaskManager from '@ohos.backgroundTaskManager';
let myReason = 'test requestSuspendDelay';
let delayInfo = backgroundTaskManager.requestSuspendDelay(myReason, (val) => {
if(val.code === 0) {
console.info("Operation time out: " + val.data);
} else {
console.info("Operation failed: " + val.data);
}
console.info("Request suspend delay will time out.");
});
var id = delayInfo.requestId;console.info("requestId is: " + id);
```
......@@ -65,11 +61,7 @@ import backgroundTaskManager from '@ohos.backgroundTaskManager';
let myReason = 'test requestSuspendDelay';
// 申请延迟挂起
let delayInfo = backgroundTaskManager.requestSuspendDelay(myReason, (val) => {
if(val.code === 0) {
console.info("Operation time out: " + val.data);
} else {
console.info("Operation failed: " + val.data);
}
console.info("Request suspend delay will time out.");
});
// 打印延迟挂起信息
var id = delayInfo.requestId;
......
......@@ -39,11 +39,7 @@ requestSuspendDelay(reason: string, callback: Callback&lt;void&gt;): DelaySuspen
```
let myReason = 'test requestSuspendDelay';
let delayInfo = backgroundTaskManager.requestSuspendDelay(myReason, (val) => {
if(val.code === 0) {
console.info("Operation time out: " + val.data);
} else {
console.info("Operation failed: " + val.data);
}
console.info("Request suspend delay will time out.");
})
```
......@@ -64,7 +60,7 @@ getRemainingDelayTime(requestId: number, callback: AsyncCallback&lt;number&gt;):
```
let id = 1;
backgroundTaskManager.getRemainingDelayTime(id, (err, res) => {
if(err) {
if(err.data === 0) {
console.log('promise => Operation succeeded. Data: ' + JSON.stringify(res));
} else {
console.log('promise => Operation failed. Cause: ' + err.data);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册