Add x- header to prevent url logging in incognito
Bug: 3336575
Change-Id: I4a65242405d731f74c676382a810f608afcaad39
diff --git a/core/java/android/webkit/HTML5VideoViewProxy.java b/core/java/android/webkit/HTML5VideoViewProxy.java
index 3caf345..2cc3881 100644
--- a/core/java/android/webkit/HTML5VideoViewProxy.java
+++ b/core/java/android/webkit/HTML5VideoViewProxy.java
@@ -77,6 +77,7 @@
private static final int PAUSED = 203;
private static final String COOKIE = "Cookie";
+ private static final String HIDE_URL_LOGS = "x-hide-urls-from-log";
// Timer thread -> UI thread
private static final int TIMEUPDATE = 300;
@@ -184,11 +185,13 @@
mVideoView.setMediaController(new MediaController(proxy.getContext()));
String cookieValue = CookieManager.getInstance().getCookie(url);
- Map<String, String> headers = null;
+ Map<String, String> headers = new HashMap<String, String>();
if (cookieValue != null) {
- headers = new HashMap<String, String>();
headers.put(COOKIE, cookieValue);
}
+ if (mCurrentProxy.getWebView().isPrivateBrowsingEnabled()) {
+ headers.put(HIDE_URL_LOGS, "true");
+ }
mVideoView.setVideoURI(Uri.parse(url), headers);
mVideoView.setOnCompletionListener(proxy);