Loading include/input/InputWindow.h +39 −38 Original line number Diff line number Diff line Loading @@ -107,6 +107,7 @@ struct InputWindowInfo { TYPE_MAGNIFICATION_OVERLAY = FIRST_SYSTEM_WINDOW + 27, TYPE_ACCESSIBILITY_OVERLAY = FIRST_SYSTEM_WINDOW + 32, TYPE_DOCK_DIVIDER = FIRST_SYSTEM_WINDOW + 34, TYPE_NOTIFICATION_SHADE = FIRST_SYSTEM_WINDOW + 40, LAST_SYSTEM_WINDOW = 2999, }; Loading libs/gui/tests/EndToEndNativeInputTest.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -178,7 +178,7 @@ private: mInputInfo.name = "Test info"; mInputInfo.layoutParamsFlags = InputWindowInfo::FLAG_NOT_TOUCH_MODAL; mInputInfo.layoutParamsType = InputWindowInfo::TYPE_BASE_APPLICATION; mInputInfo.dispatchingTimeout = 100000; mInputInfo.dispatchingTimeout = seconds_to_nanoseconds(5); mInputInfo.globalScaleFactor = 1.0; mInputInfo.canReceiveKeys = true; mInputInfo.hasFocus = true; Loading @@ -196,7 +196,7 @@ private: InputApplicationInfo aInfo; aInfo.token = new BBinder(); aInfo.name = "Test app info"; aInfo.dispatchingTimeout = 100000; aInfo.dispatchingTimeout = seconds_to_nanoseconds(5); mInputInfo.applicationInfo = aInfo; } Loading libs/input/InputWindow.cpp +9 −10 Original line number Diff line number Diff line Loading @@ -43,16 +43,15 @@ bool InputWindowInfo::frameContainsPoint(int32_t x, int32_t y) const { } bool InputWindowInfo::isTrustedOverlay() const { return layoutParamsType == TYPE_INPUT_METHOD || layoutParamsType == TYPE_INPUT_METHOD_DIALOG || layoutParamsType == TYPE_MAGNIFICATION_OVERLAY || layoutParamsType == TYPE_STATUS_BAR || layoutParamsType == TYPE_NAVIGATION_BAR || layoutParamsType == TYPE_NAVIGATION_BAR_PANEL || layoutParamsType == TYPE_SECURE_SYSTEM_OVERLAY || layoutParamsType == TYPE_DOCK_DIVIDER || layoutParamsType == TYPE_ACCESSIBILITY_OVERLAY || layoutParamsType == TYPE_INPUT_CONSUMER; return layoutParamsType == TYPE_INPUT_METHOD || layoutParamsType == TYPE_INPUT_METHOD_DIALOG || layoutParamsType == TYPE_MAGNIFICATION_OVERLAY || layoutParamsType == TYPE_STATUS_BAR || layoutParamsType == TYPE_NOTIFICATION_SHADE || layoutParamsType == TYPE_NAVIGATION_BAR || layoutParamsType == TYPE_NAVIGATION_BAR_PANEL || layoutParamsType == TYPE_SECURE_SYSTEM_OVERLAY || layoutParamsType == TYPE_DOCK_DIVIDER || layoutParamsType == TYPE_ACCESSIBILITY_OVERLAY || layoutParamsType == TYPE_INPUT_CONSUMER; } bool InputWindowInfo::supportsSplitTouch() const { Loading libs/ui/Region.cpp +5 −0 Original line number Diff line number Diff line Loading @@ -224,6 +224,11 @@ Region& Region::operator = (const Region& rhs) validate(*this, "this->operator="); validate(rhs, "rhs.operator="); #endif if (this == &rhs) { // Already equal to itself return *this; } mStorage.clear(); mStorage.insert(mStorage.begin(), rhs.mStorage.begin(), rhs.mStorage.end()); return *this; Loading libs/ui/tests/Region_test.cpp +15 −0 Original line number Diff line number Diff line Loading @@ -152,5 +152,20 @@ TEST_F(RegionTest, Random_TJunction) { } } TEST_F(RegionTest, EqualsToSelf) { Region touchableRegion; touchableRegion.orSelf(Rect(0, 0, 100, 100)); ASSERT_TRUE(touchableRegion.contains(50, 50)); // Compiler prevents us from directly calling 'touchableRegion = touchableRegion' Region& referenceTouchableRegion = touchableRegion; touchableRegion = referenceTouchableRegion; ASSERT_FALSE(touchableRegion.isEmpty()); ASSERT_TRUE(touchableRegion.contains(50, 50)); } }; // namespace android Loading
include/input/InputWindow.h +39 −38 Original line number Diff line number Diff line Loading @@ -107,6 +107,7 @@ struct InputWindowInfo { TYPE_MAGNIFICATION_OVERLAY = FIRST_SYSTEM_WINDOW + 27, TYPE_ACCESSIBILITY_OVERLAY = FIRST_SYSTEM_WINDOW + 32, TYPE_DOCK_DIVIDER = FIRST_SYSTEM_WINDOW + 34, TYPE_NOTIFICATION_SHADE = FIRST_SYSTEM_WINDOW + 40, LAST_SYSTEM_WINDOW = 2999, }; Loading
libs/gui/tests/EndToEndNativeInputTest.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -178,7 +178,7 @@ private: mInputInfo.name = "Test info"; mInputInfo.layoutParamsFlags = InputWindowInfo::FLAG_NOT_TOUCH_MODAL; mInputInfo.layoutParamsType = InputWindowInfo::TYPE_BASE_APPLICATION; mInputInfo.dispatchingTimeout = 100000; mInputInfo.dispatchingTimeout = seconds_to_nanoseconds(5); mInputInfo.globalScaleFactor = 1.0; mInputInfo.canReceiveKeys = true; mInputInfo.hasFocus = true; Loading @@ -196,7 +196,7 @@ private: InputApplicationInfo aInfo; aInfo.token = new BBinder(); aInfo.name = "Test app info"; aInfo.dispatchingTimeout = 100000; aInfo.dispatchingTimeout = seconds_to_nanoseconds(5); mInputInfo.applicationInfo = aInfo; } Loading
libs/input/InputWindow.cpp +9 −10 Original line number Diff line number Diff line Loading @@ -43,16 +43,15 @@ bool InputWindowInfo::frameContainsPoint(int32_t x, int32_t y) const { } bool InputWindowInfo::isTrustedOverlay() const { return layoutParamsType == TYPE_INPUT_METHOD || layoutParamsType == TYPE_INPUT_METHOD_DIALOG || layoutParamsType == TYPE_MAGNIFICATION_OVERLAY || layoutParamsType == TYPE_STATUS_BAR || layoutParamsType == TYPE_NAVIGATION_BAR || layoutParamsType == TYPE_NAVIGATION_BAR_PANEL || layoutParamsType == TYPE_SECURE_SYSTEM_OVERLAY || layoutParamsType == TYPE_DOCK_DIVIDER || layoutParamsType == TYPE_ACCESSIBILITY_OVERLAY || layoutParamsType == TYPE_INPUT_CONSUMER; return layoutParamsType == TYPE_INPUT_METHOD || layoutParamsType == TYPE_INPUT_METHOD_DIALOG || layoutParamsType == TYPE_MAGNIFICATION_OVERLAY || layoutParamsType == TYPE_STATUS_BAR || layoutParamsType == TYPE_NOTIFICATION_SHADE || layoutParamsType == TYPE_NAVIGATION_BAR || layoutParamsType == TYPE_NAVIGATION_BAR_PANEL || layoutParamsType == TYPE_SECURE_SYSTEM_OVERLAY || layoutParamsType == TYPE_DOCK_DIVIDER || layoutParamsType == TYPE_ACCESSIBILITY_OVERLAY || layoutParamsType == TYPE_INPUT_CONSUMER; } bool InputWindowInfo::supportsSplitTouch() const { Loading
libs/ui/Region.cpp +5 −0 Original line number Diff line number Diff line Loading @@ -224,6 +224,11 @@ Region& Region::operator = (const Region& rhs) validate(*this, "this->operator="); validate(rhs, "rhs.operator="); #endif if (this == &rhs) { // Already equal to itself return *this; } mStorage.clear(); mStorage.insert(mStorage.begin(), rhs.mStorage.begin(), rhs.mStorage.end()); return *this; Loading
libs/ui/tests/Region_test.cpp +15 −0 Original line number Diff line number Diff line Loading @@ -152,5 +152,20 @@ TEST_F(RegionTest, Random_TJunction) { } } TEST_F(RegionTest, EqualsToSelf) { Region touchableRegion; touchableRegion.orSelf(Rect(0, 0, 100, 100)); ASSERT_TRUE(touchableRegion.contains(50, 50)); // Compiler prevents us from directly calling 'touchableRegion = touchableRegion' Region& referenceTouchableRegion = touchableRegion; touchableRegion = referenceTouchableRegion; ASSERT_FALSE(touchableRegion.isEmpty()); ASSERT_TRUE(touchableRegion.contains(50, 50)); } }; // namespace android