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 #include "app_info.h"
17
18 namespace OHOS {
19 namespace RME {
AppInfo(int pid,int uid)20 AppInfo::AppInfo(int pid, int uid)
21 : m_appName(""),
22 m_pid(pid),
23 m_uid(uid),
24 m_uiTid(0),
25 m_renderTid(0),
26 m_isFocus(0),
27 m_rtGrp(0),
28 m_appState(AppState::APP_TERMINATED)
29 {}
30
SetRenderTid(const int tid)31 void AppInfo::SetRenderTid(const int tid)
32 {
33 this->m_renderTid = tid;
34 }
35
GetRenderTid()36 int AppInfo::GetRenderTid()
37 {
38 return m_renderTid;
39 }
40
SetUiTid(const int tid)41 void AppInfo::SetUiTid(const int tid)
42 {
43 this->m_uiTid = tid;
44 }
45
GetUiTid()46 int AppInfo::GetUiTid()
47 {
48 return m_uiTid;
49 }
50
SetAppName(const std::string appName)51 void AppInfo::SetAppName(const std::string appName)
52 {
53 this->m_appName = appName;
54 }
55
SetFocusState(const int isFocus)56 void AppInfo::SetFocusState(const int isFocus)
57 {
58 this->m_isFocus = isFocus;
59 }
60
GetFocusState()61 int AppInfo::GetFocusState()
62 {
63 return m_isFocus;
64 }
65
SetAppState(AppState appState)66 void AppInfo::SetAppState(AppState appState)
67 {
68 this->m_appState = appState;
69 }
70
SetAppPid(const int pid)71 void AppInfo::SetAppPid(const int pid)
72 {
73 this->m_pid = pid;
74 }
75
GetAppPid()76 int AppInfo::GetAppPid()
77 {
78 return m_pid;
79 }
80
GetAppUid()81 int AppInfo::GetAppUid()
82 {
83 return m_uid;
84 }
85
GetAppState()86 AppState AppInfo::GetAppState()
87 {
88 return m_appState;
89 }
90
SetRtgrp(const int grpNum)91 void AppInfo::SetRtgrp(const int grpNum)
92 {
93 this->m_rtGrp = grpNum;
94 }
95
GetRtgrp()96 int AppInfo::GetRtgrp()
97 {
98 return m_rtGrp;
99 }
100 } // namespace RME
101 } // namespace OHOS
102