1 /*
2 * Copyright (c) 2025 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 #include "distributed_extension_loader.h"
17
18 #include "distributed_extension.h"
19 #include "dtbschedmgr_log.h"
20
21 namespace OHOS {
22 namespace DistributedSchedule {
23 using namespace std;
24
25 DistributedExtensionLoader::DistributedExtensionLoader() = default;
26 DistributedExtensionLoader::~DistributedExtensionLoader() = default;
27
Create(const unique_ptr<AbilityRuntime::Runtime> & runtime) const28 AbilityRuntime::Extension *DistributedExtensionLoader::Create(const unique_ptr<AbilityRuntime::Runtime> &runtime) const
29 {
30 HILOG_INFO("Create as an DistributedExtensionAbility(Loader)");
31 return DistributedExtension::Create(runtime);
32 }
33
GetParams()34 map<string, string> DistributedExtensionLoader::GetParams()
35 {
36 HILOG_INFO("Register as an extension ability");
37 return {
38 {"type", "28"},
39 {"name", "DistributedExtensionAbility"},
40 };
41 }
42
OHOS_EXTENSION_GetExtensionModule()43 extern "C" __attribute__((visibility("default"))) void *OHOS_EXTENSION_GetExtensionModule()
44 {
45 HILOG_INFO("Load as a library");
46 return &DistributedExtensionLoader::GetInstance();
47 }
48 }
49 }
50