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

Commit 6c9627e6 authored by Ziad Youssef's avatar Ziad Youssef Committed by Android (Google) Code Review
Browse files

Merge "Better error handling for webkit classes" into main

parents bdf3e457 f8f9e9ab
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -40,6 +40,7 @@ import android.text.TextUtils;
import android.util.AndroidRuntimeException;
import android.util.ArraySet;
import android.util.Log;
import android.util.Slog;

import java.io.File;
import java.lang.reflect.Method;
@@ -609,7 +610,7 @@ public final class WebViewFactory {
            startedRelroProcesses = WebViewLibraryLoader.prepareNativeLibraries(packageInfo);
        } catch (Throwable t) {
            // Log and discard errors at this stage as we must not crash the system server.
            Log.e(LOGTAG, "error preparing webview native library", t);
            Slog.wtf(LOGTAG, "error preparing webview native library", t);
        }

        WebViewZygote.onWebViewProviderChanged(packageInfo);
+2 −1
Original line number Diff line number Diff line
@@ -25,6 +25,7 @@ import android.content.pm.PackageInfo;
import android.os.Build;
import android.os.Process;
import android.util.Log;
import android.util.Slog;

import com.android.internal.annotations.VisibleForTesting;
import com.android.server.LocalServices;
@@ -137,7 +138,7 @@ public class WebViewLibraryLoader {
            if (!success) throw new Exception("Failed to start the relro file creator process");
        } catch (Throwable t) {
            // Log and discard errors as we must not crash the system server.
            Log.e(LOGTAG, "error starting relro file creator for abi " + abi, t);
            Slog.wtf(LOGTAG, "error starting relro file creator for abi " + abi, t);
            crashHandler.run();
        }
    }
+2 −0
Original line number Diff line number Diff line
@@ -35,6 +35,7 @@ import android.os.UserManager;
import android.provider.Settings;
import android.util.AndroidRuntimeException;
import android.util.Log;
import android.util.Slog;
import android.webkit.UserPackage;
import android.webkit.WebViewFactory;
import android.webkit.WebViewProviderInfo;
@@ -201,6 +202,7 @@ public class SystemImpl implements SystemInterface {
            ActivityManager.getService().killPackageDependents(packageName,
                    UserHandle.USER_ALL);
        } catch (RemoteException e) {
            Slog.wtf(TAG, "failed to call killPackageDependents for " + packageName, e);
        }
    }

+5 −2
Original line number Diff line number Diff line
@@ -186,9 +186,12 @@ class WebViewUpdateServiceImpl implements WebViewUpdateServiceInterface {
                }
                onWebViewProviderChanged(mCurrentWebViewPackage);
            }
        } catch (WebViewPackageMissingException e) {
            Slog.e(TAG, "Could not find valid WebView package to create relro with", e);
        } catch (Throwable t) {
            // Log and discard errors at this stage as we must not crash the system server.
            Slog.e(TAG, "error preparing webview provider from system server", t);
            // We don't know a case when this should happen but we log and discard errors at this
            // stage as we must not crash the system server.
            Slog.wtf(TAG, "error preparing webview provider from system server", t);
        }

        if (getCurrentWebViewPackage() == null) {
+5 −2
Original line number Diff line number Diff line
@@ -247,9 +247,12 @@ class WebViewUpdateServiceImpl2 implements WebViewUpdateServiceInterface {
                attemptRepair();
            }

        } catch (WebViewPackageMissingException e) {
            Slog.e(TAG, "Could not find valid WebView package to create relro with", e);
        } catch (Throwable t) {
            // Log and discard errors at this stage as we must not crash the system server.
            Slog.e(TAG, "error preparing webview provider from system server", t);
            // We don't know a case when this should happen but we log and discard errors at this
            // stage as we must not crash the system server.
            Slog.wtf(TAG, "error preparing webview provider from system server", t);
        }
    }