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

Commit 29675b29 authored by Torne (Richard Coles)'s avatar Torne (Richard Coles)
Browse files

Fix NPE in WebView relro creator process.

There's no context available in the relro creator process, resulting in
a NPE and crash when it tries to see if WebView is supported. Skip the
check in this case, because we know it's supported if we ran the relro
creation process at all.

Change-Id: I95e9aad7407b8f73dddf8a8b685d41d2f500736a
Fixes: 67398770
Test: boot, make sure no crash dialog from "android"
parent cc78a9b6
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -492,10 +492,15 @@ public final class WebViewFactory {
    /** @hide */
    public static IWebViewUpdateService getUpdateService() {
        if (isWebViewSupported()) {
            return IWebViewUpdateService.Stub.asInterface(
                    ServiceManager.getService(WEBVIEW_UPDATE_SERVICE_NAME));
            return getUpdateServiceUnchecked();
        } else {
            return null;
        }
    }

    /** @hide */
    static IWebViewUpdateService getUpdateServiceUnchecked() {
        return IWebViewUpdateService.Stub.asInterface(
                ServiceManager.getService(WEBVIEW_UPDATE_SERVICE_NAME));
    }
}
+1 −1
Original line number Diff line number Diff line
@@ -80,7 +80,7 @@ class WebViewLibraryLoader {
            } finally {
                // We must do our best to always notify the update service, even if something fails.
                try {
                    WebViewFactory.getUpdateService().notifyRelroCreationCompleted();
                    WebViewFactory.getUpdateServiceUnchecked().notifyRelroCreationCompleted();
                } catch (RemoteException e) {
                    Log.e(LOGTAG, "error notifying update service", e);
                }