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