1 /* 2 * Copyright (c) 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 #ifndef OHOS_MEMORY_MEMMGR_INNERKITS_MEM_MGR_CONSTANT_H 17 #define OHOS_MEMORY_MEMMGR_INNERKITS_MEM_MGR_CONSTANT_H 18 19 #include <string> 20 #include <map> 21 22 namespace OHOS { 23 namespace Memory { 24 // system app 25 constexpr int RECLAIM_PRIORITY_SYSTEM = -1000; 26 // persist(killable) system app 27 constexpr int RECLAIM_PRIORITY_KILLABLE_SYSTEM = -800; 28 // foreground process priority 29 constexpr int RECLAIM_PRIORITY_FOREGROUND = 0; 30 // perceived suspend delay case 31 constexpr int RECLAIM_PRIORITY_BG_SUSPEND_DELAY = 100; 32 // perceived background process priority 33 constexpr int RECLAIM_PRIORITY_BG_PERCEIVED = 200; 34 // background priority 35 constexpr int RECLAIM_PRIORITY_BACKGROUND = 400; 36 // unknown process priority 37 constexpr int RECLAIM_PRIORITY_UNKNOWN = 1000; 38 39 const std::map<int, std::string> ReclaimPriorityMapping = { 40 { RECLAIM_PRIORITY_SYSTEM, "System" }, 41 { RECLAIM_PRIORITY_KILLABLE_SYSTEM, "Persistent" }, 42 { RECLAIM_PRIORITY_FOREGROUND, "Foreground" }, 43 { RECLAIM_PRIORITY_BG_SUSPEND_DELAY, "Suspend-delay" }, 44 { RECLAIM_PRIORITY_BG_PERCEIVED, "Perceived" }, 45 { RECLAIM_PRIORITY_BACKGROUND, "Background" }, 46 }; 47 48 const std::string RECLAIM_PRIORITY_UNKNOWN_DESC = "Undefined"; 49 } // namespace Memory 50 } // namespace OHOS 51 #endif // OHOS_MEMORY_MEMMGR_INNERKITS_MEM_MGR_CONSTANT_H 52