summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Gustav Sennton <gsennton@google.com> 2016-04-12 16:38:28 +0100
committer Gustav Sennton <gsennton@google.com> 2016-04-12 16:46:26 +0100
commit2198a53ea497739334f0b9c696c5b5077e349321 (patch)
tree6e3fd2ef8f62ec427b6d6911caf5fbac46c72b02
parentb026b6a40f69d8068e4f9fd6324c81607191995d (diff)
Don't run the WebView preparation if using the same non-replaced package
Whenever all primary WebView packages become disabled or uninstalled the fallback will be enabled and then used. The enabling causes an intent to be broadcasted and that intent then causes WebViewUpdateService to rerun its WebView preparation phase. With this CL we ignore intents for changing the enabled-state of the current WebView package if we will still use the same WebView package. The only time we should rerun the preparation logic when the package is the same (if it has the same name) is if it has been replaced by a new version. Bug: 27899444 Change-Id: Iea029e9f854e31b25b1803048c470fb6732e5d0f
-rw-r--r--services/core/java/com/android/server/webkit/WebViewUpdateServiceImpl.java10
1 files changed, 9 insertions, 1 deletions
diff --git a/services/core/java/com/android/server/webkit/WebViewUpdateServiceImpl.java b/services/core/java/com/android/server/webkit/WebViewUpdateServiceImpl.java
index cd976e753a0a..487bc0f4f9ed 100644
--- a/services/core/java/com/android/server/webkit/WebViewUpdateServiceImpl.java
+++ b/services/core/java/com/android/server/webkit/WebViewUpdateServiceImpl.java
@@ -243,8 +243,16 @@ public class WebViewUpdateServiceImpl {
synchronized(mLock) {
try {
newPackage = findPreferredWebViewPackage();
- if (mCurrentWebViewPackage != null)
+ 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;
+ }
+ }
// Only trigger update actions if the updated package is the one
// that will be used, or the one that was in use before the
// update, or if we haven't seen a valid WebView package before.