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 #ifndef HEAD_CONECTION_HEAD
17 #define HEAD_CONECTION_HEAD
18 
19 #include "iremote_stub.h"
20 #include "iremote_object.h"
21 #include "ability_connect_callback_stub.h"
22 #include <semaphore.h>
23 
24 namespace OHOS {
25 namespace HDC {
26 namespace AUTH {
27 
28 using namespace std;
29 
30 class HdcdConnection : public AAFwk::AbilityConnectionStub {
31 public:
HdcdConnection()32     HdcdConnection()
33     {
34         sem_init(&sem, 0, 0);
35         showDialogResult = false;
36     }
37     virtual ~HdcdConnection() = default;
38 
39     void OnAbilityConnectDone(const AppExecFwk::ElementName &element, const sptr<IRemoteObject> &remoteObject,
40         int32_t resultCode) override;
41     void OnAbilityDisconnectDone(const AppExecFwk::ElementName &element, int32_t resultCode) override;
42     bool GetSettingBundleName(string &bundle);
43     bool GetShowDialogResult(void);
44 private:
45     sem_t sem;
46     bool showDialogResult;
47 };
48 
49 } // namespace AUTH
50 } // namespace HDC
51 } // namespace OHOS
52 #endif // HEAD_CONECTION_HEAD
53 
54