1 /* 2 * Copyright (c) 2025-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 #include "data_center/form_cust_config_mgr.h" 16 17 #include "fms_log_wrapper.h" 18 #include "form_constants.h" 19 #include "parameters.h" 20 21 namespace OHOS { 22 namespace AppExecFwk { FormCustConfigMgr()23FormCustConfigMgr::FormCustConfigMgr() 24 { 25 HILOG_INFO("create"); 26 InitLiveFormParameters(); 27 } 28 ~FormCustConfigMgr()29FormCustConfigMgr::~FormCustConfigMgr() 30 { 31 HILOG_INFO("destroy"); 32 } 33 InitLiveFormParameters()34void FormCustConfigMgr::InitLiveFormParameters() 35 { 36 liveFormSupportType = OHOS::system::GetParameter(Constants::PARAM_LIVE_FORM_SUPPORT_KEY, Constants::LIVE_FORM_NONE); 37 gameCardSupportEnable = OHOS::system::GetParameter(Constants::PARAM_GAME_CARD_SUPPORT_KEY, "false"); 38 } 39 IsSupportSceneAnimation()40bool FormCustConfigMgr::IsSupportSceneAnimation() 41 { 42 return liveFormSupportType == Constants::SCENE_ANIMATION || liveFormSupportType == Constants::LIVE_FORM_BOTH; 43 } 44 IsSupportFunInteraction()45bool FormCustConfigMgr::IsSupportFunInteraction() 46 { 47 return liveFormSupportType == Constants::FUN_INTERACTION || liveFormSupportType == Constants::LIVE_FORM_BOTH; 48 } 49 IsSupportGameCard()50bool FormCustConfigMgr::IsSupportGameCard() 51 { 52 return gameCardSupportEnable == "true"; 53 } 54 } // namespace AppExecFwk 55 } // namespace OHOS