Line data Source code
1 : /**
2 : * Copyright (c) 2026 Huawei Technologies Co., Ltd.
3 : * This program is free software, you can redistribute it and/or modify it under the terms and conditions of
4 : * CANN Open Software License Agreement Version 2.0 (the "License").
5 : * Please refer to the License for details. You may not use this file except in compliance with the License.
6 : * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED,
7 : * INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE.
8 : * See LICENSE in the root of the software repository for the full text of the License.
9 : */
10 :
11 : #include "package_manager.h"
12 :
13 : namespace tsd {
14 :
15 263 : PackageManager::PackageManager(
16 : uint32_t logicDeviceId, DeviceCommAgent& commAgent, CapabilityManager& capabilityMgr, uint32_t platInfoMode,
17 263 : bool isAdcEnv, uint32_t chipType)
18 263 : : getCheckCodeRetrySupport_(false),
19 263 : deviceIdle_(false),
20 526 : loadPackageErrorMsg_(""),
21 263 : envInfo_(logicDeviceId, platInfoMode, isAdcEnv, chipType),
22 263 : hashStore_(),
23 263 : pluginVersion_(envInfo_, hashStore_, pkgRspCode_),
24 263 : packageName_(envInfo_.packageName_),
25 263 : pkgHostHashValue_(hashStore_.pkgHostHashValue_),
26 263 : pkgDeviceHashValue_(hashStore_.pkgDeviceHashValue_),
27 263 : commAgent_(commAgent),
28 263 : capabilityMgr_(capabilityMgr),
29 263 : devicePluginVersions_(pluginVersion_.devicePluginVersions_),
30 263 : pluginUpdateStrategy_(pluginVersion_.pluginUpdateStrategy_),
31 263 : hasComputedPluginStrategy_(pluginVersion_.hasComputedPluginStrategy_),
32 263 : sender_(*this, commAgent_, capabilityMgr_, envInfo_, hashStore_, deviceIdle_, getCheckCodeRetrySupport_),
33 263 : checkCodeSvc_(
34 263 : *this, commAgent_, capabilityMgr_, envInfo_, hashStore_, pkgRspCode_, getCheckCodeRetrySupport_,
35 263 : loadPackageErrorMsg_),
36 263 : loader_(*this, commAgent_, capabilityMgr_, envInfo_, hashStore_, pkgRspCode_, loadPackageErrorMsg_),
37 263 : aicpuPackageExistInDevice_(loader_.aicpuPackageExistInDevice_),
38 263 : packagePeerCheckCode_(checkCodeSvc_.peerCheckCode_),
39 263 : packageHostCheckCode_(checkCodeSvc_.hostCheckCode_)
40 263 : {}
41 :
42 263 : PackageManager::~PackageManager() {}
43 :
44 23 : void PackageManager::ResetOnClose() { loader_.Reset(); }
45 :
46 : } // namespace tsd
|