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

Commit e8e2127a authored by Torne (Richard Coles)'s avatar Torne (Richard Coles) Committed by Richard Coles
Browse files

WebView: pay attention to PACKAGE_CHANGED.

PackageManager sends PACKAGE_CHANGED for a package if one of its static
shared library dependencies has been reinstalled as of cbafe0b0.
When this occurs, we need to update our cached copy of the PackageInfo,
and restart the webview_zygote and RELRO preparation process, because
the path to the library in the PackageInfo will now be different.

This fixes the issue where if TrichromeLibrary is reinstalled at the
same version, WebView can no longer spawn renderer processes because the
webview_zygote is still being given the old classpath.

Both cases where we early out are removed, as the last update time is
also not changed in this case. This may result in the update logic
triggering in cases where it previously would not, but since we don't
explicitly kill clients in this case, it shouldn't affect use of
WebView.

Bug: 140129991
Test: adb install -r <same version of TrichromeLibrary.apk>
Change-Id: I6119939045a842561811dc018853e3d641275e47
(cherry picked from commit b719f633)
parent a86312e0
Loading
Loading
Loading
Loading
+0 −13
Original line number Diff line number Diff line
@@ -87,19 +87,6 @@ class WebViewUpdater {
                        newPackage = findPreferredWebViewPackage();
                        if (mCurrentWebViewPackage != null) {
                            oldProviderName = mCurrentWebViewPackage.packageName;
                            if (changedState == WebViewUpdateService.PACKAGE_CHANGED
                                    && newPackage.packageName.equals(oldProviderName)) {
                                // If we don't change package name we should only rerun the
                                // preparation phase if the current package has been replaced
                                // (not if it has been enabled/disabled).
                                return;
                            }
                            if (newPackage.packageName.equals(oldProviderName)
                                    && (newPackage.lastUpdateTime
                                        == mCurrentWebViewPackage.lastUpdateTime)) {
                                // If the chosen package hasn't been updated, then early-out
                                return;
                            }
                        }
                        // Only trigger update actions if the updated package is the one
                        // that will be used, or the one that was in use before the