1 /* 2 * Copyright (c) 2021 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 "ability_manager_inner.h" 17 18 #include "abilityms_slite_client.h" 19 20 StartCheckFunc CALLBACKFUNC = nullptr; 21 bool cleanAbilityDataFlag = false; 22 23 extern "C" { RegAbilityCallback(StartCheckFunc startCheckCallback)24int RegAbilityCallback(StartCheckFunc startCheckCallback) 25 { 26 CALLBACKFUNC = startCheckCallback; 27 return 0; 28 } 29 SchedulerLifecycleDone(uint64_t token,int state)30int SchedulerLifecycleDone(uint64_t token, int state) 31 { 32 return OHOS::AbilityMsClient::GetInstance().SchedulerLifecycleDone(token, state); 33 } 34 ForceStopBundle(uint64_t token)35int ForceStopBundle(uint64_t token) 36 { 37 return OHOS::AbilityMsClient::GetInstance().ForceStopBundle(token); 38 } 39 ForceStop(char * bundleName)40int ForceStop(char *bundleName) 41 { 42 return OHOS::AbilityMsClient::GetInstance().ForceStop(bundleName); 43 } 44 GetAbilityCallback()45StartCheckFunc GetAbilityCallback() 46 { 47 return CALLBACKFUNC; 48 } 49 SetCleanAbilityDataFlag(bool cleanFlag)50void SetCleanAbilityDataFlag(bool cleanFlag) 51 { 52 cleanAbilityDataFlag = cleanFlag; 53 } 54 GetCleanAbilityDataFlag()55bool GetCleanAbilityDataFlag() 56 { 57 return cleanAbilityDataFlag; 58 } 59 } 60