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 ABILITY_DYNAMIC_INSIGHT_H
17 #define ABILITY_DYNAMIC_INSIGHT_H
18 
19 #include "insight_intent_execute_param.h"
20 
21 namespace OHOS::AVSession {
22 class InsightAdapter {
23 public:
24     static InsightAdapter& GetInsightAdapterInstance();
25 
26     ~InsightAdapter();
27 
28     __attribute__((no_sanitize("cfi"))) bool IsSupportPlayIntent(const std::string& bundleName,
29         std::string& supportModule, std::string& profile);
30 
31     bool GetPlayIntentParam(const std::string& bundleName, const std::string& assetId,
32                             AppExecFwk::InsightIntentExecuteParam &executeParam);
33 
34     int32_t StartAVPlayback(AppExecFwk::InsightIntentExecuteParam &executeParam);
35 
36 private:
37     InsightAdapter();
38 
39     bool CheckBundleSupport(std::string& profile);
40 
41     const int32_t getBundleInfoWithHapModule = 0x00000002;
42 
43     const int32_t startUserId = 100;
44 
45     const int32_t interfaceType = 9;
46 
47     const std::string PLAY_MUSICLIST = "PlayMusicList";
48 
49     const std::string PLAY_AUDIO = "PlayAudio";
50 };
51 
52 }
53 #endif // ABILITY_DYNAMIC_INSIGHT_H
54 
55