openharmony 鸿蒙 js-apis-update-sys

2025-06-12 浏览 (1)

@ohos.update (Update)

The update module implements update of the entire system, including built-in resources and preset applications, but not third-party applications.

There are two types of updates: SD card update and over the air (OTA) update.

  • The SD card update depends on the update packages and SD cards.

  • The OTA update depends on the server deployed by the device manufacturer for managing update packages. The OTA server IP address is passed by the caller. The request interface is fixed and developed by the device manufacturer.

NOTE

The initial APIs of this module are supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version.

The APIs provided by this module are system APIs.

Modules to Import

import { update } from '@kit.BasicServicesKit';

update.getOnlineUpdater

getOnlineUpdater(upgradeInfo: UpgradeInfo): Updater

Obtains an OnlineUpdater object.

System capability: SystemCapability.Update.UpdateService

Parameters

NameTypeMandatoryDescription
upgradeInfoUpgradeInfoYesOnlineUpdater object information.

Return value

TypeDescription
UpdaterOnlineUpdater object.

Example

try {
      const upgradeInfo: update.UpgradeInfo = {
        upgradeApp: "com.ohos.ota.updateclient",
        businessType: {
          vendor: update.BusinessVendor.PUBLIC,
          subType: update.BusinessSubType.FIRMWARE
        }
      };
      let updater = update.getOnlineUpdater(upgradeInfo);
    } catch(error) {
      console.error(`Fail to get updater error: ${error}`);
    }

update.getRestorer

getRestorer(): Restorer

Obtains a Restorer object for restoring factory settings.

System capability: SystemCapability.Update.UpdateService

Return value

TypeDescription
RestorerRestorer object for restoring factory settings.

Example

try {
  let restorer = update.getRestorer();
} catch(error) {
  console.error(`Fail to get restorer: ${error}`);
}

update.getLocalUpdater

getLocalUpdater(): LocalUpdater

Obtains a LocalUpdater object.

System capability: SystemCapability.Update.UpdateService

Return value

TypeDescription
LocalUpdaterLocalUpdater object.

Example

try {
  let localUpdater = update.getLocalUpdater();
} catch(error) {
  console.error(`Fail to get localUpdater error: ${error}`);
}

Updater

checkNewVersion

checkNewVersion(callback: AsyncCallback<CheckResult>): void

Checks whether a new version is available. This API uses an asynchronous callback to return the result.

System capability: SystemCapability.Update.UpdateService

Required permission: ohos.permission.UPDATE_SYSTEM

Parameters

NameTypeMandatoryDescription
callbackAsyncCallback<CheckResult>YesCallback used to return the result.

Error codes

For details about the error codes, see Update Error Codes.

IDError Message
201Permission denied.
11500104IPC error.

Example

import { BusinessError } from '@kit.BasicServicesKit';

updater.checkNewVersion((err: BusinessError, result: update.CheckResult) => {
      console.log(`checkNewVersion isExistNewVersion  ${result?.isExistNewVersion}`);
    });

checkNewVersion

checkNewVersion(): Promise<CheckResult>

Checks whether a new version is available. This API uses a promise to return the result.

System capability: SystemCapability.Update.UpdateService

Required permission: ohos.permission.UPDATE_SYSTEM

Return value

TypeDescription
Promise<CheckResult>Promise used to return the result.

Error codes

For details about the error codes, see Update Error Codes.

IDError Message
201Permission denied.
11500104IPC error.

Example

import { BusinessError } from '@kit.BasicServicesKit';

updater.checkNewVersion()
      .then((result: update.CheckResult) => {
        console.log(`checkNewVersion isExistNewVersion: ${result.isExistNewVersion}`);
        // Version digest information
        console.log(`checkNewVersion versionDigestInfo: ${result.newVersionInfo.versionDigestInfo.versionDigest}`);
      })
      .catch((err: BusinessError)=>{
        console.error(`checkNewVersion promise error ${JSON.stringify(err)}`);
      });

getNewVersionInfo

getNewVersionInfo(callback: AsyncCallback<NewVersionInfo>): void

Obtains information about the new version. This API uses an asynchronous callback to return the result.

System capability: SystemCapability.Update.UpdateService

Required permission: ohos.permission.UPDATE_SYSTEM

Parameters

NameTypeMandatoryDescription
callbackAsyncCallback<NewVersionInfo>YesCallback used to return the result.

Error codes

For details about the error codes, see Update Error Codes.

IDError Message
201Permission denied.
11500104IPC error.

Example

import { BusinessError } from '@kit.BasicServicesKit';

updater.getNewVersionInfo((err: BusinessError, info: update.NewVersionInfo) => {
      console.log(`info displayVersion = ${info?.versionComponents[0].displayVersion}`);
      console.log(`info innerVersion = ${info?.versionComponents[0].innerVersion}`);
});

getNewVersionInfo

getNewVersionInfo(): Promise<NewVersionInfo>

Obtains information about the new version. This API uses a promise to return the result.

System capability: SystemCapability.Update.UpdateService

Required permission: ohos.permission.UPDATE_SYSTEM

Return value

TypeDescription
Promise<NewVersionInfo>Promise used to return the result.

Error codes

For details about the error codes, see Update Error Codes.

IDError Message
201Permission denied.
11500104IPC error.

Example

import { BusinessError } from '@kit.BasicServicesKit';

updater.getNewVersionInfo().then((info: update.NewVersionInfo) => {
    console.log(`info displayVersion = ${info.versionComponents[0].displayVersion}`);
    console.log(`info innerVersion = ${info.versionComponents[0].innerVersion}`);
}).catch((err: BusinessError) => {
    console.error(`getNewVersionInfo promise error ${JSON.stringify(err)}`);
});

getNewVersionDescription

getNewVersionDescription(versionDigestInfo: VersionDigestInfo, descriptionOptions: DescriptionOptions, callback: AsyncCallback<Array<ComponentDescription>>): void

Obtains the description file of the new version. This API uses an asynchronous callback to return the result.

System capability: SystemCapability.Update.UpdateService

Required permission: ohos.permission.UPDATE_SYSTEM

Parameters

NameTypeMandatoryDescription
versionDigestInfoVersionDigestInfoYesVersion digest information.
descriptionOptionsDescriptionOptionsYesOptions of the description file.
callbackAsyncCallback<Array<ComponentDescription>>YesCallback used to return the result.

Error codes

For details about the error codes, see Update Error Codes.

IDError Message
201Permission denied.
401Parameter verification failed.
11500104IPC error.

Example

import { BusinessError } from '@kit.BasicServicesKit';

