• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 
OnDlpAbilityOpened(const DlpStateData & data)40 void ConnectionObserverStubImpl::OnDlpAbilityOpened(const DlpStateData &data)
41 {
42     auto owner = owner_.lock();
43     if (!owner) {
44         return;
45     }
46     owner->HandleDlpAbilityOpened(data);
47 }
48 
OnDlpAbilityClosed(const DlpStateData & data)49 void ConnectionObserverStubImpl::OnDlpAbilityClosed(const DlpStateData &data)
50 {
51     auto owner = owner_.lock();
52     if (!owner) {
53         return;
54     }
55     owner->HandleDlpAbilityClosed(data);
56 }
57 }  // namespace AbilityRuntime
58 }  // namespace OHOS
59