DO NOT MERGE Add empty ArrayList check.

Fixes bug 15768779.
Fixes bug 17955259.

Change-Id: I3e4c48aa0fff99025e9ba1725e3d1f3523749dbd
This commit is contained in:
Craig Mautner
2014-07-22 11:08:53 -07:00
committed by Prashant Malani
parent c93723bdf9
commit 1559d9d15f

View File

@@ -4855,8 +4855,11 @@ public class WindowManagerService extends IWindowManager.Stub
// Where to start adding?
for (int taskNdx = 0; taskNdx < numTasks; ++taskNdx) {
AppTokenList tokens = tasks.get(taskNdx).mAppTokens;
int pos = findAppWindowInsertionPointLocked(tokens.get(0));
final int numTokens = tokens.size();
if (numTokens == 0) {
continue;
}
int pos = findAppWindowInsertionPointLocked(tokens.get(0));
for (int tokenNdx = 0; tokenNdx < numTokens; ++tokenNdx) {
final AppWindowToken wtoken = tokens.get(tokenNdx);
if (wtoken != null) {