// Version digest information
const versionDigestInfo: update.VersionDigestInfo = {
  versionDigest: "versionDigest" // Version digest information in the check result
};

// Options of the description file
const descriptionOptions: update.DescriptionOptions = {
  format: update.DescriptionFormat.STANDARD, // Standard format
  language: "zh-cn" // Chinese
};

updater.getNewVersionDescription(versionDigestInfo, descriptionOptions).then((info: Array<update.ComponentDescription>)=> {
  console.log(`getNewVersionDescription promise info ${JSON.stringify(info)}`);
}).catch((err: BusinessError) => {
  console.error(`getNewVersionDescription promise error ${JSON.stringify(err)}`);
});

getNewVersionDescription

getNewVersionDescription(versionDigestInfo: VersionDigestInfo, descriptionOptions: DescriptionOptions): Promise<Array<ComponentDescription>>

Obtains the description file of the new version. This API uses a promise to return the result.

System capability: SystemCapability.Update.UpdateService

Required permission: ohos.permission.UPDATE_SYSTEM

Parameters

NameTypeMandatoryDescription
versionDigestInfoVersionDigestInfoYesVersion digest information.
descriptionOptionsDescriptionOptionsYesOptions of the description file.

Return value

TypeDescription
Promise<Array<ComponentDescription>>Promise used to return the result.

Error codes

For details about the error codes, see Update Error Codes.

IDError Message
201Permission denied.
401Parameter verification failed.
11500104IPC error.

Example

import { BusinessError } from '@kit.BasicServicesKit';

// Version digest information
const versionDigestInfo: update.VersionDigestInfo = {
  versionDigest: "versionDigest" // Version digest information in the check result
};

// Options of the description file
const descriptionOptions: update.DescriptionOptions = {
  format: update.DescriptionFormat.STANDARD, // Standard format
  language: "zh-cn" // Chinese
};

updater.getNewVersionDescription(versionDigestInfo, descriptionOptions).then((info: Array<update.ComponentDescription>)=> {
  console.log(`getNewVersionDescription promise info ${JSON.stringify(info)}`);
}).catch((err: BusinessError) => {
  console.error(`getNewVersionDescription promise error ${JSON.stringify(err)}`);
});

getCurrentVersionInfo

getCurrentVersionInfo(callback: AsyncCallback<CurrentVersionInfo>): void

Obtains information about the current version. This API uses an asynchronous callback to return the result.

System capability: SystemCapability.Update.UpdateService

Required permission: ohos.permission.UPDATE_SYSTEM

Parameters

NameTypeMandatoryDescription
callbackAsyncCallback<CurrentVersionInfo>YesCallback used to return the result.

Error codes

For details about the error codes, see Update Error Codes.

IDError Message
201Permission denied.
11500104IPC error.

Example

import { BusinessError } from '@kit.BasicServicesKit';

updater.getCurrentVersionInfo((err: BusinessError, info: update.CurrentVersionInfo) => {
  console.log(`info osVersion = ${info?.osVersion}`);
  console.log(`info deviceName = ${info?.deviceName}`);
  console.log(`info displayVersion = ${info?.versionComponents[0].displayVersion}`);
});

getCurrentVersionInfo

getCurrentVersionInfo(): Promise<CurrentVersionInfo>

Obtains information about the current version. This API uses a promise to return the result.

System capability: SystemCapability.Update.UpdateService

Required permission: ohos.permission.UPDATE_SYSTEM

Return value

TypeDescription
Promise<CurrentVersionInfo>Promise used to return the result.

Error codes

For details about the error codes, see Update Error Codes.

IDError Message
201Permission denied.
11500104IPC error.

Example

import { BusinessError } from '@kit.BasicServicesKit';

updater.getCurrentVersionInfo().then((info: update.CurrentVersionInfo) => {
  console.log(`info osVersion = ${info.osVersion}`);
  console.log(`info deviceName = ${info.deviceName}`);
  console.log(`info displayVersion = ${info.versionComponents[0].displayVersion}`);
}).catch((err: BusinessError) => {
  console.error(`getCurrentVersionInfo promise error ${JSON.stringify(err)}`);
});

getCurrentVersionDescription

getCurrentVersionDescription(descriptionOptions: DescriptionOptions, callback: AsyncCallback<Array<ComponentDescription>>): void

Obtains the description file of the current version. This API uses an asynchronous callback to return the result.

System capability: SystemCapability.Update.UpdateService

Required permission: ohos.permission.UPDATE_SYSTEM

Parameters

NameTypeMandatoryDescription
descriptionOptionsDescriptionOptionsYesOptions of the description file.
callbackAsyncCallback<Array<ComponentDescription>>YesCallback used to return the result.

Error codes

For details about the error codes, see Update Error Codes.

IDError Message
201Permission denied.
401Parameter verification failed.
11500104IPC error.

Example

// Options of the description file
const descriptionOptions: update.DescriptionOptions = {
  format: update.DescriptionFormat.STANDARD, // Standard format
  language: "zh-cn" // Chinese
};

updater.getCurrentVersionDescription(descriptionOptions, (err, info) => {
  console.log(`getCurrentVersionDescription info ${JSON.stringify(info)}`);
  console.log(`getCurrentVersionDescription err ${JSON.stringify(err)}`);
});

getCurrentVersionDescription

getCurrentVersionDescription(descriptionOptions: DescriptionOptions): Promise<Array<ComponentDescription>>

Obtains the description file of the current version. This API uses a promise to return the result.

System capability: SystemCapability.Update.UpdateService

Required permission: ohos.permission.UPDATE_SYSTEM

Parameters

NameTypeMandatoryDescription
descriptionOptionsDescriptionOptionsYesOptions of the description file.

Return value

TypeDescription
Promise<Array<ComponentDescription>>Promise used to return the result.

Error codes

For details about the error codes, see Update Error Codes.

IDError Message
201Permission denied.
401Parameter verification failed.
11500104IPC error.

Example

import { BusinessError } from '@kit.BasicServicesKit';
// Options of the description file
const descriptionOptions: update.DescriptionOptions = {
  format: update.DescriptionFormat.STANDARD, // Standard format
  language: "zh-cn" // Chinese
};
updater.getCurrentVersionDescription(descriptionOptions).then((info: Array<update.ComponentDescription>) => {
  console.log(`getCurrentVersionDescription promise info ${JSON.stringify(info)}`);
}).catch((err: BusinessError) => {
  console.error(`getCurrentVersionDescription promise error ${JSON.stringify(err)}`);
});

