summaryrefslogtreecommitdiffstats
path: root/services/accessibility
diff options
context:
space:
mode:
authorDoris Liu <tianliu@google.com>2015-06-01 13:42:04 -0700
committerDoris Liu <tianliu@google.com>2015-06-02 15:01:48 -0700
commit942bc58518a82bc3dbeffe4d64f9a5d2d2d8cf43 (patch)
treeb918ecc26a1fb1cfe730dbe6e0ee28fc0fcfb92f /services/accessibility
parentc5ff0020a2467e0b7aed590d790b5a1b4b082f56 (diff)
downloadframeworks_base-942bc58518a82bc3dbeffe4d64f9a5d2d2d8cf43.zip
frameworks_base-942bc58518a82bc3dbeffe4d64f9a5d2d2d8cf43.tar.gz
frameworks_base-942bc58518a82bc3dbeffe4d64f9a5d2d2d8cf43.tar.bz2
Fix calls to Rect.intersect(Rect)
This CL checks for the return value for Rect.intersect(Rect) for whether there is actually an intersection before taking the calling rect as the intersection. In the case of no intersection (Rect.intersect(Rect) returns false), the calling rect would not have been changed, so here in this CL it will be manually set empty. Bug: 7368679 Change-Id: I7494c1a1649eca09e34412f0a59b795e8b3a82aa
Diffstat (limited to 'services/accessibility')
-rw-r--r--services/accessibility/java/com/android/server/accessibility/AccessibilityManagerService.java6
1 files changed, 2 insertions, 4 deletions
diff --git a/services/accessibility/java/com/android/server/accessibility/AccessibilityManagerService.java b/services/accessibility/java/com/android/server/accessibility/AccessibilityManagerService.java
index 860939c..d4c3194 100644
--- a/services/accessibility/java/com/android/server/accessibility/AccessibilityManagerService.java
+++ b/services/accessibility/java/com/android/server/accessibility/AccessibilityManagerService.java
@@ -3240,8 +3240,7 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub {
// Clip to the window bounds.
Rect windowBounds = mTempRect1;
getWindowBounds(focus.getWindowId(), windowBounds);
- boundsInScreen.intersect(windowBounds);
- if (boundsInScreen.isEmpty()) {
+ if (!boundsInScreen.intersect(windowBounds)) {
return false;
}
@@ -3255,8 +3254,7 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub {
// Clip to the screen bounds.
Point screenSize = mTempPoint;
mDefaultDisplay.getRealSize(screenSize);
- boundsInScreen.intersect(0, 0, screenSize.x, screenSize.y);
- if (boundsInScreen.isEmpty()) {
+ if (!boundsInScreen.intersect(0, 0, screenSize.x, screenSize.y)) {
return false;
}