1 /* 2 * Copyright (c) 2021-2022 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 "scene_state_collection.h" 17 18 #include <algorithm> 19 20 #include "constants.h" 21 #include "file_operation.h" 22 #include "securec.h" 23 #include "string_operation.h" 24 #include "thermal_service.h" 25 #include "thermal_common.h" 26 27 namespace OHOS { 28 namespace PowerMgr { 29 namespace { 30 } Init()31bool SceneStateCollection::Init() 32 { 33 return true; 34 } 35 InitParam(std::string & params)36bool SceneStateCollection::InitParam(std::string& params) 37 { 38 return true; 39 } 40 GetState()41std::string SceneStateCollection::GetState() 42 { 43 return ""; 44 } 45 SetState(const std::string & stateValue)46void SceneStateCollection::SetState(const std::string& stateValue) 47 { 48 } 49 DecideState(const std::string & value)50bool SceneStateCollection::DecideState(const std::string& value) 51 { 52 THERMAL_HILOGD(COMP_SVC, "Enter"); 53 auto tms = ThermalService::GetInstance(); 54 if ((!tms->GetScene().empty()) && (tms->GetScene() == value)) { 55 std::string scene = tms->GetScene(); 56 THERMAL_HILOGD(COMP_SVC, "scene = %{public}s", scene.c_str()); 57 return true; 58 } 59 60 return false; 61 } 62 } // namespace PowerMgr 63 } // namespace OHOS