getTaskInfo

getTaskInfo(callback: AsyncCallback<TaskInfo>): void

Obtains information about the update task. This API uses an asynchronous callback to return the result.

System capability: SystemCapability.Update.UpdateService

Required permission: ohos.permission.UPDATE_SYSTEM

Parameters

NameTypeMandatoryDescription
callbackAsyncCallback<TaskInfo>YesCallback used to return the result.

Error codes

For details about the error codes, see Update Error Codes.

IDError Message
201Permission denied.
11500104IPC error.

Example

import { BusinessError } from '@kit.BasicServicesKit';

updater.getTaskInfo((err: BusinessError, info: update.TaskInfo) => {
  console.log(`getTaskInfo isexistTask= ${info?.existTask}`);
});

getTaskInfo

getTaskInfo(): Promise<TaskInfo>

Obtains information about the update task. This API uses a promise to return the result.

System capability: SystemCapability.Update.UpdateService

Required permission: ohos.permission.UPDATE_SYSTEM

Return value

TypeDescription
Promise<TaskInfo>Promise used to return the result.

Error codes

For details about the error codes, see Update Error Codes.

IDError Message
201Permission denied.
11500104IPC error.

Example

import { BusinessError } from '@kit.BasicServicesKit';

updater.getTaskInfo().then((info: update.TaskInfo) => {
  console.log(`getTaskInfo isexistTask= ${info.existTask}`);
}).catch((err: BusinessError) => {
  console.error(`getTaskInfo promise error ${JSON.stringify(err)}`);
});

download

download(versionDigestInfo: VersionDigestInfo, downloadOptions: DownloadOptions, callback: AsyncCallback<void>): void

Downloads the new version. This API uses an asynchronous callback to return the result.

System capability: SystemCapability.Update.UpdateService

Required permission: ohos.permission.UPDATE_SYSTEM

Parameters

NameTypeMandatoryDescription
versionDigestInfoVersionDigestInfoYesVersion digest information.
downloadOptionsDownloadOptionsYesDownload options.
callbackAsyncCallback<void>YesCallback used to return the result. If the operation is successful, err is undefined; otherwise, err is an Error object.

Error codes

For details about the error codes, see Update Error Codes.

IDError Message
201Permission denied.
401Parameter verification failed.
11500104IPC error.

Example

import { BusinessError } from '@kit.BasicServicesKit';

// Version digest information
const versionDigestInfo: update.VersionDigestInfo = {
  versionDigest: "versionDigest" // Version digest information in the check result
};

// Download options
const downloadOptions: update.DownloadOptions = {
  allowNetwork: update.NetType.CELLULAR, // Whether to allow download over data network
  order: update.Order.DOWNLOAD // Download
};
updater.download(versionDigestInfo, downloadOptions, (err: BusinessError) => {
  console.log(`download error ${JSON.stringify(err)}`);
});

download

download(versionDigestInfo: VersionDigestInfo, downloadOptions: DownloadOptions): Promise<void>

Downloads the new version. This API uses a promise to return the result.

System capability: SystemCapability.Update.UpdateService

Required permission: ohos.permission.UPDATE_SYSTEM

Parameters

NameTypeMandatoryDescription
versionDigestInfoVersionDigestInfoYesVersion digest information.
downloadOptionsDownloadOptionsYesDownload options.

Return value

TypeDescription
Promise<void>Promise that returns no value.

Error codes

For details about the error codes, see Update Error Codes.

IDError Message
201Permission denied.
401Parameter verification failed.
11500104IPC error.

Example

import { BusinessError } from '@kit.BasicServicesKit';

// Version digest information
const versionDigestInfo: update.VersionDigestInfo = {
  versionDigest: "versionDigest" // Version digest information in the check result
};

// Download options
const downloadOptions: update.DownloadOptions = {
  allowNetwork: update.NetType.CELLULAR, // Whether to allow download over data network
   order: update.Order.DOWNLOAD // Download
};
updater.download(versionDigestInfo, downloadOptions).then(() => {
  console.log(`download start`);
}).catch((err: BusinessError) => {
  console.error(`download error ${JSON.stringify(err)}`);
});

resumeDownload

resumeDownload(versionDigestInfo: VersionDigestInfo, resumeDownloadOptions: ResumeDownloadOptions, callback: AsyncCallback<void>): void

Resumes download of the new version. This API uses an asynchronous callback to return the result.

System capability: SystemCapability.Update.UpdateService

Required permission: ohos.permission.UPDATE_SYSTEM

Parameters

NameTypeMandatoryDescription
versionDigestInfoVersionDigestInfoYesVersion digest information.
resumeDownloadOptionsResumeDownloadOptionsYesOptions for resuming download.
callbackAsyncCallback<void>YesCallback used to return the result. If the operation is successful, err is undefined; otherwise, err is an Error object.

Error codes

For details about the error codes, see Update Error Codes.

IDError Message
201Permission denied.
401Parameter verification failed.
11500104IPC error.

Example

import { BusinessError } from '@kit.BasicServicesKit';

// Version digest information
const versionDigestInfo : update.VersionDigestInfo= {
  versionDigest: "versionDigest" // Version digest information in the check result
};

// Options for resuming download
const resumeDownloadOptions : update.ResumeDownloadOptions= {
  allowNetwork: update.NetType.CELLULAR, // Whether to allow download over data network
};
updater.resumeDownload(versionDigestInfo, resumeDownloadOptions, (err: BusinessError) => {
  console.log(`resumeDownload error ${JSON.stringify(err)}`);
});

resumeDownload

resumeDownload(versionDigestInfo: VersionDigestInfo, resumeDownloadOptions: ResumeDownloadOptions): Promise<void>

Resumes download of the new version. This API uses a promise to return the result.

System capability: SystemCapability.Update.UpdateService

Required permission: ohos.permission.UPDATE_SYSTEM

Parameters

NameTypeMandatoryDescription
versionDigestInfoVersionDigestInfoYesVersion digest information.
resumeDownloadOptionsResumeDownloadOptionsYesOptions for resuming download.

Return value

TypeDescription
Promise<void>Promise that returns no value.

Error codes

For details about the error codes, see Update Error Codes.

IDError Message
201Permission denied.
401Parameter verification failed.
11500104IPC error.

Example

import { BusinessError } from '@kit.BasicServicesKit';

// Version digest information
const versionDigestInfo: update.VersionDigestInfo = {
  versionDigest: "versionDigest" // Version digest information in the check result
};

