Merge "Fix cookie logic for webviews" into udc-qpr-dev
This commit is contained in:
@@ -81,5 +81,7 @@
|
|||||||
Dismiss flow
|
Dismiss flow
|
||||||
</button>
|
</button>
|
||||||
<p id="dismiss_flow"></p>
|
<p id="dismiss_flow"></p>
|
||||||
|
|
||||||
|
<h2>Test <a href="http://www.google.com">hyperlink</a></h2>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ import android.util.Log;
|
|||||||
import android.view.KeyEvent;
|
import android.view.KeyEvent;
|
||||||
import android.webkit.CookieManager;
|
import android.webkit.CookieManager;
|
||||||
import android.webkit.WebView;
|
import android.webkit.WebView;
|
||||||
|
import android.webkit.WebViewClient;
|
||||||
|
|
||||||
import com.android.phone.slice.SlicePurchaseController;
|
import com.android.phone.slice.SlicePurchaseController;
|
||||||
|
|
||||||
@@ -113,8 +114,10 @@ public class SlicePurchaseActivity extends Activity {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create and configure WebView
|
// Clear any cookies that might be persisted from previous sessions before loading WebView
|
||||||
setupWebView();
|
CookieManager.getInstance().removeAllCookies(value -> {
|
||||||
|
setupWebView();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void onPurchaseSuccessful() {
|
protected void onPurchaseSuccessful() {
|
||||||
@@ -176,12 +179,7 @@ public class SlicePurchaseActivity extends Activity {
|
|||||||
private void setupWebView() {
|
private void setupWebView() {
|
||||||
// Create WebView
|
// Create WebView
|
||||||
mWebView = new WebView(this);
|
mWebView = new WebView(this);
|
||||||
|
mWebView.setWebViewClient(new WebViewClient());
|
||||||
// Clear any cookies and state that might be saved from previous sessions
|
|
||||||
CookieManager.getInstance().removeAllCookies(null);
|
|
||||||
CookieManager.getInstance().flush();
|
|
||||||
mWebView.clearCache(true);
|
|
||||||
mWebView.clearHistory();
|
|
||||||
|
|
||||||
// Enable JavaScript for the carrier purchase website to send results back to
|
// Enable JavaScript for the carrier purchase website to send results back to
|
||||||
// the slice purchase application.
|
// the slice purchase application.
|
||||||
|
|||||||
Reference in New Issue
Block a user