Commit 3924701b authored by Theresa's avatar Theresa Committed by Commit Bot

[EoC] Check for null sheet contents before announcing close

BUG=888980

Change-Id: Ic1699abfe2b1b911857557ccfdc04f49543c80d5
Reviewed-on: https://chromium-review.googlesource.com/1243046Reviewed-by: default avatarMatthew Jones <mdjones@chromium.org>
Commit-Queue: Theresa <twellington@chromium.org>
Cr-Commit-Position: refs/heads/master@{#593980}
parent 5080522a
......@@ -993,8 +993,12 @@ public class BottomSheet extends FrameLayout
mPersistentControlsToken);
for (BottomSheetObserver o : mObservers) o.onSheetClosed(reason);
announceForAccessibility(getResources().getString(
getCurrentSheetContent().getSheetClosedAccessibilityStringId()));
// If the sheet contents are cleared out before #onSheetClosed is called, do not try to
// retrieve the accessibility string.
if (getCurrentSheetContent() != null) {
announceForAccessibility(getResources().getString(
getCurrentSheetContent().getSheetClosedAccessibilityStringId()));
}
clearFocus();
mActivity.removeViewObscuringAllTabs(this);
......
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