diff --git a/service/native/src/display_power_mgr_service.cpp b/service/native/src/display_power_mgr_service.cpp index c53a9f1ecfcdbf9f1bcac1109820f11a72953da6..97a00cdb2087defdb364711e153459c489764b9a 100644 --- a/service/native/src/display_power_mgr_service.cpp +++ b/service/native/src/display_power_mgr_service.cpp @@ -28,8 +28,8 @@ DisplayPowerMgrService::DisplayPowerMgrService() DISPLAY_HILOGI(MODULE_SERVICE, "DisplayPowerMgrService Create"); action_ = std::make_shared(); std::vector devIds = action_->GetDisplayIds(); - int count = devIds.size(); - for (int i = 0; i < count; i++) { + unsigned int count = devIds.size(); + for (unsigned int i = 0; i < count; i++) { DISPLAY_HILOGI(MODULE_SERVICE, "find display: %{public}d", static_cast(devIds[i])); controllerMap_.emplace(devIds[i], std::make_shared(devIds[i], action_)); } @@ -249,7 +249,7 @@ void DisplayPowerMgrService::AmbientLightCallback(SensorEvent *event) } AmbientLightData* data = (AmbientLightData*)event->data; DISPLAY_HILOGI(MODULE_SERVICE, "AmbientLightCallback: %{public}f", data->intensity); - int32_t brightness = mainDisp->second->GetBrightness(); + uint32_t brightness = mainDisp->second->GetBrightness(); if (pms->CalculateBrightness(data->intensity, brightness)) { pms->AdjustBrightness(mainDispId, brightness, AUTO_ADJUST_BRIGHTNESS_DURATION); }