From 4fb76253f255f0adb8a64835af37bb9176ee4016 Mon Sep 17 00:00:00 2001 From: Jeff Brown Date: Fri, 13 May 2011 12:51:12 -0700 Subject: Fix bounds check. Bug: 4413945 Also remove dead code from header file. Change-Id: I4e9fc9d7f8612fedb436e62649d308bd737ed138 --- services/input/InputWindow.cpp | 3 ++- services/input/InputWindow.h | 5 ----- 2 files changed, 2 insertions(+), 6 deletions(-) (limited to 'services') diff --git a/services/input/InputWindow.cpp b/services/input/InputWindow.cpp index ccea9e4..b552f6d 100644 --- a/services/input/InputWindow.cpp +++ b/services/input/InputWindow.cpp @@ -29,7 +29,8 @@ bool InputWindow::touchableRegionContainsPoint(int32_t x, int32_t y) const { } bool InputWindow::frameContainsPoint(int32_t x, int32_t y) const { - return x <= frameRight || y <= frameBottom; + return x >= frameLeft && x <= frameRight + && y >= frameTop && y <= frameBottom; } bool InputWindow::isTrustedOverlay() const { diff --git a/services/input/InputWindow.h b/services/input/InputWindow.h index 72f1773..085c6af 100644 --- a/services/input/InputWindow.h +++ b/services/input/InputWindow.h @@ -145,11 +145,6 @@ struct InputWindow { bool touchableRegionContainsPoint(int32_t x, int32_t y) const; bool frameContainsPoint(int32_t x, int32_t y) const; - /* These use the globalScale to convert a given screen offset to the - * corresponding location within the window. - */ - int32_t displayToWindowX(int32_t x) const; - /* Returns true if the window is of a trusted type that is allowed to silently * overlay other windows for the purpose of implementing the secure views feature. * Trusted overlays, such as IME windows, can partly obscure other windows without causing -- cgit v1.1