Skip to content

Commit

Permalink
Cache flag of layout change to avoid crash on config change
Browse files Browse the repository at this point in the history
There is no guarantee native will be initialized when
onConfigurationChanged is called

Bug: 1162510
Change-Id: Iac48e4dc0c9ab3c6a080a72afeee52657fd32aa8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2606874
Commit-Queue: Lijin Shen <lazzzis@google.com>
Reviewed-by: Theresa  <twellington@chromium.org>
Cr-Commit-Position: refs/heads/master@{#840298}
  • Loading branch information
Lijin Shen authored and Chromium LUCI CQ committed Jan 5, 2021
1 parent a9de416 commit 90ac442
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
import org.chromium.base.Callback;
import org.chromium.base.CommandLine;
import org.chromium.base.ContextUtils;
import org.chromium.base.FeatureList;
import org.chromium.base.MathUtils;
import org.chromium.base.StrictModeContext;
import org.chromium.base.SysUtils;
Expand Down Expand Up @@ -1813,7 +1814,8 @@ public boolean backShouldCloseTab(Tab tab) {
@Override
public void performOnConfigurationChanged(Configuration newConfig) {
super.performOnConfigurationChanged(newConfig);
if (ChromeFeatureList.isEnabled(ChromeFeatureList.ANDROID_LAYOUT_CHANGE_TAB_REPARENT)
if (FeatureList.isInitialized()
&& ChromeFeatureList.isEnabled(ChromeFeatureList.ANDROID_LAYOUT_CHANGE_TAB_REPARENT)
&& didChangeTabletMode()) {
onScreenLayoutSizeChange();
return;
Expand Down

0 comments on commit 90ac442

Please sign in to comment.