SerpSettingsDataProvider

Read-only access to the settings that the DuckDuckGo SERP pushes to the app (via the serpSettings updateNativeSettings message). Values are exposed by their raw SERP key; callers own the interpretation of the key and its values.

Functions

Link copied to clipboard
abstract fun observeSetting(key: String): Flow<String?>

Observes the raw value the SERP has stored for key, or null when the SERP has not provided it (or when storing SERP settings is disabled).

Link copied to clipboard
abstract suspend fun setSetting(key: String, value: String)

Writes value for key into the stored SERP settings, merging it with any other stored keys. The SERP picks this up the next time it requests native settings (getNativeSettings).