// Options for resuming download
const resumeDownloadOptions: update.ResumeDownloadOptions = {
  allowNetwork: update.NetType.CELLULAR, // Whether to allow download over data network
};
updater.resumeDownload(versionDigestInfo, resumeDownloadOptions).then(() => {
  console.log(`resumeDownload start`);
}).catch((err: BusinessError) => {
  console.error(`resumeDownload error ${JSON.stringify(err)}`);
});

pauseDownload

pauseDownload(versionDigestInfo: VersionDigestInfo, pauseDownloadOptions: PauseDownloadOptions, callback: AsyncCallback<void>): void

Pauses download of the new version. This API uses an asynchronous callback to return the result.

System capability: SystemCapability.Update.UpdateService

Required permission: ohos.permission.UPDATE_SYSTEM

Parameters

NameTypeMandatoryDescription
versionDigestInfoVersionDigestInfoYesVersion digest information.
pauseDownloadOptionsPauseDownloadOptionsYesOptions for pausing download.
callbackAsyncCallback<void>YesCallback used to return the result. If the operation is successful, err is undefined; otherwise, err is an Error object.

Error codes

For details about the error codes, see Update Error Codes.

IDError Message
201Permission denied.
401Parameter verification failed.
11500104IPC error.

Example

import { BusinessError } from '@kit.BasicServicesKit';

// Version digest information
const versionDigestInfo: update.VersionDigestInfo = {
  versionDigest: "versionDigest" // Version digest information in the check result
};

// Options for pausing download
const pauseDownloadOptions: update.PauseDownloadOptions = {
  isAllowAutoResume: true // Whether to allow automatic resuming of download
};
updater.pauseDownload(versionDigestInfo, pauseDownloadOptions, (err: BusinessError) => {
  console.log(`pauseDownload error ${JSON.stringify(err)}`);
});

pauseDownload

pauseDownload(versionDigestInfo: VersionDigestInfo, pauseDownloadOptions: PauseDownloadOptions): Promise<void>

Resumes download of the new version. This API uses a promise to return the result.

System capability: SystemCapability.Update.UpdateService

Required permission: ohos.permission.UPDATE_SYSTEM

Parameters

NameTypeMandatoryDescription
versionDigestInfoVersionDigestInfoYesVersion digest information.
pauseDownloadOptionsPauseDownloadOptionsYesOptions for pausing download.

Return value

TypeDescription
Promise<void>Promise that returns no value.

Error codes

For details about the error codes, see Update Error Codes.

IDError Message
201Permission denied.
401Parameter verification failed.
11500104IPC error.

Example

import { BusinessError } from '@kit.BasicServicesKit';

// Version digest information
const versionDigestInfo: update.VersionDigestInfo = {
  versionDigest: "versionDigest" // Version digest information in the check result
};

// Options for pausing download
const pauseDownloadOptions: update.PauseDownloadOptions = {
  isAllowAutoResume: true // Whether to allow automatic resuming of download
};
updater.pauseDownload(versionDigestInfo, pauseDownloadOptions).then(() => {
  console.log(`pauseDownload`);
}).catch((err: BusinessError)  => {
  console.error(`pauseDownload error ${JSON.stringify(err)}`);
});

upgrade

upgrade(versionDigestInfo: VersionDigestInfo, upgradeOptions: UpgradeOptions, callback: AsyncCallback<void>): void

Updates the version. This API uses an asynchronous callback to return the result.

System capability: SystemCapability.Update.UpdateService

Required permission: ohos.permission.UPDATE_SYSTEM

Parameters

NameTypeMandatoryDescription
versionDigestInfoVersionDigestInfoYesVersion digest information.
upgradeOptionsUpgradeOptionsYesUpdate options.
callbackAsyncCallback<void>YesCallback used to return the result. If the operation is successful, err is undefined; otherwise, err is an Error object.

Error codes

For details about the error codes, see Update Error Codes.

IDError Message
201Permission denied.
401Parameter verification failed.
11500104IPC error.

Example

import { BusinessError } from '@kit.BasicServicesKit';

// Version digest information
const versionDigestInfo: update.VersionDigestInfo = {
  versionDigest: "versionDigest" // Version digest information in the check result
};

// Installation options
const upgradeOptions: update.UpgradeOptions = {
  order: update.Order.INSTALL // Installation command
};
updater.upgrade(versionDigestInfo, upgradeOptions, (err: BusinessError) => {
  console.log(`upgrade error ${JSON.stringify(err)}`);
});

upgrade

upgrade(versionDigestInfo: VersionDigestInfo, upgradeOptions: UpgradeOptions): Promise<void>

Updates the version. This API uses a promise to return the result.

System capability: SystemCapability.Update.UpdateService

Required permission: ohos.permission.UPDATE_SYSTEM

Parameters

NameTypeMandatoryDescription
versionDigestInfoVersionDigestInfoYesVersion digest information.
upgradeOptionsUpgradeOptionsYesUpdate options.

Return value

TypeDescription
Promise<void>Promise that returns no value.

Error codes

For details about the error codes, see Update Error Codes.

IDError Message
201Permission denied.
401Parameter verification failed.
11500104IPC error.

Example

import { BusinessError } from '@kit.BasicServicesKit';

// Version digest information
const versionDigestInfo: update.VersionDigestInfo = {
  versionDigest: "versionDigest" // Version digest information in the check result
};

// Installation options
const upgradeOptions: update.UpgradeOptions = {
  order: update.Order.INSTALL // Installation command
};
updater.upgrade(versionDigestInfo, upgradeOptions).then(() => {
  console.log(`upgrade start`);
}).catch((err: BusinessError) => {
  console.error(`upgrade error ${JSON.stringify(err)}`);
});

clearError

clearError(versionDigestInfo: VersionDigestInfo, clearOptions: ClearOptions, callback: AsyncCallback<void>): void

Clears errors. This API uses an asynchronous callback to return the result.

System capability: SystemCapability.Update.UpdateService

Required permission: ohos.permission.UPDATE_SYSTEM

Parameters

NameTypeMandatoryDescription
versionDigestInfoVersionDigestInfoYesVersion digest information.
clearOptionsClearOptionsYesClear options.
callbackAsyncCallback<void>YesCallback used to return the result. If the operation is successful, err is undefined; otherwise, err is an Error object.

Error codes

For details about the error codes, see Update Error Codes.

IDError Message
201Permission denied.
401Parameter verification failed.
11500104IPC error.

Example

import { BusinessError } from '@kit.BasicServicesKit';

// Version digest information
const versionDigestInfo: update.VersionDigestInfo = {
  versionDigest: "versionDigest" // Version digest information in the check result
};

