1# JS API Changes of the Update Subsystem 2 3The table below lists the APIs changes of the update subsystem in OpenHarmony 3.2 Beta2 over OpenHarmony 3.2 Beta1. 4 5## API Changes 6 7| Module| Class| Method/Attribute/Enumeration/Constant| Change Type| 8|---|---|---|---| 9| ohos.update | EventId | EVENT_UPGRADE_FAIL | Added| 10| ohos.update | EventId | EVENT_UPGRADE_SUCCESS | Added| 11| ohos.update | EventId | EVENT_APPLY_START | Added| 12| ohos.update | EventId | EVENT_APPLY_WAIT | Added| 13| ohos.update | EventId | EVENT_UPGRADE_UPDATE | Added| 14| ohos.update | EventId | EVENT_UPGRADE_START | Added| 15| ohos.update | EventId | EVENT_UPGRADE_WAIT | Added| 16| ohos.update | EventId | EVENT_DOWNLOAD_FAIL | Added| 17| ohos.update | EventId | EVENT_DOWNLOAD_SUCCESS | Added| 18| ohos.update | EventId | EVENT_DOWNLOAD_RESUME | Added| 19| ohos.update | EventId | EVENT_DOWNLOAD_PAUSE | Added| 20| ohos.update | EventId | EVENT_DOWNLOAD_UPDATE | Added| 21| ohos.update | EventId | EVENT_DOWNLOAD_START | Added| 22| ohos.update | EventId | EVENT_DOWNLOAD_WAIT | Added| 23| ohos.update | EventId | EVENT_TASK_CANCEL | Added| 24| ohos.update | EventId | EVENT_TASK_RECEIVE | Added| 25| ohos.update | EventId | EVENT_TASK_BASE = EventClassify.TASK | Added| 26| ohos.update | EventClassify | TASK = 0x01000000 | Added| 27| ohos.update | UpgradeStatus | UPGRADE_FAIL = 51 | Added| 28| ohos.update | UpgradeStatus | UPGRADE_SUCCESS = 50 | Added| 29| ohos.update | UpgradeStatus | APPLYING = 41 | Added| 30| ohos.update | UpgradeStatus | WAITING_APPLY = 40 | Added| 31| ohos.update | UpgradeStatus | UPDATING = 31 | Added| 32| ohos.update | UpgradeStatus | WAITING_INSTALL = 30 | Added| 33| ohos.update | UpgradeStatus | DOWNLOAD_FAIL = 23 | Added| 34| ohos.update | UpgradeStatus | DOWNLOAD_PAUSED = 22 | Added| 35| ohos.update | UpgradeStatus | DOWNLOADING = 21 | Added| 36| ohos.update | UpgradeStatus | WAITING_DOWNLOAD = 20 | Added| 37| ohos.update | Order | APPLY = 4 | Added| 38| ohos.update | Order | INSTALL = 2 | Added| 39| ohos.update | Order | DOWNLOAD = 1 | Added| 40| ohos.update | NetType | NOT_METERED_WIFI = 4 | Added| 41| ohos.update | NetType | METERED_WIFI = 2 | Added| 42| ohos.update | NetType | CELLULAR = 1 | Added| 43| ohos.update | DescriptionType | URI = 1 | Added| 44| ohos.update | DescriptionType | CONTENT = 0 | Added| 45| ohos.update | EffectiveMode | LIVE_AND_COLD = 3 | Added| 46| ohos.update | EffectiveMode | LIVE = 2 | Added| 47| ohos.update | EffectiveMode | COLD = 1 | Added| 48| ohos.update | UpgradeAction | RECOVERY = "recovery" | Added| 49| ohos.update | UpgradeAction | UPGRADE = "upgrade" | Added| 50| ohos.update | ComponentType | OTA = 1 | Added| 51| ohos.update | BusinessSubType | PARAM = 2 | Added| 52| ohos.update | BusinessSubType | FIRMWARE = 1 | Added| 53| ohos.update | BusinessVendor | PUBLIC = "public" | Added| 54| ohos.update | UpgradeTaskCallback | (eventInfo: EventInfo): void; | Added| 55| ohos.update | UpgradeFile | filePath: string; | Added| 56| ohos.update | UpgradeFile | fileType: ComponentType; | Added| 57| ohos.update | EventClassifyInfo | extraInfo: string; | Added| 58| ohos.update | EventClassifyInfo | eventClassify: EventClassify; | Added| 59| ohos.update | ErrorMessage | errorMessage: string; | Added| 60| ohos.update | ErrorMessage | errorCode: number; | Added| 61| ohos.update | TaskBody | versionComponents: Array\<VersionComponent>; | Added| 62| ohos.update | TaskBody | errorMessages: Array\<ErrorMessage>; | Added| 63| ohos.update | TaskBody | installMode: number; | Added| 64| ohos.update | TaskBody | progress: number; | Added| 65| ohos.update | TaskBody | subStatus: number; | Added| 66| ohos.update | TaskBody | status: UpgradeStatus; | Added| 67| ohos.update | TaskBody | versionDigestInfo: VersionDigestInfo; | Added| 68| ohos.update | EventInfo | taskBody: TaskBody; | Added| 69| ohos.update | EventInfo | eventId: EventId; | Added| 70| ohos.update | TaskInfo | taskBody: TaskBody; | Added| 71| ohos.update | TaskInfo | existTask: boolean; | Added| 72| ohos.update | UpgradePeriod | end: number; | Added| 73| ohos.update | UpgradePeriod | start: number; | Added| 74| ohos.update | UpgradePolicy | autoUpgradePeriods: Array\<UpgradePeriod>; | Added| 75| ohos.update | UpgradePolicy | autoUpgradeStrategy: boolean; | Added| 76| ohos.update | UpgradePolicy | downloadStrategy: boolean; | Added| 77| ohos.update | ClearOptions | status: UpgradeStatus; | Added| 78| ohos.update | UpgradeOptions | order: Order; | Added| 79| ohos.update | PauseDownloadOptions | isAllowAutoResume: boolean; | Added| 80| ohos.update | ResumeDownloadOptions | allowNetwork: NetType; | Added| 81| ohos.update | DownloadOptions | order: Order; | Added| 82| ohos.update | DownloadOptions | allowNetwork: NetType; | Added| 83| ohos.update | CurrentVersionInfo | versionComponents: Array\<VersionComponent>; | Added| 84| ohos.update | CurrentVersionInfo | deviceName: string; | Added| 85| ohos.update | CurrentVersionInfo | osVersion: string; | Added| 86| ohos.update | DescriptionInfo | descriptionType: DescriptionType; | Added| 87| ohos.update | VersionComponent | descriptionInfo: DescriptionInfo; | Added| 88| ohos.update | VersionComponent | effectiveMode: EffectiveMode; | Added| 89| ohos.update | VersionComponent | size: number; | Added| 90| ohos.update | VersionComponent | innerVersion: string; | Added| 91| ohos.update | VersionComponent | displayVersion: string; | Added| 92| ohos.update | VersionComponent | upgradeAction: UpgradeAction; | Added| 93| ohos.update | VersionComponent | componentType: ComponentType; | Added| 94| ohos.update | VersionDigestInfo | versionDigest: string; | Added| 95| ohos.update | NewVersionInfo | versionComponents: Array\<VersionComponent>; | Added| 96| ohos.update | NewVersionInfo | versionDigestInfo: VersionDigestInfo; | Added| 97| ohos.update | CheckResult | newVersionInfo: NewVersionInfo; | Added| 98| ohos.update | CheckResult | isExistNewVersion: boolean; | Added| 99| ohos.update | BusinessType | subType: BusinessSubType; | Added| 100| ohos.update | BusinessType | vendor: BusinessVendor; | Added| 101| ohos.update | UpgradeInfo | businessType: BusinessType; | Added| 102| ohos.update | UpgradeInfo | upgradeApp: string; | Added| 103| ohos.update | LocalUpdater | off(eventClassifyInfo: EventClassifyInfo, taskCallback?: UpgradeTaskCallback): void; | Added| 104| ohos.update | LocalUpdater | on(eventClassifyInfo: EventClassifyInfo, taskCallback: UpgradeTaskCallback): void; | Added| 105| ohos.update | LocalUpdater | applyNewVersion(upgradeFiles: Array\<UpgradeFile>, callback: AsyncCallback\<void>): void;<br>applyNewVersion(upgradeFiles: Array\<UpgradeFile>): Promise\<void>; | Added| 106| ohos.update | LocalUpdater | verifyUpgradePackage(upgradeFile: UpgradeFile, certsFile: string, callback: AsyncCallback\<number>): void;<br>verifyUpgradePackage(upgradeFile: UpgradeFile, certsFile: string): Promise\<number>; | Added| 107| ohos.update | Restorer | factoryReset(callback: AsyncCallback\<void>): void;<br>factoryReset(): Promise\<void>; | Added| 108| ohos.update | Updater | off(eventClassifyInfo: EventClassifyInfo, taskCallback?: UpgradeTaskCallback): void; | Added| 109| ohos.update | Updater | on(eventClassifyInfo: EventClassifyInfo, taskCallback: UpgradeTaskCallback): void; | Added| 110| ohos.update | Updater | terminateUpgrade(callback: AsyncCallback\<void>): void;<br>terminateUpgrade(): Promise\<void>; | Added| 111| ohos.update | Updater | setUpgradePolicy(policy: UpgradePolicy, callback: AsyncCallback\<number>): void;<br>setUpgradePolicy(policy: UpgradePolicy): Promise\<number>; | Added| 112| ohos.update | Updater | getUpgradePolicy(callback: AsyncCallback\<UpgradePolicy>): void;<br>getUpgradePolicy(): Promise\<UpgradePolicy>; | Added| 113| ohos.update | Updater | clearError(versionDigestInfo: VersionDigestInfo, clearOptions: ClearOptions, callback: AsyncCallback\<void>): void;<br>clearError(versionDigestInfo: VersionDigestInfo, clearOptions: ClearOptions): Promise\<void>; | Added| 114| ohos.update | Updater | pauseDownload(versionDigestInfo: VersionDigestInfo, pauseDownloadOptions: PauseDownloadOptions, callback: AsyncCallback\<void>): void;<br>pauseDownload(versionDigestInfo: VersionDigestInfo, pauseDownloadOptions: PauseDownloadOptions): Promise\<void>; | Added| 115| ohos.update | Updater | resumeDownload(versionDigestInfo: VersionDigestInfo, resumeDownloadOptions: ResumeDownloadOptions, callback: AsyncCallback\<void>): void;<br>resumeDownload(versionDigestInfo: VersionDigestInfo, resumeDownloadOptions: ResumeDownloadOptions): Promise\<void>; | Added| 116| ohos.update | Updater | getTaskInfo(callback: AsyncCallback\<TaskInfo>): void;<br>getTaskInfo(): Promise\<TaskInfo>; | Added| 117| ohos.update | Updater | getCurrentVersionInfo(callback: AsyncCallback\<CurrentVersionInfo>): void;<br>getCurrentVersionInfo(): Promise\<CurrentVersionInfo>; | Added| 118| ohos.update | update | getLocalUpdater(): LocalUpdater; | Added| 119| ohos.update | update | getRestorer(): Restorer; | Added| 120| ohos.update | update | getOnlineUpdater(upgradeInfo: UpgradeInfo): Updater; | Added| 121| ohos.update | update | getUpdaterFromOther(upgradeFile: string, device: string, updateType?: UpdateTypes): Updater; | Deleted| 122| ohos.update | update | getUpdaterForOther(upgradeFile: string, device: string, updateType?: UpdateTypes): Updater; | Deleted| 123| ohos.update | update | getUpdater(upgradeFile: string, updateType?: UpdateTypes): Updater; | Deleted| 124| ohos.update | Updater | cancel(): void; | Deleted| 125| ohos.update | Updater | verifyUpdatePackage(upgradeFile: string, certsFile: string): void; | Deleted| 126| ohos.update | Updater | rebootAndCleanUserData(callback: AsyncCallback\<number>): void;<br>rebootAndCleanUserData(): Promise\<number>; | Deleted| 127| ohos.update | Updater | rebootAndCleanCache(callback: AsyncCallback\<number>): void;<br>rebootAndCleanCache(): Promise\<number>; | Deleted| 128| ohos.update | Updater | applyNewVersion(callback: AsyncCallback\<number>): void;<br>applyNewVersion(): Promise\<number>; | Deleted| 129| ohos.update | Updater | setUpdatePolicy(policy: UpdatePolicy, callback: AsyncCallback\<number>): void;<br>setUpdatePolicy(policy: UpdatePolicy): Promise\<number>; | Deleted| 130| ohos.update | Updater | getUpdatePolicy(callback: AsyncCallback\<UpdatePolicy>): void;<br>getUpdatePolicy(): Promise\<UpdatePolicy>; | Deleted| 131| ohos.update | UpdateProgressCallback | (progress: Progress): void; | Deleted| 132| ohos.update | UpdatePolicy | autoUpgradeInterval: Array\<number>; | Deleted| 133| ohos.update | UpdatePolicy | installMode: INSTALL_MODE; | Deleted| 134| ohos.update | UpdatePolicy | autoDownload: boolean; | Deleted| 135| ohos.update | InstallMode | INSTALL_MODE_AUTO | Deleted| 136| ohos.update | InstallMode | INSTALL_MODE_NIGHT | Deleted| 137| ohos.update | InstallMode | INSTALL_MODE_NORMAL | Deleted| 138| ohos.update | Progress | endReason: string; | Deleted| 139| ohos.update | Progress | status: UpdateState; | Deleted| 140| ohos.update | Progress | percent: number; | Deleted| 141| ohos.update | UpdateState | UPDATE_STATE_UPDATE_SUCCESS | Deleted| 142| ohos.update | UpdateState | UPDATE_STATE_UPDATE_FAIL | Deleted| 143| ohos.update | UpdateState | UPDATE_STATE_UPDATE_ON = 90 | Deleted| 144| ohos.update | UpdateState | UPDATE_STATE_INSTALL_SUCCESS | Deleted| 145| ohos.update | UpdateState | UPDATE_STATE_INSTALL_FAIL | Deleted| 146| ohos.update | UpdateState | UPDATE_STATE_INSTALL_ON = 80 | Deleted| 147| ohos.update | UpdateState | UPDATE_STATE_PACKAGE_TRANS_SUCCESS | Deleted| 148| ohos.update | UpdateState | UPDATE_STATE_PACKAGE_TRANS_FAIL | Deleted| 149| ohos.update | UpdateState | UPDATE_STATE_PACKAGE_TRANS_ON = 70 | Deleted| 150| ohos.update | UpdateState | UPDATE_STATE_VERIFY_SUCCESS | Deleted| 151| ohos.update | UpdateState | UPDATE_STATE_VERIFY_FAIL | Deleted| 152| ohos.update | UpdateState | UPDATE_STATE_VERIFY_ON = 30 | Deleted| 153| ohos.update | UpdateState | UPDATE_STATE_DOWNLOAD_SUCCESS | Deleted| 154| ohos.update | UpdateState | UPDATE_STATE_DOWNLOAD_FAIL | Deleted| 155| ohos.update | UpdateState | UPDATE_STATE_DOWNLOAD_CANCEL | Deleted| 156| ohos.update | UpdateState | UPDATE_STATE_DOWNLOAD_PAUSE | Deleted| 157| ohos.update | UpdateState | UPDATE_STATE_DOWNLOAD_ON = 20 | Deleted| 158| ohos.update | UpdateState | UPDATE_STATE_CHECK_VERSION_SUCCESS | Deleted| 159| ohos.update | UpdateState | UPDATE_STATE_CHECK_VERSION_FAIL | Deleted| 160| ohos.update | UpdateState | UPDATE_STATE_CHECK_VERSION_ON = 10 | Deleted| 161| ohos.update | UpdateState | UPDATE_STATE_INIT = 0 | Deleted| 162| ohos.update | NewVersionInfo | descriptionInfo: Array\<DescriptionInfo>; | Deleted| 163| ohos.update | NewVersionInfo | checkResults: Array\<CheckResult>; | Deleted| 164| ohos.update | NewVersionInfo | errMsg: string; | Deleted| 165| ohos.update | NewVersionInfo | status: NewVersionStatus; | Deleted| 166| ohos.update | NewVersionStatus | VERSION_STATUS_BUSY = 2 | Deleted| 167| ohos.update | NewVersionStatus | VERSION_STATUS_NONE = 1 | Deleted| 168| ohos.update | NewVersionStatus | VERSION_STATUS_NEW = 0 | Deleted| 169| ohos.update | NewVersionStatus | VERSION_STATUS_ERR = -1 | Deleted| 170| ohos.update | DescriptionInfo | descriptionId: string; | Deleted| 171| ohos.update | CheckResult | descriptionId: string; | Deleted| 172| ohos.update | CheckResult | packageType: PackageTypes; | Deleted| 173| ohos.update | CheckResult | verifyInfo: string; | Deleted| 174| ohos.update | CheckResult | size: number; | Deleted| 175| ohos.update | CheckResult | versionCode: string; | Deleted| 176| ohos.update | CheckResult | versionName: number; | Deleted| 177| ohos.update | PackageTypes | PACKAGE_TYPE_PATCH = 7 | Deleted| 178| ohos.update | PackageTypes | PACKAGE_TYPE_VERSION = 6 | Deleted| 179| ohos.update | PackageTypes | PACKAGE_TYPE_COTA = 5 | Deleted| 180| ohos.update | PackageTypes | PACKAGE_TYPE_PRELOAD = 4 | Deleted| 181| ohos.update | PackageTypes | PACKAGE_TYPE_CUST = 3 | Deleted| 182| ohos.update | PackageTypes | PACKAGE_TYPE_BASE = 2 | Deleted| 183| ohos.update | PackageTypes | PACKAGE_TYPE_NORMAL = 1 | Deleted| 184