Class Pairing
- java.lang.Object
-
- aero.panasonic.inflight.services.pairing.v1.Pairing
-
public final class Pairing extends java.lang.ObjectPackage Starting Point - The Pairing class starts a pairing session between the interactive seatback monitor and the passenger's personal electronic device (PED). Pairing is a single point of contact for pairing related services.
The status of the pair or unpair operations are passed back in
Pairing.SeatPairingStatusChangedListenercallback registered for the various operation types. In case of error,Pairing.Erroris passed back.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classPairing.ErrorError description for Pairing.static interfacePairing.PairingGuiDisplayListenerInterface to handle GUI display events related to embedded pairing operations.static classPairing.PairStatusThe pair status values are paired, not paired and pair status unknown.static interfacePairing.SeatPairingErrorListenerInvoked if error occurs.static interfacePairing.SeatPairingStatusChangedListenerstatic interfacePairing.SeatPropertyReceivedListener
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcancelPasscode()Cancel passcode.voidconfirmPairing()Confirm pairing.AppControlgetAppControl()Provides access to theAppControlinstance, which manages app control events from the PED, such as launching or quitting the app on the seatback monitor.MediaPlayerControlgetMediaPlayerControl()Gets an instance of the MediaPlayer controller that allows the seatback monitor to listen to media player messages.MediaQueuegetMediaQueue()Gets the media queue from the seatback monitor.Pairing.PairStatusgetPairStatus()Gets the status of the pairing.voidinitiatePairing()Initiates pairing from the seatback monitor to the personal electronic device.static voidinitService(Context context, IInFlightCallback inFlightCallback, InFlight inFlight)This API is the starting point for Pairing services -- Initializes the service object and returns the object with the IInFlightCallback.voidrejectPairing()Reject pairing.This is used for embedded GUI.voidreset()Reset.voidsetPairingGuiDisplayListener(Pairing.PairingGuiDisplayListener listener)Sets callback to be invoked when need to show some GUI to user.This is used for embedded GUI.voidsetPairingMethod(JSONObject pairingMethods)Sets the pairing method configuration.voidsetReturnMediaUris(boolean returnMediaUris)Specifies whether the response should include media URIs instead of just media IDs.voidsetSeatPairingErrorListener(Pairing.SeatPairingErrorListener listener)Sets callback to be invoked notifying of an error during pairing or unpairing.voidsetSeatPairingStatusChangedListener(Pairing.SeatPairingStatusChangedListener listener)Sets callback to be invoked notifying of a change in the pairing status.voidsetSeatPropertyReceivedListener(Pairing.SeatPropertyReceivedListener listener)Register a listener used to notify when user preferences data is sent by the PEDvoidunpair()Stops the pairing between the seatback monitor and personal electronic device.
-
-
-
Method Detail
-
initService
public static void initService(Context context, IInFlightCallback inFlightCallback, InFlight inFlight)This API is the starting point for Pairing services -- Initializes the service object and returns the object with the IInFlightCallback.- Parameters:
context- Provides access to resources and classes to initialize the object.inFlightCallback-IInFlightCallbackReturns the instance or error message.inFlight- Initializes an InFlight instance.
-
setReturnMediaUris
public void setReturnMediaUris(boolean returnMediaUris)
Specifies whether the response should include media URIs instead of just media IDs. Note: This feature requires seat-service version 3.34.xx.x or higher.- Parameters:
returnMediaUris-trueto include media URIs in the response;falseto include only media IDs (mids).
-
getPairStatus
public Pairing.PairStatus getPairStatus()
Gets the status of the pairing.
Values are paired, not paired and status unknown.
- Returns:
Pairing.PairStatusStatus of the pairing, such as paired, not paired or status unknown.
-
setPairingMethod
public void setPairingMethod(JSONObject pairingMethods)
Sets the pairing method configuration.- Parameters:
pairingMethods- A JSONObject containing the pairing methods configuration. The pairing methods can include "show_qr_code" and "show_passcode". Set these values to 'true' to enable or 'false' to disable each method.For example: In case of both QR code & Passcode options together, make both the parameters as True. JSONObject pairingMethods = new JSONObject(); pairingMethods.put("show_qr_code", true); pairingMethods.put("show_passcode", true);
-
initiatePairing
public void initiatePairing()
Initiates pairing from the seatback monitor to the personal electronic device.
-
unpair
public void unpair()
Stops the pairing between the seatback monitor and personal electronic device.
-
setSeatPropertyReceivedListener
public void setSeatPropertyReceivedListener(Pairing.SeatPropertyReceivedListener listener)
Register a listener used to notify when user preferences data is sent by the PED- Parameters:
listener-Pairing.SeatPropertyReceivedListener
-
setSeatPairingStatusChangedListener
public void setSeatPairingStatusChangedListener(Pairing.SeatPairingStatusChangedListener listener)
Sets callback to be invoked notifying of a change in the pairing status.- Parameters:
listener-Pairing.SeatPairingStatusChangedListenerCallback invoked when pairing status changes. ThegetPairStatus()API can be invoked to discover the pairing status.
-
setSeatPairingErrorListener
public void setSeatPairingErrorListener(Pairing.SeatPairingErrorListener listener)
Sets callback to be invoked notifying of an error during pairing or unpairing.- Parameters:
listener-Pairing.SeatPairingErrorListenerCallback invoked when pairing error occurs.
-
getMediaPlayerControl
public MediaPlayerControl getMediaPlayerControl()
Gets an instance of the MediaPlayer controller that allows the seatback monitor to listen to media player messages.- Returns:
MediaPlayerControl
-
getMediaQueue
public MediaQueue getMediaQueue()
Gets the media queue from the seatback monitor.
-
getAppControl
public AppControl getAppControl()
Provides access to theAppControlinstance, which manages app control events from the PED, such as launching or quitting the app on the seatback monitor. This object is also used to notify the PED about app launch and quit actions on the seatback monitor. Use thisAppControlinstance to perform various app control operations.- Returns:
- the
AppControlinstance
-
setPairingGuiDisplayListener
public void setPairingGuiDisplayListener(Pairing.PairingGuiDisplayListener listener)
Sets callback to be invoked when need to show some GUI to user.This is used for embedded GUI.- Parameters:
listener-Pairing.PairingGuiDisplayListenerCallback invoked when need to show some GUI
-
confirmPairing
public void confirmPairing()
Confirm pairing. This is used for embedded GUI.
-
rejectPairing
public void rejectPairing()
Reject pairing.This is used for embedded GUI.
-
cancelPasscode
public void cancelPasscode()
Cancel passcode. This is used for embedded GUI.
-
reset
public void reset()
Reset. This is used for embedded GUI.
-
-