diff --git a/frameworks/native/src/sensor_service_client.cpp b/frameworks/native/src/sensor_service_client.cpp index b258b56595b52453ca27da4d29c6ba81960ec9db..9622a751009f4b54af9fdf8a71a8a461df497dbb 100755 --- a/frameworks/native/src/sensor_service_client.cpp +++ b/frameworks/native/src/sensor_service_client.cpp @@ -100,6 +100,7 @@ int32_t SensorServiceClient::InitServiceClient() bool SensorServiceClient::IsValid(int32_t sensorId) { + SEN_HILOGI("SensorServiceClient::IsValid already started, sensorId:%{public}d", sensorId); int32_t ret = InitServiceClient(); if (ret != ERR_OK) { SEN_HILOGE("InitServiceClient failed, ret:%{public}d", ret); @@ -431,6 +432,7 @@ void SensorServiceClient::ReceiveMessage(const char *buf, size_t size) void SensorServiceClient::HandleNetPacke(NetPacket &pkt) { + SEN_HILOGE("SensorServiceClient::HandleNetPacke already started"); auto id = pkt.GetMsgId(); if (id != MessageId::ACTIVE_INFO) { SEN_HILOGE("NetPacke message id is not ACTIVE_INFO"); diff --git a/services/src/sensor_service.cpp b/services/src/sensor_service.cpp index 58db772bfe909c300904d28ea54bf4c6030c8f81..8421bccfbde6ec3d4b87928245b788f387518bd0 100644 --- a/services/src/sensor_service.cpp +++ b/services/src/sensor_service.cpp @@ -51,12 +51,12 @@ SensorService::~SensorService() {} void SensorService::OnDump() { - SEN_HILOGI("OnDump"); + SEN_HILOGI("SensorService::OnDump already started"); } void SensorService::OnStart() { - CALL_LOG_ENTER; + SEN_HILOGI("SensorService::OnStart already started"); if (state_ == SensorServiceState::STATE_RUNNING) { SEN_HILOGW("SensorService has already started"); return; @@ -96,6 +96,7 @@ void SensorService::OnStart() #ifdef HDF_DRIVERS_INTERFACE_SENSOR bool SensorService::InitInterface() { + SEN_HILOGI("SensorService::InitInterface already started"); auto ret = sensorHdiConnection_.ConnectHdi(); if (ret != ERR_OK) { SEN_HILOGE("Connect hdi failed"); @@ -106,6 +107,7 @@ bool SensorService::InitInterface() bool SensorService::InitDataCallback() { + SEN_HILOGI("SensorService::InitDataCallback already started"); reportDataCallback_ = new (std::nothrow) ReportDataCallback(); CHKPF(reportDataCallback_); ReportDataCb cb = &ReportDataCallback::ReportEventCallback; @@ -119,6 +121,7 @@ bool SensorService::InitDataCallback() bool SensorService::InitSensorList() { + SEN_HILOGI("SensorService::InitSensorList already started"); std::lock_guard sensorLock(sensorsMutex_); int32_t ret = sensorHdiConnection_.GetSensorList(sensors_); if (ret != 0) { @@ -139,12 +142,13 @@ bool SensorService::InitSensorList() bool SensorService::InitSensorPolicy() { + SEN_HILOGI("SensorService::InitSensorPolicy already started"); return true; } void SensorService::OnStop() { - CALL_LOG_ENTER; + SEN_HILOGI("SensorService::OnStop already started"); if (state_ == SensorServiceState::STATE_STOPPED) { SEN_HILOGW("Already stopped"); return; @@ -160,7 +164,7 @@ void SensorService::OnStop() } void SensorService::ReportSensorSysEvent(int32_t sensorId, bool enable, int32_t pid) -{ +{ std::string packageName(""); AccessTokenID tokenId = clientInfo_.GetTokenIdByPid(pid); sensorManager_.GetPackageName(tokenId, packageName); @@ -177,6 +181,7 @@ void SensorService::ReportSensorSysEvent(int32_t sensorId, bool enable, int32_t void SensorService::ReportOnChangeData(int32_t sensorId) { + SEN_HILOGI("SensorService::ReportOnChangeDat already started, sensorId:%{public}d", sensorId); std::lock_guard sensorMapLock(sensorMapMutex_); auto it = sensorMap_.find(sensorId); if (it == sensorMap_.end()) { @@ -203,7 +208,7 @@ void SensorService::ReportOnChangeData(int32_t sensorId) } ErrCode SensorService::SaveSubscriber(int32_t sensorId, int64_t samplingPeriodNs, int64_t maxReportDelayNs) -{ +{ if (!sensorManager_.SaveSubscriber(sensorId, GetCallingPid(), samplingPeriodNs, maxReportDelayNs)) { SEN_HILOGE("SaveSubscriber failed"); return UPDATE_SENSOR_INFO_ERR; @@ -234,7 +239,7 @@ bool SensorService::CheckSensorId(int32_t sensorId) ErrCode SensorService::EnableSensor(int32_t sensorId, int64_t samplingPeriodNs, int64_t maxReportDelayNs) { - CALL_LOG_ENTER; + SEN_HILOGI("SensorService::EnableSensor already started"); if ((!CheckSensorId(sensorId)) || ((samplingPeriodNs != 0L) && ((maxReportDelayNs / samplingPeriodNs) > MAX_EVENT_COUNT))) { SEN_HILOGE("sensorId is invalid or maxReportDelayNs exceeded the maximum value"); @@ -320,6 +325,7 @@ ErrCode SensorService::DisableSensor(int32_t sensorId) std::vector SensorService::GetSensorList() { + SEN_HILOGI("SensorService::GetSensorList already started"); std::lock_guard sensorLock(sensorsMutex_); #ifdef HDF_DRIVERS_INTERFACE_SENSOR int32_t ret = sensorHdiConnection_.GetSensorList(sensors_);