Loading services/inputflinger/reader/InputDevice.cpp +6 −0 Original line number Diff line number Diff line Loading @@ -265,6 +265,8 @@ std::list<NotifyArgs> InputDevice::configureInternal(nsecs_t when, } if (!changes.any() || changes.test(Change::DISPLAY_INFO)) { const auto oldAssociatedDisplayId = getAssociatedDisplayId(); // In most situations, no port or name will be specified. mAssociatedDisplayPort = std::nullopt; mAssociatedDisplayUniqueId = std::nullopt; Loading Loading @@ -306,6 +308,10 @@ std::list<NotifyArgs> InputDevice::configureInternal(nsecs_t when, getName().c_str(), mAssociatedDisplayUniqueId->c_str()); } } if (getAssociatedDisplayId() != oldAssociatedDisplayId) { bumpGeneration(); } } for_each_mapper([this, when, &readerConfig, changes, &out](InputMapper& mapper) { Loading services/inputflinger/tests/InputReader_test.cpp +3 −0 Original line number Diff line number Diff line Loading @@ -2893,9 +2893,12 @@ TEST_F(InputDeviceTest, Configure_UniqueId_CorrectlyMatches) { mFakePolicy->addDisplayViewport(SECONDARY_DISPLAY_ID, DISPLAY_WIDTH, DISPLAY_HEIGHT, ui::ROTATION_0, /* isActive= */ true, DISPLAY_UNIQUE_ID, NO_PORT, ViewportType::INTERNAL); const auto initialGeneration = mDevice->getGeneration(); unused += mDevice->configure(ARBITRARY_TIME, mFakePolicy->getReaderConfiguration(), InputReaderConfiguration::Change::DISPLAY_INFO); ASSERT_EQ(DISPLAY_UNIQUE_ID, mDevice->getAssociatedDisplayUniqueId()); ASSERT_GT(mDevice->getGeneration(), initialGeneration); ASSERT_EQ(mDevice->getDeviceInfo().getAssociatedDisplayId(), SECONDARY_DISPLAY_ID); } /** Loading Loading
services/inputflinger/reader/InputDevice.cpp +6 −0 Original line number Diff line number Diff line Loading @@ -265,6 +265,8 @@ std::list<NotifyArgs> InputDevice::configureInternal(nsecs_t when, } if (!changes.any() || changes.test(Change::DISPLAY_INFO)) { const auto oldAssociatedDisplayId = getAssociatedDisplayId(); // In most situations, no port or name will be specified. mAssociatedDisplayPort = std::nullopt; mAssociatedDisplayUniqueId = std::nullopt; Loading Loading @@ -306,6 +308,10 @@ std::list<NotifyArgs> InputDevice::configureInternal(nsecs_t when, getName().c_str(), mAssociatedDisplayUniqueId->c_str()); } } if (getAssociatedDisplayId() != oldAssociatedDisplayId) { bumpGeneration(); } } for_each_mapper([this, when, &readerConfig, changes, &out](InputMapper& mapper) { Loading
services/inputflinger/tests/InputReader_test.cpp +3 −0 Original line number Diff line number Diff line Loading @@ -2893,9 +2893,12 @@ TEST_F(InputDeviceTest, Configure_UniqueId_CorrectlyMatches) { mFakePolicy->addDisplayViewport(SECONDARY_DISPLAY_ID, DISPLAY_WIDTH, DISPLAY_HEIGHT, ui::ROTATION_0, /* isActive= */ true, DISPLAY_UNIQUE_ID, NO_PORT, ViewportType::INTERNAL); const auto initialGeneration = mDevice->getGeneration(); unused += mDevice->configure(ARBITRARY_TIME, mFakePolicy->getReaderConfiguration(), InputReaderConfiguration::Change::DISPLAY_INFO); ASSERT_EQ(DISPLAY_UNIQUE_ID, mDevice->getAssociatedDisplayUniqueId()); ASSERT_GT(mDevice->getGeneration(), initialGeneration); ASSERT_EQ(mDevice->getDeviceInfo().getAssociatedDisplayId(), SECONDARY_DISPLAY_ID); } /** Loading