am fe79d62d: Merge "Adding additional null checks to prevent crash after task stack view callback is reset. (Bug 18376798)" into lmp-mr1-dev
* commit 'fe79d62db3f5de7671763b4bbafc83feb1c7694c': Adding additional null checks to prevent crash after task stack view callback is reset. (Bug 18376798)
This commit is contained in:
@@ -554,7 +554,8 @@ public class TaskStackView extends FrameLayout implements TaskStack.TaskStackCal
|
|||||||
|
|
||||||
/** Resets the focused task. */
|
/** Resets the focused task. */
|
||||||
void resetFocusedTask() {
|
void resetFocusedTask() {
|
||||||
if (mFocusedTaskIndex > -1) {
|
if ((mStack != null) && (0 <= mFocusedTaskIndex) &&
|
||||||
|
(mFocusedTaskIndex < mStack.getTaskCount())) {
|
||||||
Task t = mStack.getTasks().get(mFocusedTaskIndex);
|
Task t = mStack.getTasks().get(mFocusedTaskIndex);
|
||||||
TaskView tv = getChildViewForTask(t);
|
TaskView tv = getChildViewForTask(t);
|
||||||
tv.unsetFocusedTask();
|
tv.unsetFocusedTask();
|
||||||
|
|||||||
@@ -477,7 +477,9 @@ public class TaskView extends FrameLayout implements Task.TaskCallbacks,
|
|||||||
startDeleteTaskAnimation(new Runnable() {
|
startDeleteTaskAnimation(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
mCb.onTaskViewDismissed(tv);
|
if (mCb != null) {
|
||||||
|
mCb.onTaskViewDismissed(tv);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -494,7 +496,9 @@ public class TaskView extends FrameLayout implements Task.TaskCallbacks,
|
|||||||
void setClipViewInStack(boolean clip) {
|
void setClipViewInStack(boolean clip) {
|
||||||
if (clip != mClipViewInStack) {
|
if (clip != mClipViewInStack) {
|
||||||
mClipViewInStack = clip;
|
mClipViewInStack = clip;
|
||||||
mCb.onTaskViewClipStateChanged(this);
|
if (mCb != null) {
|
||||||
|
mCb.onTaskViewClipStateChanged(this);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -578,7 +582,9 @@ public class TaskView extends FrameLayout implements Task.TaskCallbacks,
|
|||||||
// Update the thumbnail alpha with the focus
|
// Update the thumbnail alpha with the focus
|
||||||
mThumbnailView.onFocusChanged(true);
|
mThumbnailView.onFocusChanged(true);
|
||||||
// Call the callback
|
// Call the callback
|
||||||
mCb.onTaskViewFocusChanged(this, true);
|
if (mCb != null) {
|
||||||
|
mCb.onTaskViewFocusChanged(this, true);
|
||||||
|
}
|
||||||
// Workaround, we don't always want it focusable in touch mode, but we want the first task
|
// Workaround, we don't always want it focusable in touch mode, but we want the first task
|
||||||
// to be focused after the enter-recents animation, which can be triggered from either touch
|
// to be focused after the enter-recents animation, which can be triggered from either touch
|
||||||
// or keyboard
|
// or keyboard
|
||||||
@@ -601,7 +607,9 @@ public class TaskView extends FrameLayout implements Task.TaskCallbacks,
|
|||||||
// Update the thumbnail alpha with the focus
|
// Update the thumbnail alpha with the focus
|
||||||
mThumbnailView.onFocusChanged(false);
|
mThumbnailView.onFocusChanged(false);
|
||||||
// Call the callback
|
// Call the callback
|
||||||
mCb.onTaskViewFocusChanged(this, false);
|
if (mCb != null) {
|
||||||
|
mCb.onTaskViewFocusChanged(this, false);
|
||||||
|
}
|
||||||
invalidate();
|
invalidate();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -702,7 +710,9 @@ public class TaskView extends FrameLayout implements Task.TaskCallbacks,
|
|||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
if (Constants.DebugFlags.App.EnableTaskFiltering && v == mHeaderView.mApplicationIcon) {
|
if (Constants.DebugFlags.App.EnableTaskFiltering && v == mHeaderView.mApplicationIcon) {
|
||||||
mCb.onTaskViewAppIconClicked(tv);
|
if (mCb != null) {
|
||||||
|
mCb.onTaskViewAppIconClicked(tv);
|
||||||
|
}
|
||||||
} else if (v == mHeaderView.mDismissButton) {
|
} else if (v == mHeaderView.mDismissButton) {
|
||||||
dismissTask();
|
dismissTask();
|
||||||
}
|
}
|
||||||
@@ -713,7 +723,9 @@ public class TaskView extends FrameLayout implements Task.TaskCallbacks,
|
|||||||
// Reset the translation of the action button before we animate it out
|
// Reset the translation of the action button before we animate it out
|
||||||
mActionButtonView.setTranslationZ(0f);
|
mActionButtonView.setTranslationZ(0f);
|
||||||
}
|
}
|
||||||
mCb.onTaskViewClicked(tv, tv.getTask(), (v == mActionButtonView));
|
if (mCb != null) {
|
||||||
|
mCb.onTaskViewClicked(tv, tv.getTask(), (v == mActionButtonView));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -722,8 +734,10 @@ public class TaskView extends FrameLayout implements Task.TaskCallbacks,
|
|||||||
@Override
|
@Override
|
||||||
public boolean onLongClick(View v) {
|
public boolean onLongClick(View v) {
|
||||||
if (v == mHeaderView.mApplicationIcon) {
|
if (v == mHeaderView.mApplicationIcon) {
|
||||||
mCb.onTaskViewAppInfoClicked(this);
|
if (mCb != null) {
|
||||||
return true;
|
mCb.onTaskViewAppInfoClicked(this);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user