1cc290419Sopenharmony_ci/* 2cc290419Sopenharmony_ci * Copyright (c) 2023 Huawei Device Co., Ltd. 3cc290419Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); 4cc290419Sopenharmony_ci * you may not use this file except in compliance with the License. 5cc290419Sopenharmony_ci * You may obtain a copy of the License at 6cc290419Sopenharmony_ci * 7cc290419Sopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 8cc290419Sopenharmony_ci * 9cc290419Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software 10cc290419Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 11cc290419Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12cc290419Sopenharmony_ci * See the License for the specific language governing permissions and 13cc290419Sopenharmony_ci * limitations under the License. 14cc290419Sopenharmony_ci */ 15cc290419Sopenharmony_ci 16cc290419Sopenharmony_ci#ifndef HEAD_CONECTION_HEAD 17cc290419Sopenharmony_ci#define HEAD_CONECTION_HEAD 18cc290419Sopenharmony_ci 19cc290419Sopenharmony_ci#include "iremote_stub.h" 20cc290419Sopenharmony_ci#include "iremote_object.h" 21cc290419Sopenharmony_ci#include "ability_connect_callback_stub.h" 22cc290419Sopenharmony_ci#include <semaphore.h> 23cc290419Sopenharmony_ci 24cc290419Sopenharmony_cinamespace OHOS { 25cc290419Sopenharmony_cinamespace HDC { 26cc290419Sopenharmony_cinamespace AUTH { 27cc290419Sopenharmony_ci 28cc290419Sopenharmony_ciusing namespace std; 29cc290419Sopenharmony_ci 30cc290419Sopenharmony_ciclass HdcdConnection : public AAFwk::AbilityConnectionStub { 31cc290419Sopenharmony_cipublic: 32cc290419Sopenharmony_ci HdcdConnection() 33cc290419Sopenharmony_ci { 34cc290419Sopenharmony_ci sem_init(&sem, 0, 0); 35cc290419Sopenharmony_ci showDialogResult = false; 36cc290419Sopenharmony_ci } 37cc290419Sopenharmony_ci virtual ~HdcdConnection() = default; 38cc290419Sopenharmony_ci 39cc290419Sopenharmony_ci void OnAbilityConnectDone(const AppExecFwk::ElementName &element, const sptr<IRemoteObject> &remoteObject, 40cc290419Sopenharmony_ci int32_t resultCode) override; 41cc290419Sopenharmony_ci void OnAbilityDisconnectDone(const AppExecFwk::ElementName &element, int32_t resultCode) override; 42cc290419Sopenharmony_ci bool GetSettingBundleName(string &bundle); 43cc290419Sopenharmony_ci bool GetShowDialogResult(void); 44cc290419Sopenharmony_ciprivate: 45cc290419Sopenharmony_ci sem_t sem; 46cc290419Sopenharmony_ci bool showDialogResult; 47cc290419Sopenharmony_ci}; 48cc290419Sopenharmony_ci 49cc290419Sopenharmony_ci} // namespace AUTH 50cc290419Sopenharmony_ci} // namespace HDC 51cc290419Sopenharmony_ci} // namespace OHOS 52cc290419Sopenharmony_ci#endif // HEAD_CONECTION_HEAD 53cc290419Sopenharmony_ci 54