Fix NPE in overview action buttons
Flag: N/A Fixes: 305894735 Test: pressed screenshot overview action button shortly before/after dismissing the current task Change-Id: Ife93fa9af5416af60cf8ae24275f14bd6857901a
This commit is contained in:
@@ -190,11 +190,11 @@ public class TaskOverlayFactory implements ResourceBasedOverride {
|
||||
*/
|
||||
public void endLiveTileMode(@NonNull Runnable callback) {
|
||||
RecentsView recentsView = mThumbnailView.getTaskView().getRecentsView();
|
||||
if (recentsView != null) {
|
||||
recentsView.switchToScreenshot(
|
||||
() -> recentsView.finishRecentsAnimation(true /* toRecents */,
|
||||
false /* shouldPip */, callback));
|
||||
}
|
||||
// Task has already been dismissed
|
||||
if (recentsView == null) return;
|
||||
recentsView.switchToScreenshot(
|
||||
() -> recentsView.finishRecentsAnimation(true /* toRecents */,
|
||||
false /* shouldPip */, callback));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -212,6 +212,8 @@ public class TaskOverlayFactory implements ResourceBasedOverride {
|
||||
|
||||
private void enterSplitSelect() {
|
||||
RecentsView overviewPanel = mThumbnailView.getTaskView().getRecentsView();
|
||||
// Task has already been dismissed
|
||||
if (overviewPanel == null) return;
|
||||
overviewPanel.initiateSplitSelect(mThumbnailView.getTaskView());
|
||||
}
|
||||
|
||||
|
||||
@@ -1677,6 +1677,7 @@ public class TaskView extends FrameLayout implements Reusable {
|
||||
return super.performAccessibilityAction(action, arguments);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public RecentsView getRecentsView() {
|
||||
return (RecentsView) getParent();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user