java-side enable/disable switch for link prefetch via WebSettings

Bug: 5218987
Change-Id: Id59324ad372df76cff8d2cae8606201db6e8d636
diff --git a/core/java/android/webkit/WebSettingsClassic.java b/core/java/android/webkit/WebSettingsClassic.java
index c41bc00..94b46fc 100644
--- a/core/java/android/webkit/WebSettingsClassic.java
+++ b/core/java/android/webkit/WebSettingsClassic.java
@@ -90,6 +90,7 @@
     private boolean         mWorkersEnabled = false;  // only affects V8.
     private boolean         mGeolocationEnabled = true;
     private boolean         mXSSAuditorEnabled = false;
+    private boolean         mLinkPrefetchEnabled = false;
     // HTML5 configuration parameters
     private long            mAppCacheMaxSize = Long.MAX_VALUE;
     private String          mAppCachePath = null;
@@ -1305,6 +1306,16 @@
     }
 
     /**
+     * Enables/disables HTML5 link "prefetch" parameter.
+     */
+    public synchronized void setLinkPrefetchEnabled(boolean flag) {
+        if (mLinkPrefetchEnabled != flag) {
+            mLinkPrefetchEnabled = flag;
+            postSync();
+        }
+    }
+
+    /**
      * @see android.webkit.WebSettings#getJavaScriptEnabled()
      */
     @Override