From 15e19489e3c312718802fb7ea774f11dcf4217b9 Mon Sep 17 00:00:00 2001 From: Joe Bowser Date: Fri, 9 Jan 2015 11:30:13 -0800 Subject: [PATCH] CB-8026: Bumping up Android Version and setting it up to allow third-party cookies. This might change later. --- framework/project.properties | 2 +- framework/src/org/apache/cordova/CordovaWebView.java | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/framework/project.properties b/framework/project.properties index 9fe04f3b..57bcb9ac 100644 --- a/framework/project.properties +++ b/framework/project.properties @@ -10,7 +10,7 @@ # Indicates whether an apk should be generated for each density. split.density=false # Project target. -target=android-19 +target=android-21 apk-configurations= renderscript.opt.level=O0 android.library=true diff --git a/framework/src/org/apache/cordova/CordovaWebView.java b/framework/src/org/apache/cordova/CordovaWebView.java index 9fc480ce..5323d087 100755 --- a/framework/src/org/apache/cordova/CordovaWebView.java +++ b/framework/src/org/apache/cordova/CordovaWebView.java @@ -50,6 +50,7 @@ import android.webkit.WebSettings; import android.webkit.WebView; import android.webkit.WebSettings.LayoutAlgorithm; import android.webkit.WebViewClient; +import android.webkit.CookieManager; import android.widget.FrameLayout; /* @@ -191,7 +192,14 @@ public class CordovaWebView extends WebView { settings.setJavaScriptEnabled(true); settings.setJavaScriptCanOpenWindowsAutomatically(true); settings.setLayoutAlgorithm(LayoutAlgorithm.NORMAL); - + + // Enable third-party cookies if on Lolipop. TODO: Make this configurable + if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) + { + CookieManager cookieManager = CookieManager.getInstance(); + cookieManager.setAcceptThirdPartyCookies(this, true); + } + // Set the nav dump for HTC 2.x devices (disabling for ICS, deprecated entirely for Jellybean 4.2) try { Method gingerbread_getMethod = WebSettings.class.getMethod("setNavDump", new Class[] { boolean.class });