diff --git a/app/src/common/shared/org/mozilla/vrbrowser/browser/engine/Session.java b/app/src/common/shared/org/mozilla/vrbrowser/browser/engine/Session.java index 41f3a2b64..4031d125a 100644 --- a/app/src/common/shared/org/mozilla/vrbrowser/browser/engine/Session.java +++ b/app/src/common/shared/org/mozilla/vrbrowser/browser/engine/Session.java @@ -468,7 +468,7 @@ public void recreateSession() { mState = mState.recreate(); TrackingProtectionPolicy policy = TrackingProtectionStore.getTrackingProtectionPolicy(mContext); - mState.mSettings.setTrackingProtectionEnabled(policy.shouldBlockContent()); + mState.mSettings.setTrackingProtectionEnabled(mState.mSettings.isPrivateBrowsingEnabled() || policy.shouldBlockContent()); restore(); diff --git a/app/src/common/shared/org/mozilla/vrbrowser/browser/engine/SessionSettings.java b/app/src/common/shared/org/mozilla/vrbrowser/browser/engine/SessionSettings.java index 744fcb84d..96cc355fc 100644 --- a/app/src/common/shared/org/mozilla/vrbrowser/browser/engine/SessionSettings.java +++ b/app/src/common/shared/org/mozilla/vrbrowser/browser/engine/SessionSettings.java @@ -89,11 +89,13 @@ public Builder() { public Builder withPrivateBrowsing(boolean enabled) { isPrivateBrowsingEnabled = enabled; + isTrackingProtectionEnabled = isPrivateBrowsingEnabled || isTrackingProtectionEnabled; + return this; } public Builder withTrackingProtection(boolean isTrackingProtectionEnabled){ - this.isTrackingProtectionEnabled = isTrackingProtectionEnabled; + this.isTrackingProtectionEnabled = isPrivateBrowsingEnabled || isTrackingProtectionEnabled; return this; } diff --git a/app/src/main/res/layout/navigation_url.xml b/app/src/main/res/layout/navigation_url.xml index 7e8ab0438..daddc8bbd 100644 --- a/app/src/main/res/layout/navigation_url.xml +++ b/app/src/main/res/layout/navigation_url.xml @@ -53,7 +53,7 @@ android:src="@{viewmodel.isTrackingEnabled ? @drawable/ic_icon_tracking_enabled : @drawable/ic_icon_tracking_disabled}" app:privateMode="@{viewmodel.isPrivateSession}" android:tint="@color/fog" - app:visibleGone="@{settingsViewmodel.isTrackingProtectionEnabled && !UrlUtils.isContentFeed(context, viewmodel.url.toString())}" + app:visibleGone="@{!viewmodel.isPrivateSession && settingsViewmodel.isTrackingProtectionEnabled && !UrlUtils.isContentFeed(context, viewmodel.url.toString())}" android:tooltipText="@{viewmodel.isTrackingEnabled ? @string/tracking_allowed_tooltip : @string/tracking_disabled_tooltip}" /> + app:visibleGone="@{((!settingsViewmodel.isTrackingProtectionEnabled || viewmodel.isPrivateSession) && !viewmodel.isPopUpAvailable && !viewmodel.isWebXRUsed) || viewmodel.isLibraryVisible || UrlUtils.isHomeUri(context, viewmodel.url.toString())}"/>