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

Commit 963dbbbd authored by Gustav Sennton's avatar Gustav Sennton
Browse files

Remove WebView-fallback code for handling the non-functional stub.

We have already removed the non-functional WebView stub, so we can now
remove the logic ensuring that a primary device user could use any
valid WebView package even when a secondary user did not have any
WebView package to choose from (since all device users should always
have a valid package to use as WebView implementation).

Bug: 34730873
Test: run WebViewUpdateServiceTest tests.
Test: Create new user, disable Chrome for that user, ensure WebView
loads for that user and for the primary user.
Change-Id: Ia77cc2efd9e40a157fb5b68a988425ef15508033
parent 087daa0d
Loading
Loading
Loading
Loading
+0 −9
Original line number Diff line number Diff line
@@ -315,15 +315,6 @@ class WebViewUpdater {
            }
        }

        // Could not find any installed and enabled package either, use the most stable and
        // default-available provider.
        // TODO(gsennton) remove this when we have a functional WebView stub.
        for (ProviderAndPackageInfo providerAndPackage : providers) {
            if (providerAndPackage.provider.availableByDefault) {
                return providerAndPackage.packageInfo;
            }
        }

        // This should never happen during normal operation (only with modified system images).
        mAnyWebViewInstalled = false;
        throw new WebViewPackageMissingException("Could not find a loadable WebView package");
+5 −8
Original line number Diff line number Diff line
@@ -1219,14 +1219,11 @@ public class WebViewUpdateServiceTest {

        runWebViewBootPreparationOnMainSync();

        checkPreparationPhasesForPackage(testPackageName, 1 /* first preparation phase */);
        // TODO(gsennton) change this logic to use the code below when we have created a functional
        // stub.
        //Mockito.verify(mTestSystemImpl, Mockito.never()).onWebViewProviderChanged(
        //        Matchers.anyObject());
        //WebViewProviderResponse response = mWebViewUpdateServiceImpl.waitForAndGetProvider();
        //assertEquals(WebViewFactory.LIBLOAD_FAILED_LISTING_WEBVIEW_PACKAGES, response.status);
        //assertEquals(null, mWebViewUpdateServiceImpl.getCurrentWebViewPackage());
        Mockito.verify(mTestSystemImpl, Mockito.never()).onWebViewProviderChanged(
                Matchers.anyObject());
        WebViewProviderResponse response = mWebViewUpdateServiceImpl.waitForAndGetProvider();
        assertEquals(WebViewFactory.LIBLOAD_FAILED_LISTING_WEBVIEW_PACKAGES, response.status);
        assertEquals(null, mWebViewUpdateServiceImpl.getCurrentWebViewPackage());
    }

    @Test