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