Class Preferences
- java.lang.Object
-
- aero.panasonic.inflight.services.user.v2.Sync
-
- aero.panasonic.inflight.services.user.v2.preferences.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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classPreferences.ConflictKeysclassPreferences.Key-
Nested classes/interfaces inherited from class aero.panasonic.inflight.services.user.v2.Sync
Sync.SyncListener
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<java.lang.String>getAlbumGenreReferenceList()Gets the reference list for album genre.java.util.List<java.lang.String>getMovieGenreReferenceList()Gets the reference list for movie genre.PreferenceItemgetPreferences()java.util.List<java.lang.String>getTvseriesGenreReferenceList()Gets the reference list for tv series genre.static voidinitService(Context context, IInFlightCallback inFlightCallback, InFlight inFlight)This api is the starting point for Preference.voidsetConflictStrategy(ConflictStrategy strategy)Sets the strategy for resolving conflicts.voidsetField(java.lang.String keyName, java.lang.Object value)Sets the specified field in the preferences with the given key and value.voidsetGenres(java.util.Map<java.lang.String,java.util.List<java.lang.String>> favoriteGenres)Sets the preferred genre for the passenger.voidsetInteractiveBrightness(java.lang.Integer brightness)Set the preferred interactive brightness, the valid value is 1-100.voidsetInteractiveTheme(java.lang.String theme)Set the preferred interactive theme.voidsetLanguage(java.lang.String iso)Sets the preferred language for the passenger.voidsetParentalControlRating(java.lang.String name)Sets the preferred parental control rating, such as G (general) and GP (general with parential guidance), for the passenger.voidsetSoundtrackLanguage(java.lang.String iso)Sets the preferred soundtrack language for the passenger.voidsetSubtitleLanguage(java.lang.String iso)Sets the preferred subtitle language for the passenger.voidsetSyncListener(Sync.SyncListener syncListener)Sets a listener to listen for the syncronization updates.voidsynchronize()Triggers the synchronization.Create new playlist with nameCreate new playlist with name-
Methods inherited from class aero.panasonic.inflight.services.user.v2.Sync
getConflicts
-
-
-
-
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 viaIInFlightCallbackonce it has been initialized.- Parameters:
context- - ContextinFlightCallback-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.
-
getPreferences
public PreferenceItem getPreferences()
-
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, ornullif no value is provided.- Throws:
java.lang.IllegalArgumentException- iffieldisnull.
-
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.IllegalArgumentExceptionSet 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:SyncSets a listener to listen for the syncronization updates.- Overrides:
setSyncListenerin classSync- Parameters:
syncListener-Sync.SyncListenercallback invoked indicating the result of sync operation performed.
-
setConflictStrategy
public void setConflictStrategy(ConflictStrategy strategy)
Description copied from class:SyncSets the strategy for resolving conflicts.ConflictStrategy
Default isConflictStrategy.USER_DEFINED- Overrides:
setConflictStrategyin classSync
-
synchronize
public void synchronize()
Description copied from class:SyncTriggers the synchronization.Create new playlist with nameCreate new playlist with name- Overrides:
synchronizein classSync
-
-