Dan Ballard pushed to branch firefox-android-115.2.1-13.0-1 at The Tor Project / Applications / firefox-android
Commits: 533daef0 by clairehurst at 2023-09-26T17:59:27+00:00 fixup! Disable features and functionality
- - - - -
3 changed files:
- fenix/app/src/main/java/org/mozilla/fenix/settings/quicksettings/QuickSettingsSheetDialogFragment.kt - fenix/app/src/main/java/org/mozilla/fenix/settings/quicksettings/protections/ProtectionsView.kt - fenix/app/src/main/res/layout/quicksettings_protections_panel.xml
Changes:
===================================== fenix/app/src/main/java/org/mozilla/fenix/settings/quicksettings/QuickSettingsSheetDialogFragment.kt ===================================== @@ -132,7 +132,8 @@ class QuickSettingsSheetDialogFragment : FenixDialogFragment() {
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { super.onViewCreated(view, savedInstanceState) - observeTrackersChange(requireComponents.core.store) +// Removed as part of Bug_42115: Enhanced Tracking Protection can still be enabled +// observeTrackersChange(requireComponents.core.store) consumeFrom(quickSettingsStore) { websiteInfoView.update(it.webInfoState) websitePermissionsView.update(it.websitePermissionsState) @@ -190,34 +191,36 @@ class QuickSettingsSheetDialogFragment : FenixDialogFragment() { @VisibleForTesting internal fun provideTabId(): String = args.sessionId
- @VisibleForTesting - internal fun observeTrackersChange(store: BrowserStore) { - consumeFlow(store) { flow -> - flow.mapNotNull { state -> - state.findTabOrCustomTab(provideTabId()) - }.ifAnyChanged { tab -> - arrayOf( - tab.trackingProtection.blockedTrackers, - tab.trackingProtection.loadedTrackers, - ) - }.collect { - updateTrackers(it) - } - } - } - - @VisibleForTesting - internal fun updateTrackers(tab: SessionState) { - provideTrackingProtectionUseCases().fetchTrackingLogs( - tab.id, - onSuccess = { trackers -> - protectionsView.updateDetailsSection(trackers.isNotEmpty()) - }, - onError = { - Logger.error("QuickSettingsSheetDialogFragment - fetchTrackingLogs onError", it) - }, - ) - } +// Removed as part of Bug_42115: Enhanced Tracking Protection can still be enabled +// @VisibleForTesting +// internal fun observeTrackersChange(store: BrowserStore) { +// consumeFlow(store) { flow -> +// flow.mapNotNull { state -> +// state.findTabOrCustomTab(provideTabId()) +// }.ifAnyChanged { tab -> +// arrayOf( +// tab.trackingProtection.blockedTrackers, +// tab.trackingProtection.loadedTrackers, +// ) +// }.collect { +// updateTrackers(it) +// } +// } +// } + +// Removed as part of Bug_42115: Enhanced Tracking Protection can still be enabled +// @VisibleForTesting +// internal fun updateTrackers(tab: SessionState) { +// provideTrackingProtectionUseCases().fetchTrackingLogs( +// tab.id, +// onSuccess = { trackers -> +// protectionsView.updateDetailsSection(trackers.isNotEmpty()) +// }, +// onError = { +// Logger.error("QuickSettingsSheetDialogFragment - fetchTrackingLogs onError", it) +// }, +// ) +// }
@VisibleForTesting internal fun provideTrackingProtectionUseCases() = requireComponents.useCases.trackingProtectionUseCases
===================================== fenix/app/src/main/java/org/mozilla/fenix/settings/quicksettings/protections/ProtectionsView.kt ===================================== @@ -54,28 +54,32 @@ class ProtectionsView( * Allows changing what this View displays. */ fun update(state: ProtectionsState) { - bindTrackingProtectionInfo(state.isTrackingProtectionEnabled) +// Removed as part of Bug_42115: Enhanced Tracking Protection can still be enabled +// bindTrackingProtectionInfo(state.isTrackingProtectionEnabled) bindCookieBannerProtection(state.cookieBannerUIMode) - binding.trackingProtectionSwitch.isVisible = settings.shouldUseTrackingProtection +// Removed as part of Bug_42115: Enhanced Tracking Protection can still be enabled +// binding.trackingProtectionSwitch.isVisible = settings.shouldUseTrackingProtection binding.cookieBannerItem.isVisible = shouldShowCookieBanner && state.cookieBannerUIMode != CookieBannerUIMode.HIDE - - binding.trackingProtectionDetails.setOnClickListener { - interactor.onTrackingProtectionDetailsClicked() - } +// Removed as part of Bug_42115: Enhanced Tracking Protection can still be enabled +// binding.trackingProtectionDetails.setOnClickListener { +// interactor.onTrackingProtectionDetailsClicked() +// } }
- @VisibleForTesting - internal fun updateDetailsSection(show: Boolean) { - binding.trackingProtectionDetails.isVisible = show - } - - private fun bindTrackingProtectionInfo(isTrackingProtectionEnabled: Boolean) { - binding.trackingProtectionSwitch.isChecked = isTrackingProtectionEnabled - binding.trackingProtectionSwitch.setOnCheckedChangeListener { _, isChecked -> - interactor.onTrackingProtectionToggled(isChecked) - } - } +// Removed as part of Bug_42115: Enhanced Tracking Protection can still be enabled +// @VisibleForTesting +// internal fun updateDetailsSection(show: Boolean) { +// binding.trackingProtectionDetails.isVisible = show +// } + +// Removed as part of Bug_42115: Enhanced Tracking Protection can still be enabled +// private fun bindTrackingProtectionInfo(isTrackingProtectionEnabled: Boolean) { +// binding.trackingProtectionSwitch.isChecked = isTrackingProtectionEnabled +// binding.trackingProtectionSwitch.setOnCheckedChangeListener { _, isChecked -> +// interactor.onTrackingProtectionToggled(isChecked) +// } +// }
@VisibleForTesting internal val binding = QuicksettingsProtectionsPanelBinding.inflate(
===================================== fenix/app/src/main/res/layout/quicksettings_protections_panel.xml ===================================== @@ -12,36 +12,38 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:minHeight="@dimen/tracking_protection_item_height" - app:layout_constraintBottom_toTopOf="@id/trackingProtectionSwitch" + app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintTop_toTopOf="parent" />
- <org.mozilla.fenix.trackingprotection.SwitchWithDescription - android:id="@+id/trackingProtectionSwitch" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_marginTop="16dp" - android:minHeight="@dimen/tracking_protection_item_height" - android:text="@string/preference_enhanced_tracking_protection" - app:layout_constraintBottom_toTopOf="@id/trackingProtectionDetails" - app:layout_constraintTop_toBottomOf="@id/cookieBannerItem" - app:switchDescriptionOff="@string/etp_panel_off" - app:switchDescriptionOn="@string/etp_panel_on" - app:switchIconOff="@drawable/ic_tracking_protection_disabled" - app:switchIconOn="@drawable/ic_tracking_protection_enabled" - app:switchTitle="@string/preference_enhanced_tracking_protection" /> +<!-- Removed as part of Bug_42115: Enhanced Tracking Protection can still be enabled--> +<!-- <org.mozilla.fenix.trackingprotection.SwitchWithDescription--> +<!-- android:id="@+id/trackingProtectionSwitch"--> +<!-- android:layout_width="match_parent"--> +<!-- android:layout_height="wrap_content"--> +<!-- android:layout_marginTop="16dp"--> +<!-- android:minHeight="@dimen/tracking_protection_item_height"--> +<!-- android:text="@string/preference_enhanced_tracking_protection"--> +<!-- app:layout_constraintBottom_toTopOf="@id/trackingProtectionDetails"--> +<!-- app:layout_constraintTop_toBottomOf="@id/cookieBannerItem"--> +<!-- app:switchDescriptionOff="@string/etp_panel_off"--> +<!-- app:switchDescriptionOn="@string/etp_panel_on"--> +<!-- app:switchIconOff="@drawable/ic_tracking_protection_disabled"--> +<!-- app:switchIconOn="@drawable/ic_tracking_protection_enabled"--> +<!-- app:switchTitle="@string/preference_enhanced_tracking_protection" />-->
- <TextView - android:id="@+id/trackingProtectionDetails" - style="@style/QuickSettingsText.Icon" - android:layout_width="0dp" - android:layout_height="@dimen/quicksettings_item_height" - android:layout_alignParentEnd="true" - android:gravity="end|center_vertical" - android:text="@string/enhanced_tracking_protection_details" - android:visibility="gone" - app:drawableEndCompat="@drawable/ic_arrowhead_right" - app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintStart_toStartOf="parent" /> + <!-- Removed as part of Bug_42115: Enhanced Tracking Protection can still be enabled--> +<!-- <TextView--> +<!-- android:id="@+id/trackingProtectionDetails"--> +<!-- style="@style/QuickSettingsText.Icon"--> +<!-- android:layout_width="0dp"--> +<!-- android:layout_height="@dimen/quicksettings_item_height"--> +<!-- android:layout_alignParentEnd="true"--> +<!-- android:gravity="end|center_vertical"--> +<!-- android:text="@string/enhanced_tracking_protection_details"--> +<!-- android:visibility="gone"--> +<!-- app:drawableEndCompat="@drawable/ic_arrowhead_right"--> +<!-- app:layout_constraintBottom_toBottomOf="parent"--> +<!-- app:layout_constraintEnd_toEndOf="parent"--> +<!-- app:layout_constraintStart_toStartOf="parent" />-->
</androidx.constraintlayout.widget.ConstraintLayout>
View it on GitLab: https://gitlab.torproject.org/tpo/applications/firefox-android/-/commit/533d...
tbb-commits@lists.torproject.org