Merge "Prevent NPE when checking focused stage before root task is ready" into sc-v2-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
f64f48c526
@@ -113,10 +113,20 @@ class StageTaskListener implements ShellTaskOrganizer.TaskListener {
|
|||||||
|
|
||||||
/** @return {@code true} if this listener contains the currently focused task. */
|
/** @return {@code true} if this listener contains the currently focused task. */
|
||||||
boolean isFocused() {
|
boolean isFocused() {
|
||||||
if (mRootTaskInfo.isFocused) return true;
|
if (mRootTaskInfo == null) {
|
||||||
for (int i = mChildrenTaskInfo.size() - 1; i >= 0; --i) {
|
return false;
|
||||||
if (mChildrenTaskInfo.valueAt(i).isFocused) return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (mRootTaskInfo.isFocused) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int i = mChildrenTaskInfo.size() - 1; i >= 0; --i) {
|
||||||
|
if (mChildrenTaskInfo.valueAt(i).isFocused) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user