• 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 #ifndef NDEF_HAR_DISPATCH_H
16 #define NDEF_HAR_DISPATCH_H
17 
18 #include <shared_mutex>
19 #include <string>
20 #include "app_data_parser.h"
21 #include "if_system_ability_manager.h"
22 #include "taginfo.h"
23 #include "inci_nfcc_interface.h"
24 #include "iremote_object.h"
25 
26 namespace OHOS {
27 namespace NFC {
28 namespace TAG {
29 class NdefHarDispatch {
30 public:
31     NdefHarDispatch(std::weak_ptr<NCI::INciNfccInterface> nciNfccProxy);
~NdefHarDispatch()32     ~NdefHarDispatch() {}
33     bool DispatchBundleAbility(const std::string &harPackage, const std::shared_ptr<KITS::TagInfo> &tagInfo,
34         const std::string &mimeType, const std::string &uri, OHOS::sptr<IRemoteObject> tagServiceIface);
35     bool DispatchBundleExtensionAbility(const std::string &harPackage, const std::shared_ptr<KITS::TagInfo> &tagInfo,
36         const std::string &mimeType, const std::string &uri);
37     bool DispatchUriToBundleAbility(const std::string &uri);
38     bool DispatchMimeType(const std::string &type, const std::shared_ptr<KITS::TagInfo> &tagInfo);
39     bool DispatchByAppLinkMode(const std::string &uriSchemeValue, const std::shared_ptr<KITS::TagInfo> &tagInfo,
40         OHOS::sptr<IRemoteObject> tagServiceIface);
41 
42 private:
43     static sptr<AppExecFwk::IBundleMgr> GetBundleMgrProxy();
44     std::shared_mutex mutex_ {};
45     std::weak_ptr<NCI::INciNfccInterface> nciNfccProxy_ {};
46 };
47 } // namespace TAG
48 } // namespace NFC
49 } // namespace OHOS
50 #endif // NDEF_HAR_DISPATCH_H