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 #ifndef OHOS_ABILITYMANAGERSERVICE_SLITE_FEATURE_H 17 #define OHOS_ABILITYMANAGERSERVICE_SLITE_FEATURE_H 18 19 #include "ability_service.h" 20 #include "ability_service_interface.h" 21 #include "feature.h" 22 #include "iunknown.h" 23 #include "nocopyable.h" 24 25 namespace OHOS { 26 class AbilityMgrSliteFeature : public Feature { 27 public: 28 static int32 StartAbility(const Want *want); 29 static int32 TerminateAbility(uint64_t token); 30 static int32 SchedulerLifecycleDone(uint64_t token, int state); 31 static int32 ForceStopBundle(uint64_t token); 32 static ElementName *GetTopAbility(); 33 GetInstance()34 static AbilityMgrSliteFeature *GetInstance() 35 { 36 static AbilityMgrSliteFeature instance; 37 return &instance; 38 } 39 ~AbilityMgrSliteFeature() = default; 40 private: 41 AbilityMgrSliteFeature(); 42 static const char *GetFeatureName(Feature *feature); 43 static void OnFeatureInitialize(Feature *feature, Service *parent, Identity identity); 44 static void OnFeatureStop(Feature *feature, Identity identity); 45 static BOOL OnFeatureMessage(Feature *feature, Request *request); 46 47 private: 48 Identity identity_; 49 AbilityService *abilityService_; 50 DISALLOW_COPY_AND_MOVE(AbilityMgrSliteFeature); 51 }; 52 53 typedef struct { 54 INHERIT_IUNKNOWNENTRY(AmsSliteInterface); 55 AbilityMgrSliteFeature *ams; 56 } AbilityMgrSliteFeatureImpl; 57 } // namespace OHOS 58 #endif // OHOS_ABILITYMANAGERSERVICE_SLITE_FEATURE_H 59