Class Preferences


  • public class Preferences
    extends Sync

    Package Starting Point - This class is responsible for holding and persisting user preferences, such as preferred language and preferred parental rating.



    • Method Detail

      • initService

        public static void initService​(Context context,
                                       IInFlightCallback inFlightCallback,
                                       InFlight inFlight)
        This api is the starting point for Preference. The service object will be provided via IInFlightCallback once it has been initialized.
        Parameters:
        context - - Context
        inFlightCallback - IInFlightCallback - this callback will be invoked once service has been initialized.
        inFlight - - Reference of InFlight
        Example:
         FavoritesList.initService(context, inflightCallbackListener);
         

        public void onInitServiceComplete(Object serviceObj,String serviceName) { if(serviceName.equals(InFlightServices.PREFERENCES_V2_SERVICE.getServiceName())) { playlistV1 = (Playlist) serviceObj; playlistV1.add(playlistItem); } }

      • getMovieGenreReferenceList

        public java.util.List<java.lang.String> getMovieGenreReferenceList()
        Gets the reference list for movie genre.
        Returns:
        a list of movie genre reference list.
      • getTvseriesGenreReferenceList

        public java.util.List<java.lang.String> getTvseriesGenreReferenceList()
        Gets the reference list for tv series genre.
        Returns:
        a list of tv series genre reference list.
      • getAlbumGenreReferenceList

        public java.util.List<java.lang.String> getAlbumGenreReferenceList()
        Gets the reference list for album genre.
        Returns:
        a list of album genre reference list.
      • setField

        public void setField​(java.lang.String keyName,
                             java.lang.Object value)
        Sets the specified field in the preferences with the given key and value. *
        Parameters:
        keyName - the key of the field to be updated or added. This key should be a non-null string.
        value - the value to be associated with the specified key. This can be any object, or null if no value is provided.
        Throws:
        java.lang.IllegalArgumentException - if field is null.
      • setInteractiveTheme

        public void setInteractiveTheme​(java.lang.String theme)
        Set the preferred interactive theme.
        Parameters:
        theme - Interactive theme.
      • setInteractiveBrightness

        public void setInteractiveBrightness​(java.lang.Integer brightness)
                                      throws java.lang.IllegalArgumentException
        Set the preferred interactive brightness, the valid value is 1-100.
        Parameters:
        brightness - Interactive brightness.
        Throws:
        java.lang.IllegalArgumentException
      • setLanguage

        public void setLanguage​(java.lang.String iso)
        Sets the preferred language for the passenger. The specified language displays on the seatback monitor.

        The language is specified as ISO 639-2 language code. If not specified, defaults to the language specified in the interactive app.
        Parameters:
        iso - language ISO 639-2 language code. If not specified, defaults to the language specified in the interactive app.
      • setParentalControlRating

        public void setParentalControlRating​(java.lang.String name)
        Sets the preferred parental control rating, such as G (general) and GP (general with parential guidance), for the passenger. This API can only used by PED. Seatback user not supposed to use this API.
        Parameters:
        name - Parental control rating
      • setSubtitleLanguage

        public void setSubtitleLanguage​(java.lang.String iso)
        Sets the preferred subtitle language for the passenger. The specified language displays in media content.

        The language is specified as ISO 639-2 language code. If not specified, defaults to the language specified in the interactive app.
        Parameters:
        iso - language ISO 639-2 language code. If not specified, defaults to the language specified in the interactive app.
      • setSoundtrackLanguage

        public void setSoundtrackLanguage​(java.lang.String iso)
        Sets the preferred soundtrack language for the passenger. The specified language displays in media content.

        The language is specified as ISO 639-2 language code. If not specified, defaults to the language specified in the interactive app.
        Parameters:
        iso - language ISO 639-2 language code. If not specified, defaults to the language specified in the interactive app.
      • setGenres

        public void setGenres​(java.util.Map<java.lang.String,​java.util.List<java.lang.String>> favoriteGenres)
        Sets the preferred genre for the passenger. The genre displays in the media conttent.

        The call provides a map of content types, such as movies, tv and music, with the list of genres, such as comedy and horror.
      • setSyncListener

        public void setSyncListener​(Sync.SyncListener syncListener)
        Description copied from class: Sync
        Sets a listener to listen for the syncronization updates.
        Overrides:
        setSyncListener in class Sync
        Parameters:
        syncListener - Sync.SyncListener callback invoked indicating the result of sync operation performed.
      • synchronize

        public void synchronize()
        Description copied from class: Sync
        Triggers the synchronization.Create new playlist with nameCreate new playlist with name
        Overrides:
        synchronize in class Sync