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

Unverified Commit 48f14216 authored by LuK1337's avatar LuK1337
Browse files

fixup! webkit: SystemImpl: Filter out unavailable providers

Allows non-factory packages to be used.

Fixes: https://gitlab.com/LineageOS/issues/android/-/issues/8764
Change-Id: I318ae9402c7d55ecf2d400a22050d0cb4053ed2b
parent 13084310
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -144,7 +144,7 @@ public class SystemImpl implements SystemInterface {
    @Override
    public WebViewProviderInfo[] getWebViewPackages() {
        return Arrays.stream(mWebViewProviderPackages)
                .filter(x -> isProviderAvailable(x.packageName))
                .filter(this::isProviderAvailable)
                .toArray(WebViewProviderInfo[]::new);
    }

@@ -154,9 +154,9 @@ public class SystemImpl implements SystemInterface {
                .getLongVersionCode();
    }

    private boolean isProviderAvailable(String packageName) {
    private boolean isProviderAvailable(WebViewProviderInfo configInfo) {
        try {
            getFactoryPackageVersion(packageName);
            getPackageInfoForProvider(configInfo);
            return true;
        } catch (NameNotFoundException e) {
            return false;