// Options for clearing errors
const clearOptions: update.ClearOptions = {
  status: update.UpgradeStatus.UPGRADE_FAIL,
};
updater.clearError(versionDigestInfo, clearOptions, (err: BusinessError) => {
  console.log(`clearError error ${JSON.stringify(err)}`);
});

clearError

clearError(versionDigestInfo: VersionDigestInfo, clearOptions: ClearOptions): Promise<void>

Clears errors. This API uses a promise to return the result.

System capability: SystemCapability.Update.UpdateService

Required permission: ohos.permission.UPDATE_SYSTEM

Parameters

NameTypeMandatoryDescription
versionDigestInfoVersionDigestInfoYesVersion digest information.
clearOptionsClearOptionsYesUpdate options.

Return value

TypeDescription
Promise<void>Promise that returns no value.

Error codes

For details about the error codes, see Update Error Codes.

IDError Message
201Permission denied.
401Parameter verification failed.
11500104IPC error.

Example

import { BusinessError } from '@kit.BasicServicesKit';

// Version digest information
const versionDigestInfo: update.VersionDigestInfo = {
  versionDigest: "versionDigest" // Version digest information in the check result
};

// Options for clearing errors
const clearOptions: update.ClearOptions = {
  status: update.UpgradeStatus.UPGRADE_FAIL,
};
updater.clearError(versionDigestInfo, clearOptions).then(() => {
  console.log(`clearError success`);
}).catch((err: BusinessError) => {
  console.error(`clearError error ${JSON.stringify(err)}`);
});

getUpgradePolicy

getUpgradePolicy(callback: AsyncCallback<UpgradePolicy>): void

Obtains the update policy. This API uses an asynchronous callback to return the result.

System capability: SystemCapability.Update.UpdateService

Required permission: ohos.permission.UPDATE_SYSTEM

Parameters

NameTypeMandatoryDescription
callbackAsyncCallback<UpgradePolicy>YesCallback used to return the result.

Error codes

For details about the error codes, see Update Error Codes.

IDError Message
201Permission denied.
11500104IPC error.

Example

import { BusinessError } from '@kit.BasicServicesKit';

updater.getUpgradePolicy(err: BusinessError, policy: update.UpgradePolicy) => {
  console.log(`policy downloadStrategy = ${policy?.downloadStrategy}`);
  console.log(`policy autoUpgradeStrategy = ${policy?.autoUpgradeStrategy}`);
});

getUpgradePolicy

getUpgradePolicy(): Promise<UpgradePolicy>

Obtains the update policy. This API uses a promise to return the result.

System capability: SystemCapability.Update.UpdateService

Required permission: ohos.permission.UPDATE_SYSTEM

Return value

TypeDescription
Promise<UpgradePolicy>Promise used to return the result.

Error codes

For details about the error codes, see Update Error Codes.

IDError Message
201Permission denied.
11500104IPC error.

Example

import { BusinessError } from '@kit.BasicServicesKit';

updater.getUpgradePolicy().then((policy: update.UpgradePolicy) => {
  console.log(`policy downloadStrategy = ${policy.downloadStrategy}`);
  console.log(`policy autoUpgradeStrategy = ${policy.autoUpgradeStrategy}`);
}).catch((err: BusinessError)  => {
  console.error(`getUpgradePolicy promise error ${JSON.stringify(err)}`);
});

setUpgradePolicy

setUpgradePolicy(policy: UpgradePolicy, callback: AsyncCallback<void>): void

Sets the update policy. This API uses an asynchronous callback to return the result.

System capability: SystemCapability.Update.UpdateService

Required permission: ohos.permission.UPDATE_SYSTEM

Parameters

NameTypeMandatoryDescription
policyUpgradePolicyYesUpdate policy.
callbackAsyncCallback<void>YesCallback used to return the result.

Error codes

For details about the error codes, see Update Error Codes.

IDError Message
201Permission denied.
11500104IPC error.

Example

import { BusinessError } from '@kit.BasicServicesKit';

const policy: update.UpgradePolicy = {
  downloadStrategy: false,
  autoUpgradeStrategy: false,
  autoUpgradePeriods: [ { start: 120, end: 240 }] // Automatic update period, in minutes
};
updater.setUpgradePolicy(policy, (err: BusinessError) => {
  console.log(`setUpgradePolicy result: ${err}`);
});

setUpgradePolicy

setUpgradePolicy(policy: UpgradePolicy): Promise<void>

Sets the update policy. This API uses a promise to return the result.

System capability: SystemCapability.Update.UpdateService

Required permission: ohos.permission.UPDATE_SYSTEM

Parameters

NameTypeMandatoryDescription
policyUpgradePolicyYesUpdate policy.

Return value

TypeDescription
Promise<void>Promise that returns no value.

Error codes

For details about the error codes, see Update Error Codes.

IDError Message
201Permission denied.
11500104IPC error.

Example

import { BusinessError } from '@kit.BasicServicesKit';

const policy: update.UpgradePolicy = {
  downloadStrategy: false,
  autoUpgradeStrategy: false,
  autoUpgradePeriods: [ { start: 120, end: 240 }] // Automatic update period, in minutes
};
updater.setUpgradePolicy(policy).then(() => {
  console.log(`setUpgradePolicy success`);
}).catch((err: BusinessError) => {
  console.error(`setUpgradePolicy promise error ${JSON.stringify(err)}`);
});

terminateUpgrade

terminateUpgrade(callback: AsyncCallback<void>): void

Terminates the update. This API uses an asynchronous callback to return the result.

System capability: SystemCapability.Update.UpdateService

Required permission: ohos.permission.UPDATE_SYSTEM

Parameters

NameTypeMandatoryDescription
callbackAsyncCallback<void>YesCallback used to return the result. If the operation is successful, err is undefined; otherwise, err is an Error object.

Error codes

For details about the error codes, see Update Error Codes.

IDError Message
201Permission denied.
11500104IPC error.

Example

import { BusinessError } from '@kit.BasicServicesKit';

updater.terminateUpgrade((err: BusinessError) => {
  console.log(`terminateUpgrade error ${JSON.stringify(err)}`);
});

terminateUpgrade

terminateUpgrade(): Promise<void>

Terminates the update. This API uses a promise to return the result.

System capability: SystemCapability.Update.UpdateService

Required permission: ohos.permission.UPDATE_SYSTEM

Return value

TypeDescription
Promise<void>Promise that returns no value.

Error codes

For details about the error codes, see Update Error Codes.

IDError Message
201Permission denied.
11500104IPC error.

Example

