From 1da3c7df17640ddb8f576625b45ce23e148f87cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B1=9F=E6=B5=B7?= Date: Wed, 20 Jul 2022 10:52:44 +0000 Subject: [PATCH] =?UTF-8?q?Signed-off-by:=20=E6=B1=9F=E6=B5=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../extend/systemplugin/napi/ohos_update.js | 56 ++++++++++++++++++- 1 file changed, 55 insertions(+), 1 deletion(-) diff --git a/runtime/main/extend/systemplugin/napi/ohos_update.js b/runtime/main/extend/systemplugin/napi/ohos_update.js index d78eeb32..cc209a65 100644 --- a/runtime/main/extend/systemplugin/napi/ohos_update.js +++ b/runtime/main/extend/systemplugin/napi/ohos_update.js @@ -246,6 +246,16 @@ export function mockUpdate() { UpgradeStatus, EventClassify, EventId, + UpgradeInfo, + BusinessType, + DownloadOptions, + ResumeDownloadOptions, + PauseDownloadOptions, + UpgradeOptions, + ClearOptions, + EventClassifyInfo, + UpgradeFile, + UpgradeTaskCallback, getOnlineUpdater: function (...args) { console.warn("update.getOnlineUpdater interface mocked in the Previewer. How this interface works on the" + " Previewer may be different from that on a real device.") @@ -271,7 +281,6 @@ const BusinessVendor = { const BusinessSubType = { FIRMWARE: 1, - PARAM: 2, } const ComponentType = { @@ -413,3 +422,48 @@ const EventInfo = { eventId: EventId.EVENT_TASK_RECEIVE, taskBody: TaskBody, } + +const UpgradeInfo = { + upgradeApp: "com.ohos.ota.updateclient", + businessType: BusinessType +} + +const BusinessType = { + vendor: BusinessVendor, + subType: BusinessSubType +} + +const DownloadOptions = { + allowNetwork: NetType, + order: Order +} + +const ResumeDownloadOptions = { + allowNetwork: NetType +} + +const PauseDownloadOptions = { + isAllowAutoResume: boolean +} + +const UpgradeOptions = { + order: Order +} + +const ClearOptions = { + status: UpgradeStatus +} + +const EventClassifyInfo = { + eventClassify: EventClassify, + extraInfo: string +} + +const UpgradeFile = { + fileType: ComponentType, + filePath: string +} + +const UpgradeTaskCallback = { + UpgradeTaskCallback: (eventInfo) => {} +} \ No newline at end of file