• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2021 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 
16 #include "update_callback.h"
17 #include <cstring>
18 #include <iomanip>
19 #include <sys/stat.h>
20 #include <sys/types.h>
21 #include <unistd.h>
22 #include <vector>
23 #include "iservice_registry.h"
24 #include "parameters.h"
25 #include "securec.h"
26 #include "system_ability_definition.h"
27 #include "update_helper.h"
28 
29 namespace OHOS {
30 namespace update_engine {
OnCheckVersionDone(const VersionInfo & info)31 void UpdateCallback::OnCheckVersionDone(const VersionInfo &info)
32 {
33     ENGINE_LOGI("OnCheckVersionDone VersionInfo status %d", info.status);
34     ENGINE_LOGI("OnCheckVersionDone VersionInfo errMsg %s", info.errMsg.c_str());
35     ENGINE_LOGI("OnCheckVersionDone VersionInfo versionName : %s", info.result[0].versionName.c_str());
36     ENGINE_LOGI("OnCheckVersionDone VersionInfo versionCode : %s", info.result[0].versionCode.c_str());
37     ENGINE_LOGI("OnCheckVersionDone VersionInfo verifyInfo : %s", info.result[0].verifyInfo.c_str());
38     ENGINE_LOGI("OnCheckVersionDone VersionInfo size : %zu", info.result[0].size);
39 }
40 
OnDownloadProgress(const Progress & progress)41 void UpdateCallback::OnDownloadProgress(const Progress &progress)
42 {
43     ENGINE_LOGI("OnDownloadProgress progress %u %d", progress.percent, progress.status);
44 }
45 
OnUpgradeProgress(const Progress & progress)46 void UpdateCallback::OnUpgradeProgress(const Progress &progress)
47 {
48     ENGINE_LOGI("OnUpgradeProgress progress %u %d", progress.percent, progress.status);
49 }
50 }
51 } // namespace OHOS
52