import { BusinessError } from '@kit.BasicServicesKit';

updater.terminateUpgrade().then(() => {
  console.log(`terminateUpgrade success`);
}).catch((err: BusinessError) => {
  console.error(`terminateUpgrade error ${JSON.stringify(err)}`);
});

on

on(eventClassifyInfo: EventClassifyInfo, taskCallback: UpgradeTaskCallback): void

Enables listening for update events. This API uses an asynchronous callback to return the result.

System capability: SystemCapability.Update.UpdateService

Parameters

NameTypeMandatoryDescription
eventClassifyInfoEventClassifyInfoYesEvent information.
taskCallbackUpgradeTaskCallbackYesEvent callback.

Example

const eventClassifyInfo: update.EventClassifyInfo = {
  eventClassify: update.EventClassify.TASK, // Listening for update events
  extraInfo: ""
};

updater.on(eventClassifyInfo, (eventInfo: update.EventInfo) => {
  console.log("updater on " + JSON.stringify(eventInfo));
});

off

off(eventClassifyInfo: EventClassifyInfo, taskCallback?: UpgradeTaskCallback): void

Disables listening for update events. This API uses an asynchronous callback to return the result.

System capability: SystemCapability.Update.UpdateService

Parameters

NameTypeMandatoryDescription
eventClassifyInfoEventClassifyInfoYesEvent information.
taskCallbackUpgradeTaskCallbackNoEvent callback.

Example

const eventClassifyInfo: update.EventClassifyInfo = {
  eventClassify: update.EventClassify.TASK, // Listening for update events
  extraInfo: ""
};

updater.off(eventClassifyInfo, (eventInfo: update.EventInfo) => {
  console.log("updater off " + JSON.stringify(eventInfo));
});

Restorer

factoryReset

factoryReset(callback: AsyncCallback<void>): void

Restores the scale to its factory settings. This API uses an asynchronous callback to return the result.

System capability: SystemCapability.Update.UpdateService

Required permission: ohos.permission.FACTORY_RESET

Parameters

NameTypeMandatoryDescription
callbackAsyncCallback<void>YesCallback used to return the result. If the operation fails, err is an error object and a callback is returned. If the operation is successful, err is undefined and no callback is returned.

Error codes

For details about the error codes, see Update Error Codes.

IDError Message
201Permission denied.
11500104IPC error.

Example

restorer.factoryReset((err) => {
  console.log(`factoryReset error ${JSON.stringify(err)}`);
});

factoryReset

factoryReset(): Promise<void>

Restores the scale to its factory settings. This API uses a promise to return the result.

System capability: SystemCapability.Update.UpdateService

Required permission: ohos.permission.FACTORY_RESET

Return value

TypeDescription
Promise<void>Promise that returns no value. If the operation fails, a callback is returned. If the operation is successful, no callback is returned.

Error codes

For details about the error codes, see Update Error Codes.

IDError Message
201Permission denied.
11500104IPC error.

Example

import { BusinessError } from '@kit.BasicServicesKit';

restorer.factoryReset().then(() => {
  console.log(`factoryReset success`);
}).catch((err: BusinessError) => {
  console.error(`factoryReset error ${JSON.stringify(err)}`);
});

LocalUpdater

verifyUpgradePackage

verifyUpgradePackage(upgradeFile: UpgradeFile, certsFile: string, callback: AsyncCallback<void>): void

Verifies the update package. This API uses an asynchronous callback to return the result.

System capability: SystemCapability.Update.UpdateService

Required permission: ohos.permission.UPDATE_SYSTEM

Parameters

NameTypeMandatoryDescription
upgradeFileUpgradeFileYesUpdate file.
certsFilestringYesPath of the certificate file.
callbackAsyncCallback<void>YesCallback used to return the result.

Error codes

For details about the error codes, see Update Error Codes.

IDError Message
201Permission denied.
401Parameter verification failed.
11500104IPC error.

Example

const upgradeFile: update.UpgradeFile = {
  fileType: update.ComponentType.OTA, // OTA package
  filePath: "path" // Path of the local update package
};

localUpdater.verifyUpgradePackage(upgradeFile, "cerstFilePath", (err) => {
  console.log(`factoryReset error ${JSON.stringify(err)}`);
});

verifyUpgradePackage

verifyUpgradePackage(upgradeFile: UpgradeFile, certsFile: string): Promise<void>

Verifies the update package. This API uses a promise to return the result.

System capability: SystemCapability.Update.UpdateService

Required permission: ohos.permission.UPDATE_SYSTEM

Parameters

NameTypeMandatoryDescription
upgradeFileUpgradeFileYesUpdate file.
certsFilestringYesPath of the certificate file.

Return value

TypeDescription
Promise<void>Promise used to return the result.

Error codes

For details about the error codes, see Update Error Codes.

IDError Message
201Permission denied.
401Parameter verification failed.
11500104IPC error.

Example

import { BusinessError } from '@kit.BasicServicesKit';

const upgradeFile: update.UpgradeFile = {
  fileType: update.ComponentType.OTA, // OTA package
  filePath: "path" // Path of the local update package
};
localUpdater.verifyUpgradePackage(upgradeFile, "cerstFilePath").then(() => {
  console.log(`verifyUpgradePackage success`);
}).catch((err: BusinessError) => {
  console.error(`verifyUpgradePackage error ${JSON.stringify(err)}`);
});

applyNewVersion

applyNewVersion(upgradeFiles: Array<UpgradeFile>, callback: AsyncCallback<void>): void

Installs the update package. This API uses an asynchronous callback to return the result.

System capability: SystemCapability.Update.UpdateService

Required permission: ohos.permission.UPDATE_SYSTEM

Parameters

NameTypeMandatoryDescription
upgradeFileArray<UpgradeFile>YesUpdate file.
callbackAsyncCallback<void>YesCallback used to return the result. If the operation is successful, err is undefined; otherwise, err is an Error object.

Error codes

For details about the error codes, see Update Error Codes.

IDError Message
201Permission denied.
401Parameter verification failed.
11500104IPC error.

Example

const upgradeFiles: Array<update.UpgradeFile> = [{
  fileType: update.ComponentType.OTA, // OTA package
  filePath: "path" // Path of the local update package
}];

localUpdater.applyNewVersion(upgradeFiles, (err) => {
  console.log(`applyNewVersion error ${JSON.stringify(err)}`);
});

applyNewVersion

applyNewVersion(upgradeFiles: Array<UpgradeFile>): Promise<void>

Installs the update package. This API uses a promise to return the result.

