Commit d4c2945b authored by Xi Han's avatar Xi Han Committed by Commit Bot

Add a null check in StartSurfaceLayout#shrinkTab().

Bug: 1091507
Change-Id: I29a291ee7a9db36a665bf0663c27f08b876486ad
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2406684Reviewed-by: default avatarWei-Yin Chen (陳威尹) <wychen@chromium.org>
Commit-Queue: Xi Han <hanxi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#806653}
parent 65e2d636
......@@ -200,7 +200,7 @@ public class StartSurfaceLayout extends Layout implements StartSurface.OverviewM
return;
}
shrinkTab(() -> mTabListDelegate.getThumbnailLocationOfCurrentTab(false));
shrinkTab(animate, () -> mTabListDelegate.getThumbnailLocationOfCurrentTab(false));
}
@Override
......@@ -290,11 +290,16 @@ public class StartSurfaceLayout extends Layout implements StartSurface.OverviewM
/**
* Animate shrinking a tab to a target {@link Rect} area.
* @param animate Whether to play an entry animation.
* @param target The target {@link Rect} area.
*/
private void shrinkTab(Supplier<Rect> target) {
forceAnimationToFinish();
private void shrinkTab(boolean animate, Supplier<Rect> target) {
if (target.get() == null) {
mController.showOverview(animate);
return;
}
forceAnimationToFinish();
LayoutTab sourceLayoutTab = mLayoutTabs[0];
CompositorAnimationHandler handler = getAnimationHandler();
Collection<Animator> animationList = new ArrayList<>(5);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment