1 /*
2  * Copyright (c) 2022 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 "connection_observer_stub_impl.h"
17 
18 #include "connection_observer_client_impl.h"
19 
20 namespace OHOS {
21 namespace AbilityRuntime {
OnExtensionConnected(const ConnectionData & data)22 void ConnectionObserverStubImpl::OnExtensionConnected(const ConnectionData &data)
23 {
24     auto owner = owner_.lock();
25     if (!owner) {
26         return;
27     }
28     owner->HandleExtensionConnected(data);
29 }
30 
OnExtensionDisconnected(const ConnectionData & data)31 void ConnectionObserverStubImpl::OnExtensionDisconnected(const ConnectionData &data)
32 {
33     auto owner = owner_.lock();
34     if (!owner) {
35         return;
36     }
37     owner->HandleExtensionDisconnected(data);
38 }
39 
40 #ifdef WITH_DLP
OnDlpAbilityOpened(const DlpStateData & data)41 void ConnectionObserverStubImpl::OnDlpAbilityOpened(const DlpStateData &data)
42 {
43     auto owner = owner_.lock();
44     if (!owner) {
45         return;
46     }
47     owner->HandleDlpAbilityOpened(data);
48 }
49 
OnDlpAbilityClosed(const DlpStateData & data)50 void ConnectionObserverStubImpl::OnDlpAbilityClosed(const DlpStateData &data)
51 {
52     auto owner = owner_.lock();
53     if (!owner) {
54         return;
55     }
56     owner->HandleDlpAbilityClosed(data);
57 }
58 #endif // WITH_DLP
59 }  // namespace AbilityRuntime
60 }  // namespace OHOS
61