summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBen Murdoch <benm@google.com>2011-07-19 16:51:24 +0100
committerBen Murdoch <benm@google.com>2011-07-21 18:13:22 +0100
commit9999c1d97730e33751ae5a94331797d6850701c6 (patch)
tree288bfacde8cba0215ae49ea26b545c946ff622da
parentedf0178265efee73da80754d1d76e3d69e1f593f (diff)
downloadframeworks_base-9999c1d97730e33751ae5a94331797d6850701c6.zip
frameworks_base-9999c1d97730e33751ae5a94331797d6850701c6.tar.gz
frameworks_base-9999c1d97730e33751ae5a94331797d6850701c6.tar.bz2
Add a System.Secure setting for the Autofill server URL.
The Autofill server is now configured as a system setting. Add that setting and a method to be called over JNI from the chrome stack to retrieve it. See also external/chromium change I3a22ae42402f52207eee2d0d9df64700cb7c9f45 Bug: 4515820 Change-Id: I0aa85c5bef834b1120baaabdc2dd2e4e607a63b6
-rw-r--r--core/java/android/provider/Settings.java4
-rw-r--r--core/java/android/webkit/JniUtil.java15
2 files changed, 16 insertions, 3 deletions
diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java
index ad32047..e2f2fe2 100644
--- a/core/java/android/provider/Settings.java
+++ b/core/java/android/provider/Settings.java
@@ -3853,6 +3853,10 @@ public final class Settings {
/** Timeout in milliseconds to wait for NTP server. {@hide} */
public static final String NTP_TIMEOUT = "ntp_timeout";
+ /** Autofill server address (Used in WebView/browser). {@hide} */
+ public static final String WEB_AUTOFILL_QUERY_URL =
+ "web_autofill_query_url";
+
/**
* @hide
*/
diff --git a/core/java/android/webkit/JniUtil.java b/core/java/android/webkit/JniUtil.java
index bb4d192..620973e 100644
--- a/core/java/android/webkit/JniUtil.java
+++ b/core/java/android/webkit/JniUtil.java
@@ -18,6 +18,7 @@ package android.webkit;
import android.content.Context;
import android.net.Uri;
+import android.provider.Settings;
import android.util.Log;
import java.io.InputStream;
@@ -38,7 +39,7 @@ class JniUtil {
private static boolean initialized = false;
- private static void checkIntialized() {
+ private static void checkInitialized() {
if (!initialized) {
throw new IllegalStateException("Call CookieSyncManager::createInstance() or create a webview before using this class");
}
@@ -63,7 +64,7 @@ class JniUtil {
* @return String The application's database directory
*/
private static synchronized String getDatabaseDirectory() {
- checkIntialized();
+ checkInitialized();
if (sDatabaseDirectory == null)
sDatabaseDirectory = sContext.getDatabasePath("dummy").getParent();
@@ -76,7 +77,7 @@ class JniUtil {
* @return String The application's cache directory
*/
private static synchronized String getCacheDirectory() {
- checkIntialized();
+ checkInitialized();
if (sCacheDirectory == null)
sCacheDirectory = sContext.getCacheDir().getAbsolutePath();
@@ -166,5 +167,13 @@ class JniUtil {
return sUseChromiumHttpStack;
}
+ private static synchronized String getAutofillQueryUrl() {
+ checkInitialized();
+ // If the device has not checked in it won't have pulled down the system setting for the
+ // Autofill Url. In that case we will not make autofill server requests.
+ return Settings.Secure.getString(sContext.getContentResolver(),
+ Settings.Secure.WEB_AUTOFILL_QUERY_URL);
+ }
+
private static native boolean nativeUseChromiumHttpStack();
}