Open Bug 1794935 Opened 3 years ago Updated 1 year ago

Improve Engine and EngineSession settings API

Categories

(Firefox for Android :: Browser Engine, task, P5)

All
Android
task

Tracking

()

People

(Reporter: csadilek, Unassigned)

Details

From github: https://github.com/mozilla-mobile/android-components/issues/7262.

Integrating the engine component into Focus I ran into some issues with the settings API and feel like we may be able to improve some things in that area.

I think what's unclear at times is where I have to apply a setting. Do I need to change the setting on Engine.settings or on EngineSettings or on the DefaultSettings that I pass to the Engine. The latter surprised me the most.

As an example I was trying to apply the tracking protection settings whenever the user changed something. I noticed that I could use UpdateTrackingProtectionUseCase for that. Internally I saw that it would apply it to the engine and every session. However it still didn't work for new sessions. After a while I noticed that the default settings I pass in and Engine.settings are actually two distinct things. One of them applies things on the runtime, the other one is used for settings passed to a GeckoSession whenever we create one. Only after additionally keeping a reference to the DefaultSettings and also changing them I could see the new settings being reflected on a new tab.

However I am still not sure what engine.settings.trackingProtectionPolicy is actually good for (it does set something on the runtime) since we set it on every session too. Then there's also EngineSession.settings.trackingProtectionPolicy, but also EngineSession.enableTrackingProtection(policy) - which seems redundant?

I think what may have helped here is having separate types for settings of an engine vs. settings of an engine session (EngineSettings, EngineSessionSettings?). This would make it more obvious whether things I pass into Engine are for the engine itself, or are the defaults for new engine sessions. 🤔

In Focus I want to continue with hooking up the "on/off" switch in the UI to enable/disabled tracking protection for the current tab and to be honest I have no clue where to do that. I assume not on the engine? Only on the session? But does this work with all the runtime settings applied too?

┆Issue is synchronized with this Jira Task

Change performed by the Move to Bugzilla add-on.

Severity: -- → N/A
Type: defect → task
Priority: -- → P5
You need to log in before you can comment on or make changes to this bug.