diff --git a/window_scene/session_manager/src/screen_session_manager.cpp b/window_scene/session_manager/src/screen_session_manager.cpp index 7a48a10a6682653ab4c514ddda93f7277b200014..a597762b3279552cb81d3989d88753e172e906ba 100644 --- a/window_scene/session_manager/src/screen_session_manager.cpp +++ b/window_scene/session_manager/src/screen_session_manager.cpp @@ -191,7 +191,7 @@ DMError ScreenSessionManager::RegisterDisplayManagerAgent( } if (type < DisplayManagerAgentType::DISPLAY_POWER_EVENT_LISTENER || type > DisplayManagerAgentType::DISPLAY_MODE_CHANGED_LISTENER) { - WLOGFE("SCB:DisplayManagerAgentType: %{public}u", static_cast(type)); + WLOGFE("DisplayManagerAgentType: %{public}u", static_cast(type)); return DMError::DM_ERROR_INVALID_PARAM; } if ((displayManagerAgent == nullptr) || (displayManagerAgent->AsObject() == nullptr)) { @@ -279,7 +279,7 @@ void ScreenSessionManager::ConfigureWaterfallDisplayCompressionParams() void ScreenSessionManager::RegisterScreenChangeListener() { - WLOGFD("Register screen change listener."); + WLOGFI("Register screen change listener."); auto res = rsInterface_.SetScreenChangeCallback( [this](ScreenId screenId, ScreenEvent screenEvent) { OnScreenChange(screenId, screenEvent); }); if (res != StatusCode::SUCCESS) { @@ -383,7 +383,7 @@ sptr ScreenSessionManager::GetScreenSession(ScreenId screenId) co std::lock_guard lock(screenSessionMapMutex_); auto iter = screenSessionMap_.find(screenId); if (iter == screenSessionMap_.end()) { - WLOGFD("Error found screen session with id: %{public}" PRIu64"", screenId); + WLOGFI("Error found screen session with id: %{public}" PRIu64"", screenId); return nullptr; } return iter->second; @@ -415,12 +415,12 @@ sptr ScreenSessionManager::GetDisplayInfoById(DisplayId displayId) for (auto sessionIt : screenSessionMap_) { auto screenSession = sessionIt.second; if (screenSession == nullptr) { - WLOGFE("GetDisplayInfoById screenSession is nullptr, ScreenId: %{public}" PRIu64 "", sessionIt.first); + WLOGFI("GetDisplayInfoById screenSession is nullptr, ScreenId: %{public}" PRIu64 "", sessionIt.first); continue; } sptr displayInfo = screenSession->ConvertToDisplayInfo(); if (displayInfo == nullptr) { - WLOGFE("ConvertToDisplayInfo error, displayInfo is nullptr."); + WLOGFI("ConvertToDisplayInfo error, displayInfo is nullptr."); continue; } if (displayId == displayInfo->GetDisplayId()) { @@ -428,7 +428,7 @@ sptr ScreenSessionManager::GetDisplayInfoById(DisplayId displayId) return displayInfo; } } - WLOGFE("SCB: ScreenSessionManager::GetDisplayInfoById failed."); + WLOGFE("GetDisplayInfoById failed."); return nullptr; } @@ -438,19 +438,19 @@ sptr ScreenSessionManager::GetDisplayInfoByScreen(ScreenId screenId for (auto sessionIt : screenSessionMap_) { auto screenSession = sessionIt.second; if (screenSession == nullptr) { - WLOGFE("GetDisplayInfoByScreen screenSession is nullptr, ScreenId:%{public}" PRIu64"", sessionIt.first); + WLOGFI("GetDisplayInfoByScreen screenSession is nullptr, ScreenId:%{public}" PRIu64"", sessionIt.first); continue; } sptr displayInfo = screenSession->ConvertToDisplayInfo(); if (displayInfo == nullptr) { - WLOGFE("GetDisplayInfoByScreen error, displayInfo is nullptr."); + WLOGFI("GetDisplayInfoByScreen error, displayInfo is nullptr."); continue; } if (screenId == displayInfo->GetScreenId()) { return displayInfo; } } - WLOGFE("SCB: ScreenSessionManager::GetDisplayInfoByScreen failed."); + WLOGFE("GetDisplayInfoByScreen failed."); return nullptr; } @@ -479,12 +479,12 @@ std::vector ScreenSessionManager::GetAllDisplayIds() sptr ScreenSessionManager::GetScreenInfoById(ScreenId screenId) { if (!SessionPermission::IsSystemCalling()) { - WLOGFE("SCB: ScreenSessionManager::GetScreenInfoById permission denied!"); + WLOGFE("GetScreenInfoById permission denied!"); return nullptr; } auto screenSession = GetScreenSession(screenId); if (screenSession == nullptr) { - WLOGE("SCB: ScreenSessionManager::GetScreenInfoById cannot find screenInfo: %{public}" PRIu64"", screenId); + WLOGE("GetScreenInfoById cannot find screenInfo: %{public}" PRIu64"", screenId); return nullptr; } return screenSession->ConvertToScreenInfo(); @@ -533,6 +533,7 @@ void ScreenSessionManager::NotifyScreenChanged(sptr screenInfo, Scre WLOGFI("NotifyScreenChanged, screenId:%{public}" PRIu64"", screenInfo->GetScreenId()); auto agents = dmAgentContainer_.GetAgentsByType(DisplayManagerAgentType::SCREEN_EVENT_LISTENER); if (agents.empty()) { + WLOGFI("NotifyScreenChanged agents is empty"); return; } for (auto& agent : agents) { @@ -635,7 +636,7 @@ DMError ScreenSessionManager::GetScreenColorGamut(ScreenId screenId, ScreenColor { WLOGFI("GetScreenColorGamut::ScreenId: %{public}" PRIu64 "", screenId); if (screenId == SCREEN_ID_INVALID) { - WLOGFE("screenId invalid"); + WLOGFE("GetScreenColorGamut screenId invalid"); return DMError::DM_ERROR_INVALID_PARAM; } sptr screenSession = GetScreenSession(screenId); @@ -649,7 +650,7 @@ DMError ScreenSessionManager::SetScreenColorGamut(ScreenId screenId, int32_t col { WLOGFI("SetScreenColorGamut::ScreenId: %{public}" PRIu64 ", colorGamutIdx %{public}d", screenId, colorGamutIdx); if (screenId == SCREEN_ID_INVALID) { - WLOGFE("screenId invalid"); + WLOGFE("SetScreenColorGamut screenId invalid"); return DMError::DM_ERROR_INVALID_PARAM; } sptr screenSession = GetScreenSession(screenId); @@ -663,7 +664,7 @@ DMError ScreenSessionManager::GetScreenGamutMap(ScreenId screenId, ScreenGamutMa { WLOGFI("GetScreenGamutMap::ScreenId: %{public}" PRIu64 "", screenId); if (screenId == SCREEN_ID_INVALID) { - WLOGFE("screenId invalid"); + WLOGFE("GetScreenGamutMap screenId invalid"); return DMError::DM_ERROR_INVALID_PARAM; } sptr screenSession = GetScreenSession(screenId); @@ -678,7 +679,7 @@ DMError ScreenSessionManager::SetScreenGamutMap(ScreenId screenId, ScreenGamutMa WLOGFI("SetScreenGamutMap::ScreenId: %{public}" PRIu64 ", ScreenGamutMap %{public}u", screenId, static_cast(gamutMap)); if (screenId == SCREEN_ID_INVALID) { - WLOGFE("screenId invalid"); + WLOGFE("SetScreenGamutMap screenId invalid"); return DMError::DM_ERROR_INVALID_PARAM; } sptr screenSession = GetScreenSession(screenId); @@ -692,7 +693,7 @@ DMError ScreenSessionManager::SetScreenColorTransform(ScreenId screenId) { WLOGFI("SetScreenColorTransform::ScreenId: %{public}" PRIu64 "", screenId); if (screenId == SCREEN_ID_INVALID) { - WLOGFE("screenId invalid"); + WLOGFE("SetScreenColorTransform screenId invalid"); return DMError::DM_ERROR_INVALID_PARAM; } sptr screenSession = GetScreenSession(screenId); @@ -723,7 +724,7 @@ sptr ScreenSessionManager::GetScreenSessionInner(ScreenId screenI sptr ScreenSessionManager::GetOrCreateScreenSession(ScreenId screenId) { - WLOGFI("SCB: ScreenSessionManager::GetOrCreateScreenSession ENTER"); + WLOGFI("GetOrCreateScreenSession ENTER"); std::lock_guard lock(screenSessionMapMutex_); auto sessionIt = screenSessionMap_.find(screenId); if (sessionIt != screenSessionMap_.end()) { @@ -785,7 +786,7 @@ sptr ScreenSessionManager::GetOrCreateScreenSession(ScreenId scre void ScreenSessionManager::SetHdrFormats(ScreenId screenId, sptr& session) { - WLOGFI("SCB: ScreenSessionManager::SetHdrFormats %{public}" PRIu64, screenId); + WLOGFI("SetHdrFormats %{public}" PRIu64, screenId); std::vector rsHdrFormat; auto status = rsInterface_.GetScreenSupportedHDRFormats(screenId, rsHdrFormat); if (static_cast(status) != StatusCode::SUCCESS) { @@ -801,7 +802,7 @@ void ScreenSessionManager::SetHdrFormats(ScreenId screenId, sptr& void ScreenSessionManager::SetColorSpaces(ScreenId screenId, sptr& session) { - WLOGFI("SCB: ScreenSessionManager::SetColorSpaces %{public}" PRIu64, screenId); + WLOGFI("SetColorSpaces %{public}" PRIu64, screenId); std::vector rsColorSpace; auto status = rsInterface_.GetScreenSupportedColorSpaces(screenId, rsColorSpace); if (static_cast(status) != StatusCode::SUCCESS) { @@ -826,7 +827,7 @@ ScreenId ScreenSessionManager::GetDefaultScreenId() bool ScreenSessionManager::WakeUpBegin(PowerStateChangeReason reason) { HITRACE_METER_FMT(HITRACE_TAG_WINDOW_MANAGER, "ssm:WakeUpBegin(%u)", reason); - WLOGFI("ScreenSessionManager::WakeUpBegin remove suspend begin task"); + WLOGFI("WakeUpBegin remove suspend begin task"); blockScreenPowerChange_ = false; taskScheduler_->RemoveTask("suspendBeginTask"); if (reason == PowerStateChangeReason::STATE_CHANGE_REASON_COLLABORATION) { @@ -850,10 +851,10 @@ bool ScreenSessionManager::WakeUpEnd() bool ScreenSessionManager::SuspendBegin(PowerStateChangeReason reason) { HITRACE_METER_FMT(HITRACE_TAG_WINDOW_MANAGER, "ssm:SuspendBegin(%u)", reason); - WLOGFI("ScreenSessionManager::SuspendBegin block screen power change is true"); + WLOGFI("SuspendBegin block screen power change is true"); blockScreenPowerChange_ = true; auto suspendBeginTask = [this]() { - WLOGFI("ScreenSessionManager::SuspendBegin delay task start"); + WLOGFI("SuspendBegin delay task start"); blockScreenPowerChange_ = false; SetScreenPower(ScreenPowerStatus::POWER_STATUS_OFF, PowerStateChangeReason::STATE_CHANGE_REASON_INIT); }; @@ -868,7 +869,7 @@ bool ScreenSessionManager::SuspendBegin(PowerStateChangeReason reason) bool ScreenSessionManager::SuspendEnd() { - WLOGFI("ScreenSessionManager::SuspendEnd enter"); + WLOGFI("SuspendEnd enter"); HITRACE_METER_FMT(HITRACE_TAG_WINDOW_MANAGER, "ssm:SuspendEnd"); blockScreenPowerChange_ = false; if (isMultiScreenCollaboration_) { @@ -881,7 +882,7 @@ bool ScreenSessionManager::SuspendEnd() bool ScreenSessionManager::SetDisplayState(DisplayState state) { - WLOGFI("ScreenSessionManager::SetDisplayState enter"); + WLOGFI("SetDisplayState enter"); return sessionDisplayPowerController_->SetDisplayState(state); } @@ -932,13 +933,13 @@ bool ScreenSessionManager::SetScreenPowerForAll(ScreenPowerState state, PowerSta { ScreenPowerStatus status; if (blockScreenPowerChange_) { - WLOGFI("ScreenSessionManager::SetScreenPowerForAll block screen power change"); + WLOGFI("SetScreenPowerForAll block screen power change"); return true; } switch (state) { case ScreenPowerState::POWER_ON: { if (keyguardDrawnDone_) { - WLOGFI("ScreenSessionManager::SetScreenPowerForAll keyguardDrawnDone_ is true step 1"); + WLOGFI("SetScreenPowerForAll keyguardDrawnDone_ is true step 1"); status = ScreenPowerStatus::POWER_STATUS_ON; break; } else { @@ -948,7 +949,7 @@ bool ScreenSessionManager::SetScreenPowerForAll(ScreenPowerState state, PowerSta PowerStateChangeReason::STATE_CHANGE_REASON_INIT); needScreenOnWhenKeyguardNotify_ = false; keyguardDrawnDone_ = true; - WLOGFI("ScreenSessionManager::SetScreenPowerForAll keyguardDrawnDone_ is true step 2"); + WLOGFI("SetScreenPowerForAll keyguardDrawnDone_ is true step 2"); }; taskScheduler_->PostTask(task, "screenOnTask", 300); // Retry after 300 ms. return true; @@ -956,7 +957,7 @@ bool ScreenSessionManager::SetScreenPowerForAll(ScreenPowerState state, PowerSta } case ScreenPowerState::POWER_OFF: { keyguardDrawnDone_ = false; - WLOGFI("ScreenSessionManager::SetScreenPowerForAll keyguardDrawnDone_ is false"); + WLOGFI("SetScreenPowerForAll keyguardDrawnDone_ is false"); status = ScreenPowerStatus::POWER_STATUS_OFF; break; } @@ -970,10 +971,10 @@ bool ScreenSessionManager::SetScreenPowerForAll(ScreenPowerState state, PowerSta bool ScreenSessionManager::SetScreenPower(ScreenPowerStatus status, PowerStateChangeReason reason) { - WLOGFI("ScreenSessionManager::SetScreenPower enter status:%{public}u", status); + WLOGFI("SetScreenPower enter status:%{public}u", status); auto screenIds = GetAllScreenIds(); if (screenIds.empty()) { - WLOGFE("no screen info"); + WLOGFI("SetScreenPower screenIds empty"); return false; } @@ -1016,7 +1017,7 @@ void ScreenSessionManager::HandlerSensor(ScreenPowerStatus status) void ScreenSessionManager::BootFinishedCallback(const char *key, const char *value, void *context) { if (strcmp(key, BOOTEVENT_BOOT_COMPLETED.c_str()) == 0 && strcmp(value, "true") == 0) { - WLOGFI("ScreenSessionManager BootFinishedCallback boot animation finished"); + WLOGFI("BootFinishedCallback boot animation finished"); auto &that = *reinterpret_cast(context); that.SetDpiFromSettingData(); that.RegisterSettingDpiObserver(); @@ -1074,11 +1075,11 @@ DisplayState ScreenSessionManager::GetDisplayState(DisplayId displayId) void ScreenSessionManager::NotifyDisplayEvent(DisplayEvent event) { - WLOGFI("ScreenSessionManager::NotifyDisplayEvent receive keyguardDrawnDone"); + WLOGFI("NotifyDisplayEvent receive keyguardDrawnDone"); sessionDisplayPowerController_->NotifyDisplayEvent(event); if (event == DisplayEvent::KEYGUARD_DRAWN) { keyguardDrawnDone_ = true; - WLOGFI("ScreenSessionManager::NotifyDisplayEvent keyguardDrawnDone_ is true"); + WLOGFI("NotifyDisplayEvent keyguardDrawnDone_ is true"); if (needScreenOnWhenKeyguardNotify_) { taskScheduler_->RemoveTask("screenOnTask"); usleep(SLEEP_US); @@ -1088,14 +1089,14 @@ void ScreenSessionManager::NotifyDisplayEvent(DisplayEvent event) } if (event == DisplayEvent::SCREEN_LOCK_SUSPEND) { - WLOGFI("ScreenSessionManager::NotifyDisplayEvent screen lock suspend"); + WLOGFI("NotifyDisplayEvent screen lock suspend"); taskScheduler_->RemoveTask("suspendBeginTask"); blockScreenPowerChange_ = false; SetScreenPower(ScreenPowerStatus::POWER_STATUS_SUSPEND, PowerStateChangeReason::STATE_CHANGE_REASON_INIT); } if (event == DisplayEvent::SCREEN_LOCK_OFF) { - WLOGFI("ScreenSessionManager::NotifyDisplayEvent screen lock off"); + WLOGFI("NotifyDisplayEvent screen lock off"); taskScheduler_->RemoveTask("suspendBeginTask"); blockScreenPowerChange_ = false; SetScreenPower(ScreenPowerStatus::POWER_STATUS_OFF, PowerStateChangeReason::STATE_CHANGE_REASON_INIT); @@ -1112,7 +1113,7 @@ ScreenPowerState ScreenSessionManager::GetScreenPower(ScreenId screenId) DMError ScreenSessionManager::IsScreenRotationLocked(bool& isLocked) { if (!SessionPermission::IsSystemCalling() && !SessionPermission::IsStartByHdcd()) { - WLOGFE("SCB: ScreenSessionManager is screen rotation locked permission denied!"); + WLOGFE("screen rotation locked permission denied!"); return DMError::DM_ERROR_NOT_SYSTEM_APP; } sptr screenSession = GetDefaultScreenSession(); @@ -1121,14 +1122,14 @@ DMError ScreenSessionManager::IsScreenRotationLocked(bool& isLocked) return DMError::DM_ERROR_INVALID_PARAM; } isLocked = screenSession->IsScreenRotationLocked(); - WLOGFI("SCB: IsScreenRotationLocked:isLocked: %{public}u", isLocked); + WLOGFI("IsScreenRotationLocked:isLocked: %{public}u", isLocked); return DMError::DM_OK; } DMError ScreenSessionManager::SetScreenRotationLocked(bool isLocked) { if (!SessionPermission::IsSystemCalling() && !SessionPermission::IsStartByHdcd()) { - WLOGFE("SCB: ScreenSessionManager set screen rotation locked permission denied!"); + WLOGFE("set screen rotation locked permission denied!"); return DMError::DM_ERROR_NOT_SYSTEM_APP; } sptr screenSession = GetDefaultScreenSession(); @@ -1137,7 +1138,7 @@ DMError ScreenSessionManager::SetScreenRotationLocked(bool isLocked) return DMError::DM_ERROR_INVALID_PARAM; } screenSession->SetScreenRotationLocked(isLocked); - WLOGFI("SCB: SetScreenRotationLocked: isLocked: %{public}u", isLocked); + WLOGFI("SetScreenRotationLocked: isLocked: %{public}u", isLocked); return DMError::DM_OK; } @@ -1178,6 +1179,7 @@ void ScreenSessionManager::NotifyDisplayChanged(sptr displayInfo, D WLOGFI("NotifyDisplayChanged, displayId:%{public}" PRIu64"", displayInfo->GetDisplayId()); auto agents = dmAgentContainer_.GetAgentsByType(DisplayManagerAgentType::DISPLAY_EVENT_LISTENER); if (agents.empty()) { + WLOGFI("NotifyDisplayChanged agents is empty"); return; } for (auto& agent : agents) { @@ -1190,11 +1192,11 @@ void ScreenSessionManager::NotifyDisplayChanged(sptr displayInfo, D DMError ScreenSessionManager::SetOrientation(ScreenId screenId, Orientation orientation) { if (!SessionPermission::IsSystemCalling() && !SessionPermission::IsStartByHdcd()) { - WLOGFE("SCB: ScreenSessionManager set orientation permission denied!"); + WLOGFE("set orientation permission denied!"); return DMError::DM_ERROR_NOT_SYSTEM_APP; } if (orientation < Orientation::UNSPECIFIED || orientation > Orientation::REVERSE_HORIZONTAL) { - WLOGFE("SCB: ScreenSessionManager set orientation: %{public}u", static_cast(orientation)); + WLOGFE("set orientation: %{public}u", static_cast(orientation)); return DMError::DM_ERROR_INVALID_PARAM; } HITRACE_METER_FMT(HITRACE_TAG_WINDOW_MANAGER, "ssm:SetOrientation"); @@ -1265,7 +1267,7 @@ bool ScreenSessionManager::SetRotation(ScreenId screenId, Rotation rotationAfter WLOGFE("rotation not changed. screen %{public}" PRIu64" rotation %{public}u", screenId, rotationAfter); return false; } - WLOGFD("set orientation. rotation %{public}u", rotationAfter); + WLOGFI("set orientation. rotation %{public}u", rotationAfter); SetDisplayBoundary(screenSession); screenSession->SetRotation(rotationAfter); screenSession->PropertyChange(screenSession->GetScreenProperty(), ScreenPropertyChangeReason::ROTATION); @@ -1300,7 +1302,7 @@ sptr ScreenSessionManager::GetScreenModesByDisplayId(Displ { auto displayInfo = GetDisplayInfoById(displayId); if (displayInfo == nullptr) { - WLOGFW("can not get display."); + WLOGFE("can not get display."); return nullptr; } auto screenInfo = GetScreenInfoById(displayInfo->GetScreenId()); @@ -1332,6 +1334,7 @@ bool ScreenSessionManager::NotifyDisplayPowerEvent(DisplayPowerEvent event, Even { auto agents = dmAgentContainer_.GetAgentsByType(DisplayManagerAgentType::DISPLAY_POWER_EVENT_LISTENER); if (agents.empty()) { + WLOGFI("NotifyDisplayPowerEvent agents is empty"); return false; } WLOGFD("NotifyDisplayPowerEvent"); @@ -1341,7 +1344,7 @@ bool ScreenSessionManager::NotifyDisplayPowerEvent(DisplayPowerEvent event, Even auto screenIds = GetAllScreenIds(); if (screenIds.empty()) { - WLOGFE("NotifyDisplayPowerEvent no screen info"); + WLOGFI("NotifyDisplayPowerEvent no screen info"); return false; } @@ -1356,6 +1359,7 @@ bool ScreenSessionManager::NotifyDisplayStateChanged(DisplayId id, DisplayState { auto agents = dmAgentContainer_.GetAgentsByType(DisplayManagerAgentType::DISPLAY_STATE_LISTENER); if (agents.empty()) { + WLOGFI("NotifyDisplayStateChanged agents is empty"); return false; } WLOGFI("NotifyDisplayStateChanged"); @@ -1367,14 +1371,14 @@ bool ScreenSessionManager::NotifyDisplayStateChanged(DisplayId id, DisplayState DMError ScreenSessionManager::GetAllScreenInfos(std::vector>& screenInfos) { if (!SessionPermission::IsSystemCalling() && !SessionPermission::IsStartByHdcd()) { - WLOGFE("SCB: ScreenSessionManager::GetAllScreenInfos get all screen infos permission denied!"); + WLOGFE("GetAllScreenInfos get all screen infos permission denied!"); return DMError::DM_ERROR_NOT_SYSTEM_APP; } std::vector screenIds = GetAllScreenIds(); for (auto screenId : screenIds) { auto screenInfo = GetScreenInfoById(screenId); if (screenInfo == nullptr) { - WLOGE("SCB: ScreenSessionManager::GetAllScreenInfos cannot find screenInfo: %{public}" PRIu64"", screenId); + WLOGE("GetAllScreenInfos cannot find screenInfo: %{public}" PRIu64"", screenId); continue; } screenInfos.emplace_back(screenInfo); @@ -1395,14 +1399,14 @@ std::vector ScreenSessionManager::GetAllScreenIds() const DMError ScreenSessionManager::GetScreenSupportedColorGamuts(ScreenId screenId, std::vector& colorGamuts) { - WLOGFI("SCB: ScreenSessionManager::GetScreenSupportedColorGamuts ENTER"); + WLOGFI("GetScreenSupportedColorGamuts ENTER"); if (!SessionPermission::IsSystemCalling()) { - WLOGFE("SCB: ScreenSessionManager::GetScreenSupportedColorGamuts permission denied!"); + WLOGFE("GetScreenSupportedColorGamuts permission denied!"); return DMError::DM_ERROR_NOT_SYSTEM_APP; } sptr screen = GetScreenSession(screenId); if (screen == nullptr) { - WLOGFE("SCB: ScreenSessionManager::GetScreenSupportedColorGamuts nullptr"); + WLOGFE("GetScreenSupportedColorGamuts nullptr"); return DMError::DM_ERROR_INVALID_PARAM; } return screen->GetScreenSupportedColorGamuts(colorGamuts); @@ -1412,7 +1416,7 @@ DMError ScreenSessionManager::GetPixelFormat(ScreenId screenId, GraphicPixelForm { WLOGFI("GetPixelFormat::ScreenId: %{public}" PRIu64, screenId); if (screenId == SCREEN_ID_INVALID) { - WLOGFE("screenId invalid"); + WLOGFE("GetPixelFormat screenId invalid"); return DMError::DM_ERROR_INVALID_PARAM; } sptr screenSession = GetScreenSession(screenId); @@ -1426,7 +1430,7 @@ DMError ScreenSessionManager::SetPixelFormat(ScreenId screenId, GraphicPixelForm { WLOGFI("SetPixelFormat::ScreenId: %{public}" PRIu64 ", pixelFormat %{public}d", screenId, pixelFormat); if (screenId == SCREEN_ID_INVALID) { - WLOGFE("screenId invalid"); + WLOGFE("SetPixelFormat screenId invalid"); return DMError::DM_ERROR_INVALID_PARAM; } sptr screenSession = GetScreenSession(screenId); @@ -1439,10 +1443,10 @@ DMError ScreenSessionManager::SetPixelFormat(ScreenId screenId, GraphicPixelForm DMError ScreenSessionManager::GetSupportedHDRFormats(ScreenId screenId, std::vector& hdrFormats) { - WLOGFI("SCB: ScreenSessionManager::GetSupportedHDRFormats %{public}" PRIu64, screenId); + WLOGFI("GetSupportedHDRFormats %{public}" PRIu64, screenId); sptr screen = GetScreenSession(screenId); if (screen == nullptr) { - WLOGFE("SCB: ScreenSessionManager::GetSupportedHDRFormats nullptr"); + WLOGFE("GetSupportedHDRFormats nullptr"); return DMError::DM_ERROR_INVALID_PARAM; } return screen->GetSupportedHDRFormats(hdrFormats); @@ -1466,7 +1470,7 @@ DMError ScreenSessionManager::SetScreenHDRFormat(ScreenId screenId, int32_t mode { WLOGFI("SetScreenHDRFormat::ScreenId: %{public}" PRIu64 ", modeIdx %{public}d", screenId, modeIdx); if (screenId == SCREEN_ID_INVALID) { - WLOGFE("screenId invalid"); + WLOGFE("SetScreenHDRFormat screenId invalid"); return DMError::DM_ERROR_INVALID_PARAM; } sptr screenSession = GetScreenSession(screenId); @@ -1479,10 +1483,10 @@ DMError ScreenSessionManager::SetScreenHDRFormat(ScreenId screenId, int32_t mode DMError ScreenSessionManager::GetSupportedColorSpaces(ScreenId screenId, std::vector& colorSpaces) { - WLOGFI("SCB: ScreenSessionManager::GetSupportedColorSpaces %{public}" PRIu64, screenId); + WLOGFI("GetSupportedColorSpaces %{public}" PRIu64, screenId); sptr screenSession = GetScreenSession(screenId); if (screenSession == nullptr) { - WLOGFE("SCB: ScreenSessionManager::GetSupportedColorSpaces nullptr"); + WLOGFE("GetSupportedColorSpaces nullptr"); return DMError::DM_ERROR_INVALID_PARAM; } return screenSession->GetSupportedColorSpaces(colorSpaces); @@ -1506,7 +1510,7 @@ DMError ScreenSessionManager::SetScreenColorSpace(ScreenId screenId, GraphicCM_C { WLOGFI("SetScreenColorSpace::ScreenId: %{public}" PRIu64 ", colorSpace %{public}d", screenId, colorSpace); if (screenId == SCREEN_ID_INVALID) { - WLOGFE("screenId invalid"); + WLOGFE("SetScreenColorSpace screenId invalid"); return DMError::DM_ERROR_INVALID_PARAM; } sptr screenSession = GetScreenSession(screenId); @@ -1524,7 +1528,7 @@ ScreenId ScreenSessionManager::CreateVirtualScreen(VirtualScreenOption option, WLOGFE("create virtual screen permission denied!"); return SCREEN_ID_INVALID; } - WLOGFI("SCB: ScreenSessionManager::CreateVirtualScreen ENTER"); + WLOGFI("CreateVirtualScreen ENTER"); CheckAndSendHiSysEvent("CREATE_VIRTUAL_SCREEN", "ohos.screenrecorder"); @@ -1535,20 +1539,20 @@ ScreenId ScreenSessionManager::CreateVirtualScreen(VirtualScreenOption option, } ScreenId rsId = rsInterface_.CreateVirtualScreen(option.name_, option.width_, option.height_, option.surface_, SCREEN_ID_INVALID, option.flags_); - WLOGFI("SCB: ScreenSessionManager::CreateVirtualScreen rsid: %{public}" PRIu64"", rsId); + WLOGFI("CreateVirtualScreen rsid: %{public}" PRIu64"", rsId); if (rsId == SCREEN_ID_INVALID) { - WLOGFI("SCB: ScreenSessionManager::CreateVirtualScreen rsid is invalid"); + WLOGFI("CreateVirtualScreen rsid is invalid"); return SCREEN_ID_INVALID; } HITRACE_METER_FMT(HITRACE_TAG_WINDOW_MANAGER, "ssm:CreateVirtualScreen(%s)", option.name_.c_str()); std::lock_guard lock(screenSessionMapMutex_); ScreenId smsScreenId = SCREEN_ID_INVALID; if (!screenIdManager_.ConvertToSmsScreenId(rsId, smsScreenId)) { - WLOGFI("SCB: ScreenSessionManager::CreateVirtualScreen !ConvertToSmsScreenId(rsId, smsScreenId)"); + WLOGFI("CreateVirtualScreen !ConvertToSmsScreenId(rsId, smsScreenId)"); smsScreenId = screenIdManager_.CreateAndGetNewScreenId(rsId); auto screenSession = InitVirtualScreen(smsScreenId, rsId, option); if (screenSession == nullptr) { - WLOGFI("SCB: ScreenSessionManager::CreateVirtualScreen screenSession is nullptr"); + WLOGFI("CreateVirtualScreen screenSession is nullptr"); screenIdManager_.DeleteScreenId(smsScreenId); return SCREEN_ID_INVALID; } @@ -1556,7 +1560,7 @@ ScreenId ScreenSessionManager::CreateVirtualScreen(VirtualScreenOption option, screenSessionMap_.insert(std::make_pair(smsScreenId, screenSession)); NotifyScreenConnected(screenSession->ConvertToScreenInfo()); if (deathRecipient_ == nullptr) { - WLOGFI("SCB: ScreenSessionManager::CreateVirtualScreen Create deathRecipient"); + WLOGFI("CreateVirtualScreen Create deathRecipient"); deathRecipient_ = new AgentDeathRecipient([this](const sptr& agent) { OnRemoteDied(agent); }); } @@ -1569,7 +1573,7 @@ ScreenId ScreenSessionManager::CreateVirtualScreen(VirtualScreenOption option, } screenAgentMap_[displayManagerAgent].emplace_back(smsScreenId); } else { - WLOGFI("SCB: ScreenSessionManager::CreateVirtualScreen id: %{public}" PRIu64" in screenIdManager_", rsId); + WLOGFI("CreateVirtualScreen id: %{public}" PRIu64" in screenIdManager_", rsId); } return smsScreenId; } @@ -1581,7 +1585,7 @@ DMError ScreenSessionManager::SetVirtualScreenSurface(ScreenId screenId, sptr lock(screenSessionMapMutex_); ScreenId rsScreenId = SCREEN_ID_INVALID; screenIdManager_.ConvertToRsScreenId(screenId, rsScreenId); @@ -1690,13 +1694,13 @@ DMError ScreenSessionManager::DestroyVirtualScreen(ScreenId screenId) } screenSessionMap_.erase(smsScreenMapIter); NotifyScreenDisconnected(screenId); - WLOGFI("SCB: ScreenSessionManager::DestroyVirtualScreen id: %{public}" PRIu64"", screenId); + WLOGFI("DestroyVirtualScreen id: %{public}" PRIu64"", screenId); } } screenIdManager_.DeleteScreenId(screenId); if (rsScreenId == SCREEN_ID_INVALID) { - WLOGFE("SCB: ScreenSessionManager::DestroyVirtualScreen: No corresponding rsScreenId"); + WLOGFE("DestroyVirtualScreen: No corresponding rsScreenId"); return DMError::DM_ERROR_INVALID_PARAM; } rsInterface_.RemoveVirtualScreen(rsScreenId); @@ -1705,12 +1709,12 @@ DMError ScreenSessionManager::DestroyVirtualScreen(ScreenId screenId) DMError ScreenSessionManager::DisableMirror(bool disableOrNot) { - WLOGFI("SCB:ScreenSessionManager::DisableMirror %{public}d", disableOrNot); + WLOGFI("DisableMirror %{public}d", disableOrNot); if (!SessionPermission::IsSystemCalling()) { WLOGFI("DisableMirror permission denied!"); return DMError::DM_ERROR_NOT_SYSTEM_APP; } - WLOGFI("SCB:ScreenSessionManager::DisableMirror enter %{public}d", disableOrNot); + WLOGFI("DisableMirror enter %{public}d", disableOrNot); if (disableOrNot) { std::vector screenIds; auto allScreenIds = GetAllScreenIds(); @@ -1728,16 +1732,16 @@ DMError ScreenSessionManager::DisableMirror(bool disableOrNot) DMError ScreenSessionManager::MakeMirror(ScreenId mainScreenId, std::vector mirrorScreenIds, ScreenId& screenGroupId) { - WLOGFI("SCB:ScreenSessionManager::MakeMirror enter!"); + WLOGFI("MakeMirror enter!"); if (!SessionPermission::IsSystemCalling() && !SessionPermission::IsStartByHdcd()) { - WLOGFE("SCB:ScreenSessionManager::MakeMirror permission denied!"); + WLOGFE("MakeMirror permission denied!"); return DMError::DM_ERROR_NOT_SYSTEM_APP; } if (system::GetBoolParameter("persist.edm.disallow_mirror", false)) { - WLOGFW("SCB:ScreenSessionManager::MakeMirror was disabled by edm!"); + WLOGFW("MakeMirror was disabled by edm!"); return DMError::DM_ERROR_INVALID_PERMISSION; } - WLOGFI("SCB:ScreenSessionManager::MakeMirror mainScreenId :%{public}" PRIu64"", mainScreenId); + WLOGFI("MakeMirror mainScreenId :%{public}" PRIu64"", mainScreenId); auto allMirrorScreenIds = GetAllValidScreenIds(mirrorScreenIds); auto iter = std::find(allMirrorScreenIds.begin(), allMirrorScreenIds.end(), mainScreenId); if (iter != allMirrorScreenIds.end()) { @@ -1746,17 +1750,17 @@ DMError ScreenSessionManager::MakeMirror(ScreenId mainScreenId, std::vector(allMirrorScreenIds.size())); return DMError::DM_ERROR_INVALID_PARAM; } DMError ret = SetMirror(mainScreenId, allMirrorScreenIds); if (ret != DMError::DM_OK) { - WLOGFE("SCB:ScreenSessionManager::MakeMirror set mirror failed."); + WLOGFE("MakeMirror set mirror failed."); return ret; } if (GetAbstractScreenGroup(mainScreen->groupSmsId_) == nullptr) { - WLOGFE("SCB:ScreenSessionManager::MakeMirror get screen group failed."); + WLOGFE("MakeMirror get screen group failed."); return DMError::DM_ERROR_NULLPTR; } screenGroupId = mainScreen->groupSmsId_; @@ -1771,13 +1775,13 @@ DMError ScreenSessionManager::StopMirror(const std::vector& mirrorScre } auto allMirrorScreenIds = GetAllValidScreenIds(mirrorScreenIds); if (allMirrorScreenIds.empty()) { - WLOGFI("SCB: StopMirror done. screens' size:%{public}u", static_cast(allMirrorScreenIds.size())); + WLOGFI("StopMirror done. screens' size:%{public}u", static_cast(allMirrorScreenIds.size())); return DMError::DM_OK; } DMError ret = StopScreens(allMirrorScreenIds, ScreenCombination::SCREEN_MIRROR); if (ret != DMError::DM_OK) { - WLOGFE("SCB: StopMirror failed."); + WLOGFE("StopMirror failed."); return ret; } @@ -1787,24 +1791,24 @@ DMError ScreenSessionManager::StopMirror(const std::vector& mirrorScre DMError ScreenSessionManager::StopScreens(const std::vector& screenIds, ScreenCombination stopCombination) { for (ScreenId screenId : screenIds) { - WLOGFI("SCB: StopMirror ScreenId: %{public}" PRIu64"", screenId); + WLOGFI("StopScreens ScreenId: %{public}" PRIu64"", screenId); auto screen = GetScreenSession(screenId); if (screen == nullptr) { - WLOGFW("SCB: StopMirror screen:%{public}" PRIu64" is nullptr", screenId); + WLOGFW("StopScreens screen:%{public}" PRIu64" is nullptr", screenId); continue; } sptr screenGroup = GetAbstractScreenGroup(screen->groupSmsId_); if (!screenGroup) { - WLOGFW("SCB: StopMirror groupDmsId:%{public}" PRIu64"is not in smsScreenGroupMap_", screen->groupSmsId_); + WLOGFW("StopScreens groupDmsId:%{public}" PRIu64"is not in smsScreenGroupMap_", screen->groupSmsId_); continue; } if (screenGroup->combination_ != stopCombination) { - WLOGFW("SCB: StopMirror try to stop screen in another combination"); + WLOGFW("StopScreens try to stop screen in another combination"); continue; } if (screenGroup->combination_ == ScreenCombination::SCREEN_MIRROR && screen->screenId_ == screenGroup->mirrorScreenId_) { - WLOGFW("SCB: StopMirror try to stop main mirror screen"); + WLOGFW("StopScreens try to stop main mirror screen"); continue; } bool res = RemoveChildFromGroup(screen, screenGroup); @@ -1817,9 +1821,9 @@ DMError ScreenSessionManager::StopScreens(const std::vector& screenIds DMError ScreenSessionManager::MakeUniqueScreen(const std::vector& screenIds) { - WLOGFI("SCB:ScreenSessionManager::MakeUniqueScreen enter!"); + WLOGFI("MakeUniqueScreen enter!"); if (screenIds.empty()) { - WLOGFE("screen is empty"); + WLOGFE("MakeUniqueScreen screen is empty"); return DMError::DM_ERROR_INVALID_PARAM; } ScreenId mainScreenId = GetDefaultScreenId(); @@ -1855,9 +1859,9 @@ DMError ScreenSessionManager::MakeExpand(std::vector screenId, std::vector startPoint, ScreenId& screenGroupId) { - WLOGFI("SCB:ScreenSessionManager::MakeExpand enter!"); + WLOGFI("MakeExpand enter!"); if (!SessionPermission::IsSystemCalling() && !SessionPermission::IsStartByHdcd()) { - WLOGFE("SCB:ScreenSessionManager::MakeExpand permission denied!"); + WLOGFE("MakeExpand permission denied!"); return DMError::DM_ERROR_NOT_SYSTEM_APP; } if (screenId.empty() || startPoint.empty() || screenId.size() != startPoint.size()) { @@ -1937,13 +1941,13 @@ DMError ScreenSessionManager::StopExpand(const std::vector& expandScre } auto allExpandScreenIds = GetAllValidScreenIds(expandScreenIds); if (allExpandScreenIds.empty()) { - WLOGFI("SCB: StopExpand done. screens' size:%{public}u", static_cast(allExpandScreenIds.size())); + WLOGFI("StopExpand done. screens' size:%{public}u", static_cast(allExpandScreenIds.size())); return DMError::DM_OK; } DMError ret = StopScreens(allExpandScreenIds, ScreenCombination::SCREEN_EXPAND); if (ret != DMError::DM_OK) { - WLOGFE("SCB: StopExpand stop expand failed."); + WLOGFE("StopExpand stop expand failed."); return ret; } @@ -1990,16 +1994,16 @@ ScreenId ScreenSessionManager::ScreenIdManager::CreateAndGetNewScreenId(ScreenId { std::unique_lock lock(screenIdMapMutex_); ScreenId smsScreenId = smsScreenCount_++; - WLOGFI("SCB: ScreenSessionManager::CreateAndGetNewScreenId screenId: %{public}" PRIu64"", smsScreenId); + WLOGFI("CreateAndGetNewScreenId screenId: %{public}" PRIu64"", smsScreenId); if (sms2RsScreenIdMap_.find(smsScreenId) != sms2RsScreenIdMap_.end()) { - WLOGFW("SCB: ScreenSessionManager::CreateAndGetNewScreenId screenId: %{public}" PRIu64" exit", smsScreenId); + WLOGFW("CreateAndGetNewScreenId screenId: %{public}" PRIu64" exit", smsScreenId); } sms2RsScreenIdMap_[smsScreenId] = rsScreenId; if (rsScreenId == SCREEN_ID_INVALID) { return smsScreenId; } if (rs2SmsScreenIdMap_.find(rsScreenId) != rs2SmsScreenIdMap_.end()) { - WLOGFW("SCB: ScreenSessionManager::CreateAndGetNewScreenId rsScreenId: %{public}" PRIu64" exit", rsScreenId); + WLOGFW("CreateAndGetNewScreenId rsScreenId: %{public}" PRIu64" exit", rsScreenId); } rs2SmsScreenIdMap_[rsScreenId] = smsScreenId; return smsScreenId; @@ -2034,12 +2038,12 @@ bool ScreenSessionManager::ScreenIdManager::HasRsScreenId(ScreenId smsScreenId) sptr ScreenSessionManager::InitVirtualScreen(ScreenId smsScreenId, ScreenId rsId, VirtualScreenOption option) { - WLOGFI("SCB: ScreenSessionManager::InitVirtualScreen: Enter"); + WLOGFI("InitVirtualScreen: Enter"); sptr screenSession = new(std::nothrow) ScreenSession(option.name_, smsScreenId, rsId, GetDefaultScreenId()); sptr info = new(std::nothrow) SupportedScreenModes(); if (screenSession == nullptr || info == nullptr) { - WLOGFI("SCB: ScreenSessionManager::InitVirtualScreen: new screenSession or info failed"); + WLOGFI("InitVirtualScreen: new screenSession or info failed"); screenIdManager_.DeleteScreenId(smsScreenId); rsInterface_.RemoveVirtualScreen(rsId); return nullptr; @@ -2064,13 +2068,13 @@ bool ScreenSessionManager::InitAbstractScreenModesInfo(sptr& scre std::vector allModes = rsInterface_.GetScreenSupportedModes( screenIdManager_.ConvertToRsScreenId(screenSession->screenId_)); if (allModes.size() == 0) { - WLOGE("SCB: allModes.size() == 0, screenId=%{public}" PRIu64"", screenSession->rsId_); + WLOGE("allModes.size() == 0, screenId=%{public}" PRIu64"", screenSession->rsId_); return false; } for (const RSScreenModeInfo& rsScreenModeInfo : allModes) { sptr info = new(std::nothrow) SupportedScreenModes(); if (info == nullptr) { - WLOGFE("SCB: ScreenSessionManager::InitAbstractScreenModesInfo:create SupportedScreenModes failed"); + WLOGFE("InitAbstractScreenModesInfo:create SupportedScreenModes failed"); return false; } info->id_ = static_cast(rsScreenModeInfo.GetScreenModeId()); @@ -2078,13 +2082,13 @@ bool ScreenSessionManager::InitAbstractScreenModesInfo(sptr& scre info->height_ = static_cast(rsScreenModeInfo.GetScreenHeight()); info->refreshRate_ = rsScreenModeInfo.GetScreenRefreshRate(); screenSession->modes_.push_back(info); - WLOGI("SCB: fill screen idx:%{public}d w/h:%{public}d/%{public}d", + WLOGI("fill screen idx:%{public}d w/h:%{public}d/%{public}d", rsScreenModeInfo.GetScreenModeId(), info->width_, info->height_); } int32_t activeModeId = rsInterface_.GetScreenActiveMode(screenSession->rsId_).GetScreenModeId(); - WLOGI("SCB: ScreenSessionManager::InitAbstractScreenModesInfo: fill screen activeModeId:%{public}d", activeModeId); + WLOGI("InitAbstractScreenModesInfo: fill screen activeModeId:%{public}d", activeModeId); if (static_cast(activeModeId) >= allModes.size()) { - WLOGE("SCB: activeModeId exceed, screenId=%{public}" PRIu64", activeModeId:%{public}d/%{public}ud", + WLOGE("activeModeId exceed, screenId=%{public}" PRIu64", activeModeId:%{public}d/%{public}ud", screenSession->rsId_, activeModeId, static_cast(allModes.size())); return false; } @@ -2097,21 +2101,21 @@ sptr ScreenSessionManager::InitAndGetScreen(ScreenId rsScreenId) std::lock_guard lock(screenSessionMapMutex_); ScreenId smsScreenId = screenIdManager_.CreateAndGetNewScreenId(rsScreenId); RSScreenCapability screenCapability = rsInterface_.GetScreenCapability(rsScreenId); - WLOGFD("SCB: Screen name is %{public}s, phyWidth is %{public}u, phyHeight is %{public}u", + WLOGFI("Screen name is %{public}s, phyWidth is %{public}u, phyHeight is %{public}u", screenCapability.GetName().c_str(), screenCapability.GetPhyWidth(), screenCapability.GetPhyHeight()); sptr screenSession = new(std::nothrow) ScreenSession(screenCapability.GetName(), smsScreenId, rsScreenId, GetDefaultScreenId()); if (screenSession == nullptr) { - WLOGFE("SCB: ScreenSessionManager::InitAndGetScreen: screenSession == nullptr."); + WLOGFE("InitAndGetScreen: screenSession == nullptr."); screenIdManager_.DeleteScreenId(smsScreenId); return nullptr; } if (!InitAbstractScreenModesInfo(screenSession)) { screenIdManager_.DeleteScreenId(smsScreenId); - WLOGFE("SCB: ScreenSessionManager::InitAndGetScreen: InitAndGetScreen failed."); + WLOGFE("InitAndGetScreen: InitAndGetScreen failed."); return nullptr; } - WLOGI("SCB: InitAndGetScreen: screenSessionMap_ add screenId=%{public}" PRIu64"", smsScreenId); + WLOGI("InitAndGetScreen: screenSessionMap_ add screenId=%{public}" PRIu64"", smsScreenId); screenSessionMap_.insert(std::make_pair(smsScreenId, screenSession)); return screenSession; } @@ -2219,7 +2223,7 @@ bool ScreenSessionManager::RemoveChildFromGroup(sptr screen, sptr { bool res = screenGroup->RemoveChild(screen); if (!res) { - WLOGE("RemoveFromGroupLocked. remove screen:%{public}" PRIu64" failed from screenGroup:%{public}" PRIu64".", + WLOGE("RemoveChildFromGroup. remove screen:%{public}" PRIu64" failed from screenGroup:%{public}" PRIu64".", screen->screenId_, screen->groupSmsId_); return false; } @@ -2228,7 +2232,7 @@ bool ScreenSessionManager::RemoveChildFromGroup(sptr screen, sptr std::lock_guard lock(screenSessionMapMutex_); smsScreenGroupMap_.erase(screenGroup->screenId_); screenSessionMap_.erase(screenGroup->screenId_); - WLOGE("SCB: RemoveFromGroupLocked. screenSessionMap_ remove screen:%{public}" PRIu64"", screenGroup->screenId_); + WLOGE("RemoveChildFromGroup. screenSessionMap_ remove screen:%{public}" PRIu64"", screenGroup->screenId_); } return true; } @@ -2238,7 +2242,7 @@ DMError ScreenSessionManager::SetMirror(ScreenId screenId, std::vector WLOGI("SetMirror, screenId:%{public}" PRIu64"", screenId); sptr screen = GetScreenSession(screenId); if (screen == nullptr || screen->GetScreenProperty().GetScreenType() != ScreenType::REAL) { - WLOGFE("screen is nullptr, or screenType is not real."); + WLOGFE("SetMirror screen is nullptr, or screenType is not real."); return DMError::DM_ERROR_NULLPTR; } screen->groupSmsId_ = 1; @@ -2246,7 +2250,7 @@ DMError ScreenSessionManager::SetMirror(ScreenId screenId, std::vector if (group == nullptr) { group = AddToGroupLocked(screen); if (group == nullptr) { - WLOGFE("group is nullptr"); + WLOGFE("SetMirror group is nullptr"); return DMError::DM_ERROR_NULLPTR; } NotifyScreenGroupChanged(screen->ConvertToScreenInfo(), ScreenGroupChangeEvent::ADD_TO_GROUP); @@ -2294,13 +2298,13 @@ void ScreenSessionManager::ChangeScreenGroup(sptr group, con std::vector addChildPos; for (uint64_t i = 0; i != screens.size(); i++) { ScreenId screenId = screens[i]; - WLOGFI("ScreenId: %{public}" PRIu64"", screenId); + WLOGFI("ChangeScreenGroup ScreenId: %{public}" PRIu64"", screenId); auto screen = GetScreenSession(screenId); if (screen == nullptr) { - WLOGFE("screen:%{public}" PRIu64" is nullptr", screenId); + WLOGFE("ChangeScreenGroup screen:%{public}" PRIu64" is nullptr", screenId); continue; } - WLOGFI("Screen->groupSmsId_: %{public}" PRIu64"", screen->groupSmsId_); + WLOGFI("ChangeScreenGroup Screen->groupSmsId_: %{public}" PRIu64"", screen->groupSmsId_); screen->groupSmsId_ = 1; if (filterScreen && screen->groupSmsId_ == group->screenId_ && group->HasChild(screen->screenId_)) { continue; @@ -2331,7 +2335,7 @@ void ScreenSessionManager::AddScreenToGroup(sptr group, continue; } Point expandPoint = addChildPos[i]; - WLOGFI("screenId: %{public}" PRIu64", Point: %{public}d, %{public}d", + WLOGFI("AddScreenToGroup screenId: %{public}" PRIu64", Point: %{public}d, %{public}d", screen->screenId_, expandPoint.posX_, expandPoint.posY_); bool addChildRes = group->AddChild(screen, expandPoint, GetScreenSession(GetDefaultScreenId())); if (removeChildResMap[screenId] && addChildRes) { @@ -2356,9 +2360,9 @@ void ScreenSessionManager::AddScreenToGroup(sptr group, void ScreenSessionManager::RemoveVirtualScreenFromGroup(std::vector screens) { - WLOGFI("SCB: ScreenSessionManager::RemoveVirtualScreenFromGroup enter!"); + WLOGFI("RemoveVirtualScreenFromGroup enter!"); if (!SessionPermission::IsSystemCalling()) { - WLOGFE("SCB: ScreenSessionManager::RemoveVirtualScreenFromGroup permission denied!"); + WLOGFE("RemoveVirtualScreenFromGroup permission denied!"); return; } if (screens.empty()) { @@ -2388,11 +2392,11 @@ const std::shared_ptr ScreenSessionManager::GetRSDisplayNodeByScr static std::shared_ptr notFound = nullptr; sptr screen = GetScreenSession(smsScreenId); if (screen == nullptr) { - WLOGFE("SCB: ScreenSessionManager::GetRSDisplayNodeByScreenId screen == nullptr!"); + WLOGFE("GetRSDisplayNodeByScreenId screen == nullptr!"); return notFound; } if (screen->GetDisplayNode() == nullptr) { - WLOGFE("SCB: ScreenSessionManager::GetRSDisplayNodeByScreenId displayNode_ == nullptr!"); + WLOGFE("GetRSDisplayNodeByScreenId displayNode_ == nullptr!"); return notFound; } WLOGI("GetRSDisplayNodeByScreenId: screen: %{public}" PRIu64", nodeId: %{public}" PRIu64" ", @@ -2409,15 +2413,15 @@ std::shared_ptr ScreenSessionManager::GetScreenSnapshot(Display for (auto sessionIt : screenSessionMap_) { auto screenSession = sessionIt.second; if (screenSession == nullptr) { - WLOGFE("SCB: ScreenSessionManager::GetScreenSnapshot screenSession is nullptr!"); + WLOGFE("GetScreenSnapshot screenSession is nullptr!"); continue; } sptr displayInfo = screenSession->ConvertToDisplayInfo(); if (displayInfo == nullptr) { - WLOGFE("SCB: ScreenSessionManager::GetScreenSnapshot displayInfo is nullptr!"); + WLOGFE("GetScreenSnapshot displayInfo is nullptr!"); continue; } - WLOGI("SCB: GetScreenSnapshot: displayId %{public}" PRIu64"", displayInfo->GetDisplayId()); + WLOGI("GetScreenSnapshot: displayId %{public}" PRIu64"", displayInfo->GetDisplayId()); if (displayId == displayInfo->GetDisplayId()) { displayNode = screenSession->GetDisplayNode(); screenId = sessionIt.first; @@ -2426,23 +2430,23 @@ std::shared_ptr ScreenSessionManager::GetScreenSnapshot(Display } } if (screenId == SCREEN_ID_INVALID) { - WLOGFE("SCB: ScreenSessionManager::GetScreenSnapshot screenId == SCREEN_ID_INVALID!"); + WLOGFE("GetScreenSnapshot screenId == SCREEN_ID_INVALID!"); return nullptr; } if (displayNode == nullptr) { - WLOGFE("SCB: ScreenSessionManager::GetScreenSnapshot displayNode == nullptr!"); + WLOGFE("GetScreenSnapshot displayNode == nullptr!"); return nullptr; } std::shared_ptr callback = std::make_shared(); bool ret = rsInterface_.TakeSurfaceCapture(displayNode, callback); if (!ret) { - WLOGFE("SCB: ScreenSessionManager::GetScreenSnapshot TakeSurfaceCapture failed"); + WLOGFE("GetScreenSnapshot TakeSurfaceCapture failed"); return nullptr; } std::shared_ptr screenshot = callback->GetResult(2000); // wait for <= 2000ms if (screenshot == nullptr) { - WLOGFE("SCB: Failed to get pixelmap from RS, return nullptr!"); + WLOGFE("Failed to get pixelmap from RS, return nullptr!"); } // notify dm listener @@ -2456,10 +2460,10 @@ std::shared_ptr ScreenSessionManager::GetScreenSnapshot(Display std::shared_ptr ScreenSessionManager::GetDisplaySnapshot(DisplayId displayId, DmErrorCode* errorCode) { - WLOGFI("SCB: ScreenSessionManager::GetDisplaySnapshot ENTER!"); + WLOGFI("GetDisplaySnapshot ENTER!"); if (system::GetBoolParameter("persist.edm.disallow_screenshot", false)) { - WLOGFW("SCB: ScreenSessionManager::GetDisplaySnapshot was disabled by edm!"); + WLOGFI("GetDisplaySnapshot was disabled by edm!"); return nullptr; } if ((Permission::IsSystemCalling() && Permission::CheckCallingPermission(SCREEN_CAPTURE_PERMISSION)) || @@ -2518,12 +2522,12 @@ std::vector ScreenSessionManager::GetAllValidScreenIds(const std::vect sptr ScreenSessionManager::GetScreenGroupInfoById(ScreenId screenId) { if (!SessionPermission::IsSystemCalling()) { - WLOGFE("SCB: ScreenSessionManager::GetScreenGroupInfoById permission denied!"); + WLOGFE("GetScreenGroupInfoById permission denied!"); return nullptr; } auto screenSessionGroup = GetAbstractScreenGroup(screenId); if (screenSessionGroup == nullptr) { - WLOGE("SCB: GetScreenGroupInfoById cannot find screenGroupInfo: %{public}" PRIu64"", screenId); + WLOGE("GetScreenGroupInfoById cannot find screenGroupInfo: %{public}" PRIu64"", screenId); return nullptr; } return screenSessionGroup->ConvertToScreenGroupInfo(); @@ -2532,11 +2536,11 @@ sptr ScreenSessionManager::GetScreenGroupInfoById(ScreenId scre void ScreenSessionManager::NotifyScreenConnected(sptr screenInfo) { if (screenInfo == nullptr) { - WLOGFE("SCB: NotifyScreenConnected error, screenInfo is nullptr."); + WLOGFE("NotifyScreenConnected error, screenInfo is nullptr."); return; } auto task = [=] { - WLOGFI("SCB: NotifyScreenConnected, screenId:%{public}" PRIu64"", screenInfo->GetScreenId()); + WLOGFI("NotifyScreenConnected, screenId:%{public}" PRIu64"", screenInfo->GetScreenId()); OnScreenConnect(screenInfo); }; taskScheduler_->PostAsyncTask(task, "NotifyScreenConnected"); @@ -2545,7 +2549,7 @@ void ScreenSessionManager::NotifyScreenConnected(sptr screenInfo) void ScreenSessionManager::NotifyScreenDisconnected(ScreenId screenId) { auto task = [=] { - WLOGFI("NotifyScreenDisconnected, screenId:%{public}" PRIu64"", screenId); + WLOGFI("NotifyScreenDisconnected, screenId:%{public}" PRIu64"", screenId); OnScreenDisconnect(screenId); }; taskScheduler_->PostAsyncTask(task, "NotifyScreenDisconnected"); @@ -2587,7 +2591,7 @@ void ScreenSessionManager::NotifyScreenGroupChanged( } std::string trigger = SysCapUtil::GetClientName(); auto task = [=] { - WLOGFI("SCB: screenId:%{public}" PRIu64", trigger:[%{public}s]", screenInfo->GetScreenId(), trigger.c_str()); + WLOGFI("screenId:%{public}" PRIu64", trigger:[%{public}s]", screenInfo->GetScreenId(), trigger.c_str()); OnScreenGroupChange(trigger, screenInfo, event); }; taskScheduler_->PostAsyncTask(task, "NotifyScreenGroupChanged:PID"); @@ -2601,7 +2605,7 @@ void ScreenSessionManager::NotifyScreenGroupChanged( } std::string trigger = SysCapUtil::GetClientName(); auto task = [=] { - WLOGFI("SCB: trigger:[%{public}s]", trigger.c_str()); + WLOGFI("trigger:[%{public}s]", trigger.c_str()); OnScreenGroupChange(trigger, screenInfo, event); }; taskScheduler_->PostAsyncTask(task, "NotifyScreenGroupChanged"); @@ -2639,13 +2643,13 @@ void ScreenSessionManager::SetScreenPrivacyState(bool hasPrivate) DMError ScreenSessionManager::HasPrivateWindow(DisplayId id, bool& hasPrivateWindow) { if (!SessionPermission::IsSystemCalling() && !SessionPermission::IsStartByHdcd()) { - WLOGFE("SCB: ScreenSessionManager HasPrivateWindow permission denied!"); + WLOGFE("HasPrivateWindow permission denied!"); return DMError::DM_ERROR_NOT_SYSTEM_APP; } std::vector screenIds = GetAllScreenIds(); auto iter = std::find(screenIds.begin(), screenIds.end(), id); if (iter == screenIds.end()) { - WLOGFE("invalid displayId"); + WLOGFE("HasPrivateWindow invalid displayId"); return DMError::DM_ERROR_INVALID_PARAM; } auto screenSession = GetScreenSession(id); @@ -2653,7 +2657,7 @@ DMError ScreenSessionManager::HasPrivateWindow(DisplayId id, bool& hasPrivateWin return DMError::DM_ERROR_NULLPTR; } hasPrivateWindow = screenSession->HasPrivateSessionForeground(); - WLOGFD("id: %{public}" PRIu64" has private window: %{public}u", id, static_cast(hasPrivateWindow)); + WLOGFI("id: %{public}" PRIu64" has private window: %{public}u", id, static_cast(hasPrivateWindow)); return DMError::DM_OK; } @@ -2689,13 +2693,15 @@ void ScreenSessionManager::OnScreenGroupChange(const std::string& trigger, void ScreenSessionManager::OnScreenConnect(const sptr screenInfo) { if (screenInfo == nullptr) { + WLOGFE("OnScreenConnect screenInfo nullptr"); return; } auto agents = dmAgentContainer_.GetAgentsByType(DisplayManagerAgentType::SCREEN_EVENT_LISTENER); if (agents.empty()) { + WLOGFI("OnScreenConnect agents empty"); return; } - WLOGFI("SCB: OnScreenConnect"); + WLOGFI("OnScreenConnect"); for (auto& agent : agents) { agent->OnScreenConnect(screenInfo); } @@ -2705,9 +2711,10 @@ void ScreenSessionManager::OnScreenDisconnect(ScreenId screenId) { auto agents = dmAgentContainer_.GetAgentsByType(DisplayManagerAgentType::SCREEN_EVENT_LISTENER); if (agents.empty()) { + WLOGFI("OnScreenDisconnect agents empty"); return; } - WLOGFI("SCB: OnScreenDisconnect"); + WLOGFI("OnScreenDisconnect"); for (auto& agent : agents) { agent->OnScreenDisconnect(screenId); } @@ -2716,13 +2723,15 @@ void ScreenSessionManager::OnScreenDisconnect(ScreenId screenId) void ScreenSessionManager::OnScreenshot(sptr info) { if (info == nullptr) { + WLOGFE("OnScreenshot info is null"); return; } auto agents = dmAgentContainer_.GetAgentsByType(DisplayManagerAgentType::SCREENSHOT_EVENT_LISTENER); if (agents.empty()) { + WLOGFI("OnScreenshot agents empty"); return; } - WLOGFI("SCB: onScreenshot"); + WLOGFI("onScreenshot"); for (auto& agent : agents) { agent->OnScreenshot(info); } @@ -2736,7 +2745,7 @@ sptr ScreenSessionManager::GetCutoutInfo(DisplayId displayId) DMError ScreenSessionManager::HasImmersiveWindow(bool& immersive) { if (!clientProxy_) { - WLOGFE("clientProxy_ is null"); + WLOGFI("clientProxy_ is null"); return DMError::DM_ERROR_NULLPTR; } clientProxy_->OnImmersiveStateChanged(immersive); @@ -2858,7 +2867,7 @@ ScreenProperty ScreenSessionManager::GetPhyScreenProperty(ScreenId screenId) ScreenProperty property; auto iter = phyScreenPropMap_.find(screenId); if (iter == phyScreenPropMap_.end()) { - WLOGFD("Error found physic screen config with id: %{public}" PRIu64, screenId); + WLOGFI("Error found physic screen config with id: %{public}" PRIu64, screenId); return property; } return iter->second; @@ -2867,7 +2876,7 @@ ScreenProperty ScreenSessionManager::GetPhyScreenProperty(ScreenId screenId) void ScreenSessionManager::SetFoldDisplayMode(const FoldDisplayMode displayMode) { if (foldScreenController_ == nullptr) { - WLOGFW("SetFoldDisplayMode foldScreenController_ is null"); + WLOGFI("SetFoldDisplayMode foldScreenController_ is null"); return; } if (!SessionPermission::IsSystemCalling()) { @@ -2880,7 +2889,7 @@ void ScreenSessionManager::SetFoldDisplayMode(const FoldDisplayMode displayMode) void ScreenSessionManager::SetFoldStatusLocked(bool locked) { if (foldScreenController_ == nullptr) { - WLOGFW("SetFoldStatusLocked foldScreenController_ is null"); + WLOGFI("SetFoldStatusLocked foldScreenController_ is null"); return; } if (!SessionPermission::IsSystemCalling()) { @@ -2893,7 +2902,7 @@ void ScreenSessionManager::SetFoldStatusLocked(bool locked) FoldDisplayMode ScreenSessionManager::GetFoldDisplayMode() { if (foldScreenController_ == nullptr) { - WLOGFW("GetFoldDisplayMode foldScreenController_ is null"); + WLOGFI("GetFoldDisplayMode foldScreenController_ is null"); return FoldDisplayMode::UNKNOWN; } return foldScreenController_->GetDisplayMode(); @@ -2902,7 +2911,7 @@ FoldDisplayMode ScreenSessionManager::GetFoldDisplayMode() bool ScreenSessionManager::IsFoldable() { if (foldScreenController_ == nullptr) { - WLOGFD("foldScreenController_ is null"); + WLOGFI("foldScreenController_ is null"); return false; } return foldScreenController_->IsFoldable(); @@ -2916,7 +2925,7 @@ bool ScreenSessionManager::IsMultiScreenCollaboration() FoldStatus ScreenSessionManager::GetFoldStatus() { if (foldScreenController_ == nullptr) { - WLOGFD("foldScreenController_ is null"); + WLOGFI("foldScreenController_ is null"); return FoldStatus::UNKNOWN; } return foldScreenController_->GetFoldStatus(); @@ -2925,7 +2934,7 @@ FoldStatus ScreenSessionManager::GetFoldStatus() sptr ScreenSessionManager::GetCurrentFoldCreaseRegion() { if (foldScreenController_ == nullptr) { - WLOGFW("foldScreenController_ is null"); + WLOGFI("foldScreenController_ is null"); return nullptr; } return foldScreenController_->GetCurrentFoldCreaseRegion(); @@ -2941,6 +2950,7 @@ void ScreenSessionManager::NotifyFoldStatusChanged(FoldStatus foldStatus) WLOGI("NotifyFoldStatusChanged foldStatus:%{public}d", foldStatus); auto agents = dmAgentContainer_.GetAgentsByType(DisplayManagerAgentType::FOLD_STATUS_CHANGED_LISTENER); if (agents.empty()) { + WLOGI("NotifyFoldStatusChanged agents is empty"); return; } for (auto& agent : agents) { @@ -2952,6 +2962,7 @@ void ScreenSessionManager::NotifyDisplayChangeInfoChanged(const sptrSetDisplayNodeScreenId(screenId, displayNodeScreenId); @@ -2987,7 +2999,7 @@ void ScreenSessionManager::OnPropertyChange(const ScreenProperty& newProperty, S { WLOGFI("screenId: %{public}" PRIu64 " reason: %{public}d", screenId, static_cast(reason)); if (!clientProxy_) { - WLOGFD("clientProxy_ is null"); + WLOGFI("OnPropertyChange clientProxy_ is null"); return; } clientProxy_->OnPropertyChanged(screenId, newProperty, reason); @@ -2999,7 +3011,7 @@ void ScreenSessionManager::OnPowerStatusChange(DisplayPowerEvent event, EventSta WLOGFI("event: %{public}d, status: %{public}d, reason: %{public}d", static_cast(event), static_cast(status), static_cast(reason)); if (!clientProxy_) { - WLOGFD("clientProxy_ is null"); + WLOGFI("OnPowerStatusChange clientProxy_ is null"); return; } clientProxy_->OnPowerStatusChanged(event, status, reason); @@ -3009,7 +3021,7 @@ void ScreenSessionManager::OnSensorRotationChange(float sensorRotation, ScreenId { WLOGFI("screenId: %{public}" PRIu64 " sensorRotation: %{public}f", screenId, sensorRotation); if (!clientProxy_) { - WLOGFD("clientProxy_ is null"); + WLOGFI("OnSensorRotationChange clientProxy_ is null"); return; } clientProxy_->OnSensorRotationChanged(screenId, sensorRotation); @@ -3019,7 +3031,7 @@ void ScreenSessionManager::OnScreenOrientationChange(float screenOrientation, Sc { WLOGFI("screenId: %{public}" PRIu64 " screenOrientation: %{public}f", screenId, screenOrientation); if (!clientProxy_) { - WLOGFD("clientProxy_ is null"); + WLOGFI("OnScreenOrientationChange clientProxy_ is null"); return; } clientProxy_->OnScreenOrientationChanged(screenId, screenOrientation); @@ -3029,7 +3041,7 @@ void ScreenSessionManager::OnScreenRotationLockedChange(bool isLocked, ScreenId { WLOGFI("screenId: %{public}" PRIu64 " isLocked: %{public}d", screenId, isLocked); if (!clientProxy_) { - WLOGFD("clientProxy_ is null"); + WLOGFI("OnScreenRotationLockedChange clientProxy_ is null"); return; } clientProxy_->OnScreenRotationLockedChanged(screenId, isLocked); @@ -3038,7 +3050,7 @@ void ScreenSessionManager::OnScreenRotationLockedChange(bool isLocked, ScreenId void ScreenSessionManager::SetClient(const sptr& client) { if (!client) { - WLOGFE("client is null"); + WLOGFI("SetClient client is null"); return; } auto userId = GetUserIdByCallingUid(); @@ -3079,7 +3091,7 @@ void ScreenSessionManager::SetClient(const sptr& cl bool isModeChanged = (localScreenBounds.rect_.width_ < localScreenBounds.rect_.height_) != (phyWidth < phyHeight); if (isModeChanged && isReset) { - WLOGFI("[WMSRecover]screen(id:%{public}" PRIu64 ") current mode is not default mode, reset it", iter.first); + WLOGFI("[WMSRecover]screen(id:%{public}" PRIu64 ") current is not default mode, reset it", iter.first); SetRotation(iter.first, Rotation::ROTATION_0, false); iter.second->SetDisplayBoundary(RectF(0, 0, phyWidth, phyHeight), 0); } @@ -3092,7 +3104,7 @@ ScreenProperty ScreenSessionManager::GetScreenProperty(ScreenId screenId) { auto screenSession = GetScreenSession(screenId); if (!screenSession) { - WLOGFE("screenSession is null"); + WLOGFI("GetScreenProperty screenSession is null"); return {}; } return screenSession->GetScreenProperty(); @@ -3102,7 +3114,7 @@ std::shared_ptr ScreenSessionManager::GetDisplayNode(ScreenId scr { auto screenSession = GetScreenSession(screenId); if (!screenSession) { - WLOGFE("screenSession is null"); + WLOGFE("GetDisplayNode screenSession is null"); return nullptr; } return screenSession->GetDisplayNode(); @@ -3269,6 +3281,7 @@ void ScreenSessionManager::NotifyAvailableAreaChanged(DMRect area) WLOGI("NotifyAvailableAreaChanged call"); auto agents = dmAgentContainer_.GetAgentsByType(DisplayManagerAgentType::AVAILABLE_AREA_CHANGED_LISTENER); if (agents.empty()) { + WLOGI("NotifyAvailableAreaChanged agents is empty"); return; } for (auto& agent : agents) { @@ -3307,7 +3320,7 @@ void ScreenSessionManager::UpdateAvailableArea(ScreenId screenId, DMRect area) void ScreenSessionManager::NotifyFoldToExpandCompletion(bool foldToExpand) { - WLOGFI("ScreenSessionManager::NotifyFoldToExpandCompletion"); + WLOGFI("NotifyFoldToExpandCompletion ENTER"); SetDisplayNodeScreenId(SCREEN_ID_FULL, foldToExpand ? SCREEN_ID_FULL : SCREEN_ID_MAIN); sptr screenSession = GetDefaultScreenSession(); if (screenSession == nullptr) {