1 /* 2 * Copyright (c) 2024 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 RESSCHED_COMMON_INCLUDE_RES_SCHED_SYSTEM_UTIL 17 #define RESSCHED_COMMON_INCLUDE_RES_SCHED_SYSTEM_UTIL 18 19 #include <string> 20 21 namespace OHOS { 22 namespace ResourceSchedule { 23 namespace ResCommonUtil { 24 25 /** 26 * @brief Obtain total ram size. 27 * 28 * @param ddrSysProp if ddrSysProp not empty, try parse ram size from this system prop 29 * @return Returns total ram size; 30 */ 31 int64_t GetTotalRamSize(const std::string& ddrSysProp = ""); 32 33 /** 34 * @brief Obtain total rom size. 35 * 36 * @return Returns total rom size; 37 */ 38 int64_t GetTotalRomSize(); 39 40 /** 41 * @brief Obtain system prop. 42 * 43 * @param name system prop name 44 * @param defaultValue when obtain failed return this value 45 * @return Returns the value of this system prop; 46 */ 47 std::string GetSystemProperties(const std::string& name, const std::string &defaultValue); 48 } 49 } // namespace ResourceSchedule 50 } // namespace OHOS 51 52 #endif // RESSCHED_COMMON_INCLUDE_RES_SCHED_SYSTEM_UTIL