Fix Browser incognito history for intents initiated in the same tab.
Change-Id: Ic3e8168ded978226eeace1fb86960082e8b9ebfd
diff --git a/src/com/android/browser/BrowserActivity.java b/src/com/android/browser/BrowserActivity.java
index e144f99..f380711 100644
--- a/src/com/android/browser/BrowserActivity.java
+++ b/src/com/android/browser/BrowserActivity.java
@@ -706,13 +706,17 @@
url = smartUrlFilter(url);
final ContentResolver cr = mResolver;
final String newUrl = url;
- new AsyncTask<Void, Void, Void>() {
- @Override
- protected Void doInBackground(Void... unused) {
- Browser.updateVisitedHistory(cr, newUrl, false);
- return null;
- }
- }.execute();
+ if (mTabControl == null
+ || mTabControl.getCurrentWebView() == null
+ || !mTabControl.getCurrentWebView().isPrivateBrowsingEnabled()) {
+ new AsyncTask<Void, Void, Void>() {
+ @Override
+ protected Void doInBackground(Void... unused) {
+ Browser.updateVisitedHistory(cr, newUrl, false);
+ return null;
+ }
+ }.execute();
+ }
String searchSource = "&source=android-" + GOOGLE_SEARCH_SOURCE_SUGGEST + "&";
if (url.contains(searchSource)) {
String source = null;