diff --git a/framework/src/org/apache/cordova/engine/SystemCookieManager.java b/framework/src/org/apache/cordova/engine/SystemCookieManager.java index df8cbac337..bc980356c6 100644 --- a/framework/src/org/apache/cordova/engine/SystemCookieManager.java +++ b/framework/src/org/apache/cordova/engine/SystemCookieManager.java @@ -19,8 +19,6 @@ Licensed to the Apache Software Foundation (ASF) under one package org.apache.cordova.engine; -import android.annotation.TargetApi; -import android.os.Build; import android.webkit.CookieManager; import android.webkit.WebView; @@ -35,10 +33,14 @@ public SystemCookieManager(WebView webview) { webView = webview; cookieManager = CookieManager.getInstance(); - cookieManager.setAcceptFileSchemeCookies(true); cookieManager.setAcceptThirdPartyCookies(webView, true); } + @SuppressWarnings("deprecation") + public void setAcceptFileSchemeCookies() { + cookieManager.setAcceptFileSchemeCookies(true); + } + public void setCookiesEnabled(boolean accept) { cookieManager.setAcceptCookie(accept); } diff --git a/framework/src/org/apache/cordova/engine/SystemWebViewEngine.java b/framework/src/org/apache/cordova/engine/SystemWebViewEngine.java index 71fa33dd1c..5ff1abfff6 100755 --- a/framework/src/org/apache/cordova/engine/SystemWebViewEngine.java +++ b/framework/src/org/apache/cordova/engine/SystemWebViewEngine.java @@ -165,6 +165,7 @@ private void initWebViewSettings() { LOG.d(TAG, "Enabled insecure file access"); settings.setAllowFileAccess(true); settings.setAllowUniversalAccessFromFileURLs(true); + cookieManager.setAcceptFileSchemeCookies(); } settings.setMediaPlaybackRequiresUserGesture(false);