Class GeckoPreferenceController.Observer

Object
org.mozilla.geckoview.GeckoPreferenceController.Observer
Enclosing class:
GeckoPreferenceController

public static final class GeckoPreferenceController.Observer extends Object
The Observer class contains utilities for monitoring preference changes in Gecko.
  • 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.