• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (c) 2025 Huawei Device Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 *     http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16package OHOS.UpdateService;
17
18import callback/IUpdateCallback;
19
20sequenceable OHOS.UpdateService.BusinessError;
21sequenceable OHOS.UpdateService.CheckResult;
22sequenceable OHOS.UpdateService.ClearOptions;
23sequenceable OHOS.UpdateService.CurrentVersionInfo;
24sequenceable OHOS.UpdateService.DescriptionOptions;
25sequenceable OHOS.UpdateService.DownloadOptions;
26sequenceable OHOS.UpdateService.NewVersionInfo;
27sequenceable OHOS.UpdateService.PauseDownloadOptions;
28sequenceable OHOS.UpdateService.ResumeDownloadOptions;
29sequenceable OHOS.UpdateService.TaskInfo;
30sequenceable OHOS.UpdateService.UpgradeInfo;
31sequenceable OHOS.UpdateService.UpgradeOptions;
32sequenceable OHOS.UpdateService.UpgradePolicy;
33sequenceable OHOS.UpdateService.VersionDescriptionInfo;
34sequenceable OHOS.UpdateService.VersionDigestInfo;
35
36option_stub_hooks on;
37option_parcel_hooks on;
38
39interface OHOS.UpdateService.IUpdateService {
40    [ipccode 1] int CheckNewVersion([in] UpgradeInfo info, [out] BusinessError businessError, [out] CheckResult checkResult);
41    [ipccode 2] int Download([in] UpgradeInfo info, [in] VersionDigestInfo versionDigestInfo,
42        [in] DownloadOptions downloadOptions, [out] BusinessError businessError);
43    [ipccode 3] int PauseDownload([in] UpgradeInfo info, [in] VersionDigestInfo versionDigestInfo,
44        [in] PauseDownloadOptions pauseDownloadOptions, [out] BusinessError businessError);
45    [ipccode 4] int ResumeDownload([in] UpgradeInfo info, [in] VersionDigestInfo versionDigestInfo,
46        [in] ResumeDownloadOptions resumeDownloadOptions, [out] BusinessError businessError);
47    [ipccode 5] int Upgrade([in] UpgradeInfo info, [in] VersionDigestInfo versionDigest,
48        [in] UpgradeOptions upgradeOptions, [out] BusinessError businessError);
49    [ipccode 6] int ClearError([in] UpgradeInfo info, [in] VersionDigestInfo versionDigest,
50        [in] ClearOptions clearOptions, [out] BusinessError businessError);
51    [ipccode 7] int TerminateUpgrade([in] UpgradeInfo info, [out] BusinessError businessError);
52    [ipccode 8] int SetUpgradePolicy([in] UpgradeInfo info, [in] UpgradePolicy policy, [out] BusinessError businessError);
53    [ipccode 9] int GetUpgradePolicy([in] UpgradeInfo info, [out] UpgradePolicy policy, [out] BusinessError businessError);
54    [ipccode 10] int GetNewVersionInfo([in] UpgradeInfo info, [out] NewVersionInfo newVersionInfo,
55        [out] BusinessError businessError);
56    [ipccode 11] int GetNewVersionDescription([in] UpgradeInfo info, [in] VersionDigestInfo versionDigestInfo,
57        [in] DescriptionOptions descriptionOptions, [out] VersionDescriptionInfo newVersionDescriptionInfo,
58        [out] BusinessError businessError);
59    [ipccode 12] int GetCurrentVersionInfo([in] UpgradeInfo info, [out] CurrentVersionInfo currentVersionInfo,
60        [out] BusinessError businessError);
61    [ipccode 13] int GetCurrentVersionDescription([in] UpgradeInfo info, [in] DescriptionOptions descriptionOptions,
62        [out] VersionDescriptionInfo currentVersionDescriptionInfo, [out] BusinessError businessError);
63    [ipccode 14] int GetTaskInfo([in] UpgradeInfo info, [out] TaskInfo taskInfo, [out] BusinessError businessError);
64    [ipccode 15] int RegisterUpdateCallback([in] UpgradeInfo info, [in] IUpdateCallback updateCallback);
65    [ipccode 16] int UnregisterUpdateCallback([in] UpgradeInfo info);
66    [ipccode 17] int Cancel([in] UpgradeInfo info, [in] int service, [out] BusinessError businessError);
67    [ipccode 18] int FactoryReset([out] BusinessError businessError);
68    [ipccode 19] int ApplyNewVersion([in] UpgradeInfo info, [in] String miscFile,
69        [in] String[] packageNames, [out] BusinessError businessError);
70    [ipccode 20] int VerifyUpgradePackage([in] String packagePath, [in] String keyPath, [out] BusinessError businessError);
71}
72