diff options
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2023-01-07 02:21:13 +0000 |
---|---|---|
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2023-01-07 02:21:13 +0000 |
commit | d1735f8e6ff1737e6aa93e3d92f2b5852e523fd6 (patch) | |
tree | b4c3954a40d3f42e1cf68f463310afd1c706cc57 | |
parent | d37705c68635613f94ef6eafe176d5f512d8014e (diff) | |
parent | 0130e8f33718eae2a486352bf733e3ccbde3d4a6 (diff) | |
download | native-android13-qpr2-s2-release.tar.gz |
Snap for 9463735 from 0130e8f33718eae2a486352bf733e3ccbde3d4a6 to tm-qpr2-releaseandroid-13.0.0_r37android-13.0.0_r36android-13.0.0_r35android-13.0.0_r34android-13.0.0_r33android-13.0.0_r32android13-qpr2-s6-releaseandroid13-qpr2-s5-releaseandroid13-qpr2-s3-releaseandroid13-qpr2-s2-releaseandroid13-qpr2-s1-release
Change-Id: Ia0dc88dae1bd1f54fcdf89a681067485fc40be4f
-rw-r--r-- | services/inputflinger/dispatcher/InputDispatcher.cpp | 11 | ||||
-rw-r--r-- | services/inputflinger/tests/InputDispatcher_test.cpp | 53 | ||||
-rw-r--r-- | services/surfaceflinger/SurfaceFlinger.cpp | 6 | ||||
-rw-r--r-- | services/surfaceflinger/SurfaceFlinger.h | 5 |
4 files changed, 5 insertions, 70 deletions
diff --git a/services/inputflinger/dispatcher/InputDispatcher.cpp b/services/inputflinger/dispatcher/InputDispatcher.cpp index 3267753712..5c47be9be0 100644 --- a/services/inputflinger/dispatcher/InputDispatcher.cpp +++ b/services/inputflinger/dispatcher/InputDispatcher.cpp @@ -4727,13 +4727,10 @@ void InputDispatcher::setInputWindowsLocked( updateWindowHandlesForDisplayLocked(windowInfoHandles, displayId); const std::vector<sp<WindowInfoHandle>>& windowHandles = getWindowHandlesLocked(displayId); - if (mLastHoverWindowHandle) { - const WindowInfo* lastHoverWindowInfo = mLastHoverWindowHandle->getInfo(); - if (lastHoverWindowInfo->displayId == displayId && - std::find(windowHandles.begin(), windowHandles.end(), mLastHoverWindowHandle) == - windowHandles.end()) { - mLastHoverWindowHandle = nullptr; - } + if (mLastHoverWindowHandle && + std::find(windowHandles.begin(), windowHandles.end(), mLastHoverWindowHandle) == + windowHandles.end()) { + mLastHoverWindowHandle = nullptr; } std::optional<FocusResolver::FocusChanges> changes = diff --git a/services/inputflinger/tests/InputDispatcher_test.cpp b/services/inputflinger/tests/InputDispatcher_test.cpp index fce0f999b5..58617f7383 100644 --- a/services/inputflinger/tests/InputDispatcher_test.cpp +++ b/services/inputflinger/tests/InputDispatcher_test.cpp @@ -2189,59 +2189,6 @@ TEST_F(InputDispatcherTest, HoverEnterMouseClickAndHoverExit) { ADISPLAY_ID_DEFAULT, 0 /* expectedFlag */); } -TEST_F(InputDispatcherTest, HoverEnterMoveRemoveWindowsInSecondDisplay) { - std::shared_ptr<FakeApplicationHandle> application = std::make_shared<FakeApplicationHandle>(); - sp<FakeWindowHandle> windowDefaultDisplay = - sp<FakeWindowHandle>::make(application, mDispatcher, "DefaultDisplay", - ADISPLAY_ID_DEFAULT); - windowDefaultDisplay->setFrame(Rect(0, 0, 600, 800)); - sp<FakeWindowHandle> windowSecondDisplay = - sp<FakeWindowHandle>::make(application, mDispatcher, "SecondDisplay", - SECOND_DISPLAY_ID); - windowSecondDisplay->setFrame(Rect(0, 0, 600, 800)); - - mDispatcher->setInputWindows({{ADISPLAY_ID_DEFAULT, {windowDefaultDisplay}}, - {SECOND_DISPLAY_ID, {windowSecondDisplay}}}); - - // Set cursor position in window in default display and check that hover enter and move - // events are generated. - ASSERT_EQ(InputEventInjectionResult::SUCCEEDED, - injectMotionEvent(mDispatcher, - MotionEventBuilder(AMOTION_EVENT_ACTION_HOVER_MOVE, - AINPUT_SOURCE_MOUSE) - .displayId(ADISPLAY_ID_DEFAULT) - .pointer(PointerBuilder(0, AMOTION_EVENT_TOOL_TYPE_MOUSE) - .x(300) - .y(600)) - .build())); - windowDefaultDisplay->consumeEvent(AINPUT_EVENT_TYPE_MOTION, AMOTION_EVENT_ACTION_HOVER_ENTER, - ADISPLAY_ID_DEFAULT, 0 /* expectedFlag */); - windowDefaultDisplay->consumeEvent(AINPUT_EVENT_TYPE_MOTION, AMOTION_EVENT_ACTION_HOVER_MOVE, - ADISPLAY_ID_DEFAULT, 0 /* expectedFlag */); - - // Remove all windows in secondary display and check that no event happens on window in - // primary display. - mDispatcher->setInputWindows({{SECOND_DISPLAY_ID, {}}}); - windowDefaultDisplay->assertNoEvents(); - - // Move cursor position in window in default display and check that only hover move - // event is generated and not hover enter event. - mDispatcher->setInputWindows({{ADISPLAY_ID_DEFAULT, {windowDefaultDisplay}}, - {SECOND_DISPLAY_ID, {windowSecondDisplay}}}); - ASSERT_EQ(InputEventInjectionResult::SUCCEEDED, - injectMotionEvent(mDispatcher, - MotionEventBuilder(AMOTION_EVENT_ACTION_HOVER_MOVE, - AINPUT_SOURCE_MOUSE) - .displayId(ADISPLAY_ID_DEFAULT) - .pointer(PointerBuilder(0, AMOTION_EVENT_TOOL_TYPE_MOUSE) - .x(400) - .y(700)) - .build())); - windowDefaultDisplay->consumeEvent(AINPUT_EVENT_TYPE_MOTION, AMOTION_EVENT_ACTION_HOVER_MOVE, - ADISPLAY_ID_DEFAULT, 0 /* expectedFlag */); - windowDefaultDisplay->assertNoEvents(); -} - TEST_F(InputDispatcherTest, DispatchMouseEventsUnderCursor) { std::shared_ptr<FakeApplicationHandle> application = std::make_shared<FakeApplicationHandle>(); diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp index 4d93e7ec50..f6880ce1f3 100644 --- a/services/surfaceflinger/SurfaceFlinger.cpp +++ b/services/surfaceflinger/SurfaceFlinger.cpp @@ -422,9 +422,6 @@ SurfaceFlinger::SurfaceFlinger(Factory& factory) : SurfaceFlinger(factory, SkipI property_get("debug.sf.treat_170m_as_sRGB", value, "0"); mTreat170mAsSrgb = atoi(value); - mIgnoreHwcPhysicalDisplayOrientation = - base::GetBoolProperty("debug.sf.ignore_hwc_physical_display_orientation"s, false); - // We should be reading 'persist.sys.sf.color_saturation' here // but since /data may be encrypted, we need to wait until after vold // comes online to attempt to read the property. The property is @@ -2404,8 +2401,7 @@ ui::Rotation SurfaceFlinger::getPhysicalDisplayOrientation(DisplayId displayId, if (!id) { return ui::ROTATION_0; } - if (!mIgnoreHwcPhysicalDisplayOrientation && - getHwComposer().getComposer()->isSupported( + if (getHwComposer().getComposer()->isSupported( Hwc2::Composer::OptionalFeature::PhysicalDisplayOrientation)) { switch (getHwComposer().getPhysicalDisplayOrientation(*id)) { case Hwc2::AidlTransform::ROT_90: diff --git a/services/surfaceflinger/SurfaceFlinger.h b/services/surfaceflinger/SurfaceFlinger.h index 678495da3b..51d721626e 100644 --- a/services/surfaceflinger/SurfaceFlinger.h +++ b/services/surfaceflinger/SurfaceFlinger.h @@ -353,11 +353,6 @@ public: // on this behavior to increase contrast for some media sources. bool mTreat170mAsSrgb = false; - // Allows to ignore physical orientation provided through hwc API in favour of - // 'ro.surface_flinger.primary_display_orientation'. - // TODO(b/246793311): Clean up a temporary property - bool mIgnoreHwcPhysicalDisplayOrientation = false; - protected: // We're reference counted, never destroy SurfaceFlinger directly virtual ~SurfaceFlinger(); |