• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /**
2  * Copyright (c) 2024 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 BULETOOTH_ABILITY_CONNECTION_H
17 #define BULETOOTH_ABILITY_CONNECTION_H
18 
19 #include <cstdint>
20 #include <string>
21 
22 #include "foundation/ability/ability_base/interfaces/inner_api/base/include/base_types.h"
23 #include "foundation/ability/ability_runtime/interfaces/kits/native/ability/ability_runtime/ability_connection.h"
24 
25 namespace OHOS {
26 namespace bluetooth {
27 
28 class BluetoothAbilityConnection : public AAFwk::AbilityConnectionStub {
29 public:
BluetoothAbilityConnection(const std::string commandStr,const std::string bundleName,const std::string abilityName)30     explicit BluetoothAbilityConnection(
31         const std::string commandStr, const std::string bundleName, const std::string abilityName)
32     {
33         commandStr_ = commandStr;
34         bundleName_ = bundleName;
35         abilityName_ = abilityName;
36     }
37 
38     virtual ~BluetoothAbilityConnection() = default;
39     void OnAbilityConnectDone(
40         const AppExecFwk::ElementName& element, const sptr<IRemoteObject>& remoteObject, int32_t resultCode);
41     void OnAbilityDisconnectDone(const AppExecFwk::ElementName& element, int32_t resultCode);
42 
43 private:
44     std::string commandStr_;
45     std::string bundleName_;
46     std::string abilityName_;
47 };
48 } // namespace bluetooth
49 } // namespace OHOS
50 #endif // BULETOOTH_ABILITY_CONNECTION_H
51