mirror of
https://github.com/openharmony/windowmanager.git
synced 2026-07-21 12:35:22 -04:00
check screen connection in display controller init
Signed-off-by: wangxinpeng <wangxinpeng4@huawei.com> Change-Id: Ia480d042d4b2e90a013cab7ceb8772a9cd7d7579
This commit is contained in:
@@ -42,6 +42,7 @@ public:
|
||||
~AbstractScreenController();
|
||||
|
||||
void Init();
|
||||
void ScreenConnectionInDisplayInit(sptr<AbstractScreenCallback> abstractScreenCallback);
|
||||
std::vector<ScreenId> GetAllScreenIds();
|
||||
sptr<AbstractScreen> GetAbstractScreen(ScreenId dmsScreenId) const;
|
||||
std::vector<ScreenId> GetShotScreenIds(std::vector<ScreenId>) const;
|
||||
|
||||
@@ -52,6 +52,7 @@ void AbstractDisplayController::Init(sptr<AbstractScreenController> abstractScre
|
||||
abstractScreenCallback_->onChange_
|
||||
= std::bind(&AbstractDisplayController::OnAbstractScreenChange, this, std::placeholders::_1,
|
||||
std::placeholders::_2);
|
||||
abstractScreenController_->ScreenConnectionInDisplayInit(abstractScreenCallback_);
|
||||
abstractScreenController->RegisterAbstractScreenCallback(abstractScreenCallback_);
|
||||
|
||||
// TODO: Active the code after "rsDisplayNode_->SetScreenId(rsScreenId)" is provided.
|
||||
|
||||
@@ -234,6 +234,20 @@ void AbstractScreenController::OnRsScreenConnectionChange(ScreenId rsScreenId, S
|
||||
}
|
||||
}
|
||||
|
||||
void AbstractScreenController::ScreenConnectionInDisplayInit(sptr<AbstractScreenCallback> abstractScreenCallback)
|
||||
{
|
||||
std::lock_guard<std::recursive_mutex> lock(mutex_);
|
||||
if (dmsScreenMap_.empty()) {
|
||||
return;
|
||||
}
|
||||
for (auto& iter : dmsScreenMap_) {
|
||||
if (iter.second != nullptr && abstractScreenCallback != nullptr) {
|
||||
WLOGFI("dmsScreenId :%{public}" PRIu64"", iter.first);
|
||||
abstractScreenCallback->onConnect_(iter.second);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void AbstractScreenController::ProcessScreenModeChanged(ScreenId rsScreenId)
|
||||
{
|
||||
WM_SCOPED_TRACE("dms:ProcessScreenModeChanged(%" PRIu64")", rsScreenId);
|
||||
|
||||
Reference in New Issue
Block a user