1 /*
2  * Copyright (c) 2023 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 #ifdef MEM_MGR_ENABLE
17 #include "mem_status_listener.h"
18 #include "fms_log_wrapper.h"
19 #include "form_data_mgr.h"
20 
21 namespace OHOS {
22 namespace AppExecFwk {
OnConnected()23 void MemStatusListener::OnConnected()
24 {
25     HILOG_DEBUG("call");
26 }
27 
OnRemoteDied(const wptr<IRemoteObject> & object)28 void MemStatusListener::OnRemoteDied(const wptr<IRemoteObject> &object)
29 {
30     HILOG_DEBUG("call");
31 }
32 
OnTrim(Memory::SystemMemoryLevel level)33 void MemStatusListener::OnTrim(Memory::SystemMemoryLevel level)
34 {
35     HILOG_DEBUG("memory level is %{public}d", level);
36     FormDataMgr::GetInstance().RecycleAllRecyclableForms();
37 }
38 
ForceReclaim(int32_t pid,int32_t uid)39 void MemStatusListener::ForceReclaim(int32_t pid, int32_t uid)
40 {
41     HILOG_DEBUG("pid is %{public}d, uid is %{public}d", pid, uid);
42     FormDataMgr::GetInstance().RecycleAllRecyclableForms();
43 }
44 } // namespace AppExecFwk
45 } // namespace OHOS
46 #endif //MEM_MGR_ENABLE
47