• Home
  • Raw
  • Download

Lines Matching full:pid

101 bool ClientInfo::OnlyCurPidSensorEnabled(int32_t sensorId, int32_t pid)  in OnlyCurPidSensorEnabled()  argument
103 SEN_HILOGI("In, sensorId:%{public}d, pid:%{public}d", sensorId, pid); in OnlyCurPidSensorEnabled()
104 if ((sensorId == INVALID_SENSOR_ID) || (pid <= INVALID_PID)) { in OnlyCurPidSensorEnabled()
105 SEN_HILOGE("sensorId or pid is invalid"); in OnlyCurPidSensorEnabled()
119 if (pidIt.first != pid) { in OnlyCurPidSensorEnabled()
120 SEN_HILOGE("Current sensor is also used by other pid"); in OnlyCurPidSensorEnabled()
125 SEN_HILOGI("Done, sensorId:%{public}d, pid:%{public}d", sensorId, pid); in OnlyCurPidSensorEnabled()
129 bool ClientInfo::UpdateAppThreadInfo(int32_t pid, int32_t uid, AccessTokenID callerToken) in UpdateAppThreadInfo() argument
131 SEN_HILOGI("In, pid:%{public}d", pid); in UpdateAppThreadInfo()
132 if ((uid == INVALID_UID) || (pid <= INVALID_PID)) { in UpdateAppThreadInfo()
133 SEN_HILOGE("uid or pid is invalid"); in UpdateAppThreadInfo()
137 AppThreadInfo appThreadInfo(pid, uid, callerToken); in UpdateAppThreadInfo()
138 auto appThreadInfoItr = appThreadInfoMap_.find(pid); in UpdateAppThreadInfo()
144 auto ret = appThreadInfoMap_.insert(std::make_pair(pid, appThreadInfo)); in UpdateAppThreadInfo()
147 appThreadInfoMap_[pid] = appThreadInfo; in UpdateAppThreadInfo()
148 SEN_HILOGI("Done, pid:%{public}d", pid); in UpdateAppThreadInfo()
152 void ClientInfo::DestroyAppThreadInfo(int32_t pid) in DestroyAppThreadInfo() argument
154 SEN_HILOGI("In, pid:%{public}d", pid); in DestroyAppThreadInfo()
155 if (pid == INVALID_PID) { in DestroyAppThreadInfo()
156 SEN_HILOGE("pid is invalid"); in DestroyAppThreadInfo()
160 auto appThreadInfoItr = appThreadInfoMap_.find(pid); in DestroyAppThreadInfo()
162 SEN_HILOGD("pid not exist, no need to destroy it"); in DestroyAppThreadInfo()
166 SEN_HILOGI("Done, pid:%{public}d", pid); in DestroyAppThreadInfo()
193 sptr<SensorBasicDataChannel> ClientInfo::GetSensorChannelByPid(int32_t pid) in GetSensorChannelByPid() argument
195 SEN_HILOGI("In, pid:%{public}d", pid); in GetSensorChannelByPid()
196 if (pid == INVALID_PID) { in GetSensorChannelByPid()
197 SEN_HILOGE("pid is invalid"); in GetSensorChannelByPid()
201 auto channelIt = channelMap_.find(pid); in GetSensorChannelByPid()
203 SEN_HILOGE("There is no channel belong to the pid"); in GetSensorChannelByPid()
206 SEN_HILOGI("Done, pid:%{public}d", pid); in GetSensorChannelByPid()
237 bool ClientInfo::UpdateSensorInfo(int32_t sensorId, int32_t pid, const SensorBasicInfo &sensorInfo) in UpdateSensorInfo() argument
239 SEN_HILOGI("In, sensorId:%{public}d, pid:%{public}d", sensorId, pid); in UpdateSensorInfo()
240 if ((sensorId == INVALID_SENSOR_ID) || (pid <= INVALID_PID) || (!sensorInfo.GetSensorState())) { in UpdateSensorInfo()
248 auto pidRet = pidMap.insert(std::make_pair(pid, sensorInfo)); in UpdateSensorInfo()
252 auto pidIt = it->second.find(pid); in UpdateSensorInfo()
254 auto ret = it->second.insert(std::make_pair(pid, sensorInfo)); in UpdateSensorInfo()
257 it->second[pid] = sensorInfo; in UpdateSensorInfo()
258 SEN_HILOGI("Done, sensorId:%{public}d, pid:%{public}d", sensorId, pid); in UpdateSensorInfo()
262 void ClientInfo::RemoveSubscriber(int32_t sensorId, uint32_t pid) in RemoveSubscriber() argument
264 SEN_HILOGI("In, sensorId:%{public}d, pid:%{public}u", sensorId, pid); in RemoveSubscriber()
271 auto pidIt = it->second.find(pid); in RemoveSubscriber()
275 SEN_HILOGI("Done, sensorId:%{public}d, pid:%{public}d", sensorId, pid); in RemoveSubscriber()
278 bool ClientInfo::UpdateSensorChannel(int32_t pid, const sptr<SensorBasicDataChannel> &channel) in UpdateSensorChannel() argument
280 SEN_HILOGI("In, pid:%{public}d", pid); in UpdateSensorChannel()
282 if (pid <= INVALID_PID) { in UpdateSensorChannel()
283 SEN_HILOGE("pid is invalid"); in UpdateSensorChannel()
287 auto it = channelMap_.find(pid); in UpdateSensorChannel()
293 auto ret = channelMap_.insert(std::make_pair(pid, channel)); in UpdateSensorChannel()
297 channelMap_[pid] = channel; in UpdateSensorChannel()
298 SEN_HILOGI("Done, pid:%{public}d", pid); in UpdateSensorChannel()
319 void ClientInfo::ClearCurPidSensorInfo(int32_t sensorId, int32_t pid) in ClearCurPidSensorInfo() argument
321 SEN_HILOGI("In, sensorId:%{public}d, pid:%{public}d", sensorId, pid); in ClearCurPidSensorInfo()
322 if ((sensorId == INVALID_SENSOR_ID) || (pid <= INVALID_PID)) { in ClearCurPidSensorInfo()
323 SEN_HILOGE("sensorId or pid is invalid"); in ClearCurPidSensorInfo()
332 auto pidIt = it->second.find(pid); in ClearCurPidSensorInfo()
334 SEN_HILOGD("pid not exist, no need to clear it"); in ClearCurPidSensorInfo()
341 SEN_HILOGI("Done, sensorId:%{public}d, pid:%{public}d", sensorId, pid); in ClearCurPidSensorInfo()
344 bool ClientInfo::DestroySensorChannel(int32_t pid) in DestroySensorChannel() argument
347 if (pid <= INVALID_PID) { in DestroySensorChannel()
348 SEN_HILOGE("pid is invalid"); in DestroySensorChannel()
353 auto pidIt = it->second.find(pid); in DestroySensorChannel()
365 DestroyAppThreadInfo(pid); in DestroySensorChannel()
367 auto it = channelMap_.find(pid); in DestroySensorChannel()
369 SEN_HILOGD("There is no channel belong to pid, no need to destroy"); in DestroySensorChannel()
376 SensorBasicInfo ClientInfo::GetCurPidSensorInfo(int32_t sensorId, int32_t pid) in GetCurPidSensorInfo() argument
383 if ((sensorId == INVALID_SENSOR_ID) || (pid <= INVALID_PID)) { in GetCurPidSensorInfo()
393 auto pidIt = it->second.find(pid); in GetCurPidSensorInfo()
395 SEN_HILOGE("Can't find pid:%{public}d", pid); in GetCurPidSensorInfo()
409 int32_t pid = INVALID_PID; in ComputeBestPeriodCount() local
414 pid = channelIt.first; in ComputeBestPeriodCount()
419 int64_t curSamplingPeriod = GetCurPidSensorInfo(sensorId, pid).GetSamplingPeriodNs(); in ComputeBestPeriodCount()
434 int32_t pid = INVALID_PID; in ComputeBestFifoCount() local
439 pid = channelIt.first; in ComputeBestFifoCount()
443 int64_t curReportDelay = GetCurPidSensorInfo(sensorId, pid).GetMaxReportDelayNs(); in ComputeBestFifoCount()
444 int64_t curSamplingPeriod = GetCurPidSensorInfo(sensorId, pid).GetSamplingPeriodNs(); in ComputeBestFifoCount()
505 bool ClientInfo::SaveClientPid(const sptr<IRemoteObject> &sensorClient, int32_t pid) in SaveClientPid() argument
512 clientPidMap_.insert(std::make_pair(sensorClient, pid)); in SaveClientPid()
515 clientPidMap_.insert(std::make_pair(sensorClient, pid)); in SaveClientPid()
526 SEN_HILOGE("Cannot find client pid"); in FindClientPid()
539 SEN_HILOGE("Cannot find client pid"); in DestroyClientPid()
551 std::vector<int32_t> ClientInfo::GetSensorIdByPid(int32_t pid) in GetSensorIdByPid() argument
557 auto it = itClientMap.second.find(pid); in GetSensorIdByPid()
577 appThreadInfo.pid = channelIt->first; in GetAppInfoByChannel()
583 auto it = appThreadInfoMap_.find(appThreadInfo.pid); in GetAppInfoByChannel()
598 int32_t pid = pidIt.first; in GetSensorChannelInfo() local
599 int32_t uid = GetUidByPid(pid); in GetSensorChannelInfo()
608 SensorManager::GetInstance().GetPackageName(GetTokenIdByPid(pid), packageName); in GetSensorChannelInfo()
621 int32_t ClientInfo::GetUidByPid(int32_t pid) in GetUidByPid() argument
624 auto appThreadInfoIt = appThreadInfoMap_.find(pid); in GetUidByPid()
631 AccessTokenID ClientInfo::GetTokenIdByPid(int32_t pid) in GetTokenIdByPid() argument
634 auto appThreadInfoIt = appThreadInfoMap_.find(pid); in GetTokenIdByPid()
718 int32_t ClientInfo::AddActiveInfoCBPid(int32_t pid) in AddActiveInfoCBPid() argument
721 auto pairRet = activeInfoCBPidSet_.insert(pid); in AddActiveInfoCBPid()
723 SEN_HILOGE("Pid is duplicated"); in AddActiveInfoCBPid()
729 int32_t ClientInfo::DelActiveInfoCBPid(int32_t pid) in DelActiveInfoCBPid() argument
732 auto it = activeInfoCBPidSet_.find(pid); in DelActiveInfoCBPid()
734 SEN_HILOGE("Pid is not exists"); in DelActiveInfoCBPid()
751 bool ClientInfo::CallingService(int32_t pid) in CallingService() argument
754 auto channelIt = channelMap_.find(pid); in CallingService()
758 SEN_HILOGD("Pid is not exists in channelMap"); in CallingService()
760 auto pidIt = activeInfoCBPidSet_.find(pid); in CallingService()
764 SEN_HILOGD("Pid is not exists in activeInfoCBPidSet"); in CallingService()
772 int32_t pid = INVALID_PID; in GetPidByTokenId() local
777 pid = iter->second.pid; in GetPidByTokenId()
779 return pid; in GetPidByTokenId()
782 void ClientInfo::UpdatePermState(int32_t pid, int32_t sensorId, bool state) in UpdatePermState() argument
790 auto clientInfo = it->second.find(pid); in UpdatePermState()
798 int32_t pid = GetPidByTokenId(tokenId); in ChangeSensorPerm() local
799 if (pid <= INVALID_PID) { in ChangeSensorPerm()
800 SEN_HILOGE("Invalid pid:%{public}d", pid); in ChangeSensorPerm()
809 UpdatePermState(pid, sensorId, state); in ChangeSensorPerm()