summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve Block <steveblock@google.com>2010-10-25 04:44:41 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2010-10-25 04:44:41 -0700
commit16b7a1b967468e6d3a1b5f2c254320e5909527cc (patch)
treeb10dee80cb5fa977023cc45dee3c16ed21c5a1e8
parentd55f7e56b9761227f0a310b34d9016fde91613d6 (diff)
parent2d80ede01afde8a0f484f012e395a97e04e32d36 (diff)
downloadframeworks_base-16b7a1b967468e6d3a1b5f2c254320e5909527cc.zip
frameworks_base-16b7a1b967468e6d3a1b5f2c254320e5909527cc.tar.gz
frameworks_base-16b7a1b967468e6d3a1b5f2c254320e5909527cc.tar.bz2
Merge "Add a JNI method to determine which HTTP stack is in use"
-rw-r--r--core/java/android/webkit/CookieManager.java22
1 files changed, 17 insertions, 5 deletions
diff --git a/core/java/android/webkit/CookieManager.java b/core/java/android/webkit/CookieManager.java
index 61a8cda..3010178 100644
--- a/core/java/android/webkit/CookieManager.java
+++ b/core/java/android/webkit/CookieManager.java
@@ -98,6 +98,10 @@ public final class CookieManager {
private boolean mAcceptCookie = true;
+ // TODO: Remove this if/when we permanently switch to the Chromium HTTP stack
+ // http:/b/3118772
+ private static Boolean sUseChromiumHttpStack;
+
/**
* This contains a list of 2nd-level domains that aren't allowed to have
* wildcards when combined with country-codes. For example: [.co.uk].
@@ -257,6 +261,13 @@ public final class CookieManager {
return sRef;
}
+ private static boolean useChromiumHttpStack() {
+ if (sUseChromiumHttpStack == null) {
+ sUseChromiumHttpStack = nativeUseChromiumHttpStack();
+ }
+ return sUseChromiumHttpStack;
+ }
+
/**
* Control whether cookie is enabled or disabled
* @param accept TRUE if accept cookie
@@ -524,11 +535,11 @@ public final class CookieManager {
* Remove all cookies
*/
public void removeAllCookie() {
- // Clear cookies for the Chromium HTTP stack
- nativeRemoveAllCookie();
- // Clear cookies for the Android HTTP stack
- // TODO: Remove this if/when we permanently switch to the Chromium HTTP stack
- // http:/b/3118772
+ if (useChromiumHttpStack()) {
+ nativeRemoveAllCookie();
+ return;
+ }
+
final Runnable clearCache = new Runnable() {
public void run() {
synchronized(CookieManager.this) {
@@ -1023,5 +1034,6 @@ public final class CookieManager {
}
// Native functions
+ private static native boolean nativeUseChromiumHttpStack();
private static native void nativeRemoveAllCookie();
}