From e8e2127ada5c35ea8565673c7a6b0c921017a456 Mon Sep 17 00:00:00 2001 From: "Torne (Richard Coles)" Date: Tue, 3 Sep 2019 13:46:49 -0400 Subject: [PATCH] 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 cbafe0b025e8. 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 Change-Id: I6119939045a842561811dc018853e3d641275e47 (cherry picked from commit b719f6332b8bccfa07875983af7c190fcf8b8ffb) --- .../com/android/server/webkit/WebViewUpdater.java | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/services/core/java/com/android/server/webkit/WebViewUpdater.java b/services/core/java/com/android/server/webkit/WebViewUpdater.java index a460040d0a604..3b58af2a200f0 100644 --- a/services/core/java/com/android/server/webkit/WebViewUpdater.java +++ b/services/core/java/com/android/server/webkit/WebViewUpdater.java @@ -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