Fix a NPE in AccessiiblityManagerService.

It is possible that the accessibility windows list is null which
is treated as if there is no window information. The getWindows
method was accessing properties of the windows filed witgout a
null check.

bug:18522998

Change-Id: Ieefe678d3da3d6e8f96c0e4bedac0c55975621fa
This commit is contained in:
Svet Ganov
2014-12-11 22:59:08 -08:00
parent 8b33cf4d34
commit 09687064f4

View File

@@ -2145,6 +2145,9 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub {
if (!permissionGranted) {
return null;
}
if (mSecurityPolicy.mWindows == null) {
return null;
}
List<AccessibilityWindowInfo> windows = new ArrayList<>();
final int windowCount = mSecurityPolicy.mWindows.size();
for (int i = 0; i < windowCount; i++) {