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_service.h" 17 18 #include "dtbschedmgr_log.h" 19 20 namespace OHOS { 21 namespace DistributedSchedule { 22 const std::string TAG = "DistributedExtensionService"; 23 TriggerOnCreate(AAFwk::Want & want)24int32_t DistributedExtensionService::TriggerOnCreate(AAFwk::Want& want) 25 { 26 HILOG_INFO("DistributedExtensionService::TriggerOnCreate enter"); 27 if (distributedExtension_ == nullptr) { 28 HILOG_ERROR("distributedExtension is nullptr"); 29 return ERR_INVALID_VALUE; 30 } 31 32 distributedExtension_->TriggerOnCreate(want); 33 return ERR_OK; 34 } 35 TriggerOnDestroy()36int32_t DistributedExtensionService::TriggerOnDestroy() 37 { 38 HILOG_INFO("DistributedExtensionService::TriggerOnDestroy enter"); 39 if (distributedExtension_ == nullptr) { 40 HILOG_ERROR("distributedExtension is nullptr"); 41 return ERR_INVALID_VALUE; 42 } 43 44 distributedExtension_->TriggerOnDestroy(); 45 return ERR_OK; 46 } 47 TriggerOnCollaborate(AAFwk::WantParams & wantParam)48int32_t DistributedExtensionService::TriggerOnCollaborate(AAFwk::WantParams &wantParam) 49 { 50 HILOG_INFO("DistributedExtensionService::TriggerOnCollaborate enter"); 51 if (distributedExtension_ == nullptr) { 52 HILOG_ERROR("distributedExtension is nullptr"); 53 return ERR_INVALID_VALUE; 54 } 55 56 distributedExtension_->TriggerOnCollaborate(wantParam); 57 return ERR_OK; 58 } 59 Clear()60void DistributedExtensionService::Clear() 61 {} 62 } 63 } 64