Package org.mozilla.geckoview
Class GeckoPreferenceController.Observer
Object
org.mozilla.geckoview.GeckoPreferenceController.Observer
- Enclosing class:
- GeckoPreferenceController
The Observer class contains utilities for monitoring preference changes in Gecko.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interface
Delegate definition for observing Gecko preferences. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic GeckoResult<Void>
registerPreference
(String preferenceName) This will register a preference for observation.static GeckoResult<Void>
registerPreferences
(List<String> preferenceNames) This will register preferences for observation.static GeckoResult<Void>
unregisterPreference
(String preferenceName) This will deregister a preference for observation.static GeckoResult<Void>
unregisterPreferences
(List<String> preferenceNames) This will deregister preferences for observation.
-
Constructor Details
-
Observer
public Observer()
-
-
Method Details
-
registerPreference
@AnyThread @NonNull public static GeckoResult<Void> registerPreference(@NonNull String preferenceName) This will register a preference for observation.- Parameters:
preferenceName
- The Gecko preference that should be placed under observation. e.g., "some.pref.item".- Returns:
- The GeckoResult will complete with the current preference value when observation is set.
-
registerPreferences
@AnyThread @NonNull public static GeckoResult<Void> registerPreferences(@NonNull List<String> preferenceNames) This will register preferences for observation.- Parameters:
preferenceNames
- A list of Gecko preference that should be placed under observation. e.g., "some.pref.item", "some.pref.item.other".- Returns:
- The GeckoResult will complete with the current preference value when observation is set.
-
unregisterPreference
@UiThread @NonNull public static GeckoResult<Void> unregisterPreference(@NonNull String preferenceName) This will deregister a preference for observation.- Parameters:
preferenceName
- The Gecko preference that should be removed from observation. e.g., "some.pref.item".- Returns:
- The GeckoResult will complete when the observer is removed. If the item requested is not under observation, the function will still return.
-
unregisterPreferences
@UiThread @NonNull public static GeckoResult<Void> unregisterPreferences(@NonNull List<String> preferenceNames) This will deregister preferences for observation.- Parameters:
preferenceNames
- The Gecko preferences that should be removed from observation. e.g., "some.pref.item", "some.pref.item.other".- Returns:
- The GeckoResult will complete when the observer is removed. If the item requested is not under observation, the function will still return.
-