Merge "Adding null checks for unset stack. (Bug 18329447)" into lmp-mr1-dev
This commit is contained in:
@@ -439,6 +439,8 @@ public class TaskStackView extends FrameLayout implements TaskStack.TaskStackCal
|
|||||||
/** Updates the min and max virtual scroll bounds */
|
/** Updates the min and max virtual scroll bounds */
|
||||||
void updateMinMaxScroll(boolean boundScrollToNewMinMax, boolean launchedWithAltTab,
|
void updateMinMaxScroll(boolean boundScrollToNewMinMax, boolean launchedWithAltTab,
|
||||||
boolean launchedFromHome) {
|
boolean launchedFromHome) {
|
||||||
|
if (mStack == null) return;
|
||||||
|
|
||||||
// Compute the min and max scroll values
|
// Compute the min and max scroll values
|
||||||
mLayoutAlgorithm.computeMinMaxScroll(mStack.getTasks(), launchedWithAltTab, launchedFromHome);
|
mLayoutAlgorithm.computeMinMaxScroll(mStack.getTasks(), launchedWithAltTab, launchedFromHome);
|
||||||
|
|
||||||
@@ -563,6 +565,8 @@ public class TaskStackView extends FrameLayout implements TaskStack.TaskStackCal
|
|||||||
@Override
|
@Override
|
||||||
public void onInitializeAccessibilityEvent(AccessibilityEvent event) {
|
public void onInitializeAccessibilityEvent(AccessibilityEvent event) {
|
||||||
super.onInitializeAccessibilityEvent(event);
|
super.onInitializeAccessibilityEvent(event);
|
||||||
|
if (mStack == null) return;
|
||||||
|
|
||||||
int childCount = getChildCount();
|
int childCount = getChildCount();
|
||||||
if (childCount > 0) {
|
if (childCount > 0) {
|
||||||
TaskView backMostTask = (TaskView) getChildAt(0);
|
TaskView backMostTask = (TaskView) getChildAt(0);
|
||||||
@@ -637,6 +641,11 @@ public class TaskStackView extends FrameLayout implements TaskStack.TaskStackCal
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
|
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
|
||||||
|
if (mStack == null) {
|
||||||
|
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
int width = MeasureSpec.getSize(widthMeasureSpec);
|
int width = MeasureSpec.getSize(widthMeasureSpec);
|
||||||
int height = MeasureSpec.getSize(heightMeasureSpec);
|
int height = MeasureSpec.getSize(heightMeasureSpec);
|
||||||
|
|
||||||
@@ -682,6 +691,11 @@ public class TaskStackView extends FrameLayout implements TaskStack.TaskStackCal
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
|
protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
|
||||||
|
if (mStack == null) {
|
||||||
|
super.onLayout(changed, left, top, right, bottom);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Layout each of the children
|
// Layout each of the children
|
||||||
int childCount = getChildCount();
|
int childCount = getChildCount();
|
||||||
for (int i = 0; i < childCount; i++) {
|
for (int i = 0; i < childCount; i++) {
|
||||||
@@ -839,7 +853,6 @@ public class TaskStackView extends FrameLayout implements TaskStack.TaskStackCal
|
|||||||
|
|
||||||
/** Final callback after Recents is finally hidden. */
|
/** Final callback after Recents is finally hidden. */
|
||||||
void onRecentsHidden() {
|
void onRecentsHidden() {
|
||||||
reset();
|
|
||||||
setStack(null);
|
setStack(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1014,6 +1027,8 @@ public class TaskStackView extends FrameLayout implements TaskStack.TaskStackCal
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void prepareViewToLeavePool(TaskView tv, Task task, boolean isNewView) {
|
public void prepareViewToLeavePool(TaskView tv, Task task, boolean isNewView) {
|
||||||
|
if (mStack == null) return;
|
||||||
|
|
||||||
// It is possible for a view to be returned to the view pool before it is laid out,
|
// It is possible for a view to be returned to the view pool before it is laid out,
|
||||||
// which means that we will need to relayout the view when it is first used next.
|
// which means that we will need to relayout the view when it is first used next.
|
||||||
boolean requiresRelayout = tv.getWidth() <= 0 && !isNewView;
|
boolean requiresRelayout = tv.getWidth() <= 0 && !isNewView;
|
||||||
@@ -1152,6 +1167,8 @@ public class TaskStackView extends FrameLayout implements TaskStack.TaskStackCal
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onPackagesChanged(RecentsPackageMonitor monitor, String packageName, int userId) {
|
public void onPackagesChanged(RecentsPackageMonitor monitor, String packageName, int userId) {
|
||||||
|
if (mStack == null) return;
|
||||||
|
|
||||||
// Compute which components need to be removed
|
// Compute which components need to be removed
|
||||||
HashSet<ComponentName> removedComponents = monitor.computeComponentsRemoved(
|
HashSet<ComponentName> removedComponents = monitor.computeComponentsRemoved(
|
||||||
mStack.getTaskKeys(), packageName, userId);
|
mStack.getTaskKeys(), packageName, userId);
|
||||||
|
|||||||
Reference in New Issue
Block a user