Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cad9ab60 authored by Grace Kloba's avatar Grace Kloba
Browse files

In some case, like in Email, the WebView can be

detached from Window long after it is destroyed.
As we freed the native side by setting mWebViewCore
to null, we can't access settings any more. In this
case, just hide both styles of zoom control.

Fix http://b/issue?id=2532401
parent 7865fa97
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -5773,6 +5773,15 @@ public class WebView extends AbsoluteLayout
    }

    void dismissZoomControl() {
        if (mWebViewCore == null) {
            // maybe called after WebView's destroy(). As we can't get settings,
            // just hide zoom control for both styles.
            mZoomButtonsController.setVisible(false);
            if (mZoomControls != null) {
                mZoomControls.hide();
            }
            return;
        }
        WebSettings settings = getSettings();
        if (settings.getBuiltInZoomControls()) {
            if (mZoomButtonsController.isVisible()) {