System capability: SystemCapability.Update.UpdateService

Required permission: ohos.permission.UPDATE_SYSTEM

Return value

TypeDescription
Promise<void>Promise that returns no value.

Error codes

For details about the error codes, see Update Error Codes.

IDError Message
201Permission denied.
401Parameter verification failed.
11500104IPC error.

Example

import { BusinessError } from '@kit.BasicServicesKit';

const upgradeFiles: Array<update.UpgradeFile> = [{
  fileType: update.ComponentType.OTA, // OTA package
  filePath: "path" // Path of the local update package
}];
localUpdater.applyNewVersion(upgradeFiles).then(() => {
  console.log(`applyNewVersion success`);
}).catch((err: BusinessError) => {
  console.error(`applyNewVersion error ${JSON.stringify(err)}`);
});

on

on(eventClassifyInfo: EventClassifyInfo, taskCallback: UpgradeTaskCallback): void

Enables listening for update events. This API uses an asynchronous callback to return the result.

System capability: SystemCapability.Update.UpdateService

Parameters

NameTypeMandatoryDescription
eventClassifyInfoEventClassifyInfoYesEvent information.
taskCallbackUpgradeTaskCallbackYesEvent callback.

Example

const eventClassifyInfo: update.EventClassifyInfo = {
  eventClassify: update.EventClassify.TASK, // Listening for update events
  extraInfo: ""
};

let onTaskUpdate: update.UpgradeTaskCallback = (eventInfo: update.EventInfo) => {
  console.log(`on eventInfo id `, eventInfo.eventId);
};

localUpdater.on(eventClassifyInfo, onTaskUpdate);

off

off(eventClassifyInfo: EventClassifyInfo, taskCallback?: UpgradeTaskCallback): void

Disables listening for update events. This API uses an asynchronous callback to return the result.

System capability: SystemCapability.Update.UpdateService

Parameters

NameTypeMandatoryDescription
eventClassifyInfoEventClassifyInfoYesEvent information.
taskCallbackUpgradeTaskCallbackNoEvent callback.

Example

const eventClassifyInfo: update.EventClassifyInfo = {
  eventClassify: update.EventClassify.TASK, // Listening for update events
  extraInfo: ""
};

let onTaskUpdate: update.UpgradeTaskCallback = (eventInfo: update.EventInfo) => {
  console.log(`on eventInfo id `, eventInfo.eventId);
};

localUpdater.off(eventClassifyInfo, onTaskUpdate);

UpgradeInfo

Represents update information.

System capability: SystemCapability.Update.UpdateService

NameTypeMandatoryDescription
upgradeAppstringYesApplication package name.
businessTypeBusinessTypeYesUpdate service type.

BusinessType

Enumerates update service types.

System capability: SystemCapability.Update.UpdateService

NameTypeMandatoryDescription
vendorBusinessVendorYesSupplier or vendor.
subTypeBusinessSubTypeYesRepresents an update type.

CheckResult

Represents the package check result.

System capability: SystemCapability.Update.UpdateService

NameTypeMandatoryDescription
isExistNewVersionbooleanYesWhether a new version is available.
The value true indicates that a new version is available, and the value false indicates the opposite.
newVersionInfoNewVersionInfoNoInformation about the new version.

NewVersionInfo

Represents information about the new version.

System capability: SystemCapability.Update.UpdateService

NameTypeMandatoryDescription
versionDigestInfoVersionDigestInfoYesVersion digest information.
versionComponentsArray<VersionComponent>YesVersion components.

VersionDigestInfo

Represents version digest information.

System capability: SystemCapability.Update.UpdateService

NameTypeMandatoryDescription
versionDigeststringYesVersion digest information.

VersionComponent

Represents a version component.

System capability: SystemCapability.Update.UpdateService

NameTypeMandatoryDescription
componentIdstringYesComponent ID.
componentTypeComponentTypeYesComponent type.
upgradeActionUpgradeActionYesUpdate mode.
displayVersionstringYesDisplay version number.
innerVersionstringYesInternal version number.
sizenumberYesSize of the update package, in bytes.
effectiveModeEffectiveModeYesEffective mode.
descriptionInfoDescriptionInfoYesInformation about the version description file.

DescriptionOptions

Represents options of the description file.

System capability: SystemCapability.Update.UpdateService

NameTypeMandatoryDescription
formatDescriptionFormatYesFormat of the description file.
languagestringYesLanguage of the description file.

ComponentDescription

Represents a component description file.

System capability: SystemCapability.Update.UpdateService

NameTypeMandatoryDescription
componentIdstringYesComponent ID.
descriptionInfoDescriptionInfoYesInformation about the description file.

DescriptionInfo

Represents information about the version description file.

System capability: SystemCapability.Update.UpdateService

NameTypeMandatoryDescription
descriptionTypeDescriptionTypeYesType of the description file.
contentstringYesContent of the description file.

CurrentVersionInfo

Represents information about the current version.

System capability: SystemCapability.Update.UpdateService

NameTypeMandatoryDescription
osVersionstringYesSystem version number.
deviceNamestringYesDevice name.
versionComponentsArray<VersionComponent>NoVersion components.

DownloadOptions

Represents download options.

System capability: SystemCapability.Update.UpdateService

NameTypeMandatoryDescription
allowNetworkNetTypeYesNetwork type.
orderOrderYesUpdate command.

ResumeDownloadOptions

Represents options for resuming download.

System capability: SystemCapability.Update.UpdateService

NameTypeMandatoryDescription
allowNetworkNetTypeYesNetwork type.

PauseDownloadOptions

Represents options for pausing download.

System capability: SystemCapability.Update.UpdateService

NameTypeMandatoryDescription
isAllowAutoResumebooleanYesWhether to allow automatic resuming of download.
The value true indicates that automatic resuming is allowed, and the value false indicates the opposite.

UpgradeOptions

Represents update options.

System capability: SystemCapability.Update.UpdateService

NameTypeMandatoryDescription
orderOrderYesUpdate command.

ClearOptions

Represents options for clearing errors.

System capability: SystemCapability.Update.UpdateService

NameTypeMandatoryDescription
statusUpgradeStatusYesError status.

UpgradePolicy

Represents an update policy.

System capability: SystemCapability.Update.UpdateService

NameTypeMandatoryDescription
downloadStrategybooleanYesAutomatic download policy.
The value true indicates that automatic download is supported, and the value false indicates the opposite.
autoUpgradeStrategybooleanYesAutomatic update policy.
The value true indicates that automatic update is supported, and the value false indicates the opposite.
autoUpgradePeriodsArray<UpgradePeriod>YesAutomatic update period.

