Commit 0b9a025e authored by Jinsuk Kim's avatar Jinsuk Kim Committed by Commit Bot

Android: Fix a potential exception in accessing FullscreenManager

The reported bug shows ChromeActivity.getFullscreenManager can be
called while the activity is being destroyed, which will cause an
IllegalStateException. Such incidents should be prevented from
happening by checking the activity state before calling the API. This
check existed in TabWebContentsDelegateAndroid
(https://crrev.com/c/1547745) but removed in the course of refactoring
(https://crrev.com/c/1621466). This CL puts it back.

Bug: 990987
Change-Id: I0d9700e6d60acd129904a9f23488d211df795731
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1743286Reviewed-by: default avatarTheresa  <twellington@chromium.org>
Commit-Queue: Jinsuk Kim <jinsukkim@chromium.org>
Cr-Commit-Position: refs/heads/master@{#685056}
parent e7d37d6a
......@@ -80,7 +80,9 @@ public class ActivityTabWebContentsDelegateAndroid extends TabWebContentsDelegat
}
private FullscreenManager getFullscreenManager() {
return mActivity != null ? mActivity.getFullscreenManager() : null;
return mActivity != null && !mActivity.isActivityFinishingOrDestroyed()
? mActivity.getFullscreenManager()
: null;
}
@Override
......
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