1 /*
2 * Copyright (c) 2023 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 "enterprise_update_connection.h"
17
18 #include "edm_log.h"
19 #include "enterprise_conn_manager.h"
20
21 namespace OHOS {
22 namespace EDM {
~EnterpriseUpdateConnection()23 EnterpriseUpdateConnection::~EnterpriseUpdateConnection() {}
24
OnAbilityConnectDone(const AppExecFwk::ElementName & element,const sptr<IRemoteObject> & remoteObject,int32_t resultCode)25 void EnterpriseUpdateConnection::OnAbilityConnectDone(
26 const AppExecFwk::ElementName& element, const sptr<IRemoteObject>& remoteObject, int32_t resultCode)
27 {
28 EDMLOGI("EnterpriseUpdateConnection OnAbilityConnectDone");
29 proxy_ = (new (std::nothrow) EnterpriseAdminProxy(remoteObject));
30 if (proxy_ == nullptr) {
31 EDMLOGI("EnterpriseUpdateConnection get enterpriseAdminProxy failed.");
32 return;
33 }
34 proxy_->OnSystemUpdate(updateInfo_);
35
36 EDMLOGI("EnterpriseUpdateConnection OnAbilityConnectDone over");
37 }
38
OnAbilityDisconnectDone(const AppExecFwk::ElementName & element,int32_t resultCode)39 void EnterpriseUpdateConnection::OnAbilityDisconnectDone(const AppExecFwk::ElementName& element, int32_t resultCode)
40 {
41 EDMLOGI("EnterpriseUpdateConnection OnAbilityDisconnectDone");
42 }
43 } // namespace EDM
44 } // namespace OHOS
45