UpgradePeriod

Represents an automatic update period.

System capability: SystemCapability.Update.UpdateService

NameTypeMandatoryDescription
startnumberYesStart time.
endnumberYesEnd time.

TaskInfo

Task information.

System capability: SystemCapability.Update.UpdateService

NameTypeMandatoryDescription
existTaskbooleanYesWhether a task exists.
The value true indicates that the task exists, and the value false indicates the opposite.
taskBodyTaskBodyYesTask data.

EventInfo

Represents event information.

System capability: SystemCapability.Update.UpdateService

NameTypeMandatoryDescription
eventIdEventIdYesEvent ID.
taskBodyTaskBodyYesTask data.

TaskBody

Represents task data.

System capability: SystemCapability.Update.UpdateService

NameTypeMandatoryDescription
versionDigestInfoVersionDigestInfoYesVersion digest information.
statusUpgradeStatusYesUpdate status.
subStatusnumberNoSub-status.
progressnumberYesProgress.
installModenumberYesInstallation mode.
errorMessagesArray<ErrorMessage>NoError message.
versionComponentsArray<VersionComponent>YesVersion components.

ErrorMessage

Represents an error message.

System capability: SystemCapability.Update.UpdateService

NameTypeMandatoryDescription
errorCodenumberYesError code.
errorMessagestringYesError message.

EventClassifyInfo

Represents event type information.

System capability: SystemCapability.Update.UpdateService

NameTypeMandatoryDescription
eventClassifyEventClassifyYesEvent type.
extraInfostringYesAdditional information.

UpgradeFile

Represents an update file.

System capability: SystemCapability.Update.UpdateService

NameTypeMandatoryDescription
fileTypeComponentTypeYesFile type.
filePathstringYesFile path.

UpgradeTaskCallback

(eventInfo: EventInfo): void

Represents an event callback.

System capability: SystemCapability.Update.UpdateService

NameTypeMandatoryDescription
eventInfoEventInfoYesEvent information.

BusinessVendor

Represents a device vendor.

System capability: SystemCapability.Update.UpdateService

NameValueDescription
PUBLIC"public"Open source.

BusinessSubType

Represents an update type.

System capability: SystemCapability.Update.UpdateService

NameValueDescription
FIRMWARE1Firmware.

ComponentType

Represents a component type.

System capability: SystemCapability.Update.UpdateService

NameValueDescription
OTA1Firmware.

UpgradeAction

Represents an update mode.

System capability: SystemCapability.Update.UpdateService

NameValueDescription
UPGRADE"upgrade"Differential package.
RECOVERY"recovery"Recovery package.

EffectiveMode

Represents an effective mode.

System capability: SystemCapability.Update.UpdateService

NameValueDescription
COLD1Cold update.
LIVE2Live update.
LIVE_AND_COLD3Hybrid live and cold update.

DescriptionType

Represents a description file type.

System capability: SystemCapability.Update.UpdateService

NameValueDescription
CONTENT0Content.
URI1Link.

DescriptionFormat

Represents a description file format.

System capability: SystemCapability.Update.UpdateService

NameValueDescription
STANDARD0Standard format.
SIMPLIFIED1Simple format.

NetType

Represents a network type.

System capability: SystemCapability.Update.UpdateService

NameValueDescription
CELLULAR1Data network.
METERED_WIFI2Wi-Fi hotspot.
NOT_METERED_WIFI4Non Wi-Fi hotspot.
WIFI6Wi-Fi.
CELLULAR_AND_WIFI7Data network and Wi-Fi.

Order

Represents an update command.

System capability: SystemCapability.Update.UpdateService

NameValueDescription
DOWNLOAD1Download.
INSTALL2Install.
DOWNLOAD_AND_INSTALL3Download and install.
APPLY4Apply.
INSTALL_AND_APPLY6Install and apply.

UpgradeStatus

Enumerates update states.

System capability: SystemCapability.Update.UpdateService

NameValueDescription
WAITING_DOWNLOAD20Waiting for download.
DOWNLOADING21Downloading.
DOWNLOAD_PAUSED22Download paused.
DOWNLOAD_FAIL23Download failed.
WAITING_INSTALL30Waiting for installation.
UPDATING31Updating.
WAITING_APPLY40Waiting for applying the update.
APPLYING41Applying the update.
UPGRADE_SUCCESS50Update succeeded.
UPGRADE_FAIL51Update failed.

EventClassify

Represents an event type.

System capability: SystemCapability.Update.UpdateService

NameValueDescription
TASK0x01000000Task event.

EventId

Enumerates event IDs.

System capability: SystemCapability.Update.UpdateService

NameValueDescription
EVENT_TASK_BASEEventClassify.TASKTask event.
EVENT_TASK_RECEIVE0x01000001Task received.
EVENT_TASK_CANCEL0x01000002Task cancelled.
EVENT_DOWNLOAD_WAIT0x01000003Waiting for download.
EVENT_DOWNLOAD_START0x01000004Download started.
EVENT_DOWNLOAD_UPDATE0x01000005Download progress update.
EVENT_DOWNLOAD_PAUSE0x01000006Download paused.
EVENT_DOWNLOAD_RESUME0x01000007Download resumed.
EVENT_DOWNLOAD_SUCCESS0x01000008Download succeeded.
EVENT_DOWNLOAD_FAIL0x01000009Download failed.
EVENT_UPGRADE_WAIT0x0100000AWaiting for update.
EVENT_UPGRADE_START0x0100000BUpdate started.
EVENT_UPGRADE_UPDATE0x0100000CUpdate in progress.
EVENT_APPLY_WAIT0x0100000DWaiting for applying the update.
EVENT_APPLY_START0x0100000EApplying the update.
EVENT_UPGRADE_SUCCESS0x0100000FUpdate succeeded.
EVENT_UPGRADE_FAIL0x01000010Update failed.

你可能感兴趣的鸿蒙文章

harmony 鸿蒙Basic Services Kit

harmony 鸿蒙DeviceInfo

harmony 鸿蒙InitSync

harmony 鸿蒙OH_Print

harmony 鸿蒙OsAccount

harmony 鸿蒙Pasteboard

harmony 鸿蒙Print_Margin

harmony 鸿蒙Print_PageSize

harmony 鸿蒙Print_PrintAttributes

harmony 鸿蒙Print_PrintDocCallback

  • 所属分类: 后端技术
  • 本文标签: 鸿蒙 软件
  • 版权声明: 本文链接 https://seaxiang.com/blog/AKrFxl