Skip to content
com.iristick.smartglass.core

Class IristickManager


public abstract class IristickManager
extends Object

This class is the main entry point. It manages connections to Iristick headsets, and contains definitions for intents.

This class follows the singleton pattern. You can get an instance through getInstance().

Constructor Summary

Constructor and Description
IristickManager() 

Method Summary

Modifier and Type Method and Description
abstract void bind(IristickConnection connection, Context context, Handler handler)
Binds to the Iristick service.
static IristickManager getInstance()
Gets the single instance of the Iristick Manager.
abstract void unbind(IristickConnection connection)
Unbinds from the Iristick service.

Methods inherited from class java.lang.Object

equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

IristickManager

public IristickManager()

Method Detail

getInstance

@CheckResult
 @NonNull
public static IristickManager getInstance()

Gets the single instance of the Iristick Manager.

Returns:
The IristickManager instance.

bind

public abstract void bind(@NonNull
                          IristickConnection connection,
                          @NonNull
                          Context context,
                          @Nullable
                          Handler handler)

Binds to the Iristick service.

If headsets and/or pocket units are already connected prior to calling this function, the IristickConnection.onHeadsetConnected(Headset) and/or IristickConnection2.onPocketUnitConnected(PocketUnit) methods will be called for each of them.

If a subclass of IristickConnection2 is given, extra callbacks will be enabled. New applications are recommended to always extend the IristickConnection2 abstract class rather than implementing the IristickConnection interface directly.

Parameters:
connection - Receives information as headsets are (dis)connected. This must be a valid IristickConnection or IristickConnection2 object; it must not be null.
context - Context used to bind to the Iristick service. The Iristick service binding will be bound to the lifecycle of this context.
handler - Handler from which to call callbacks. If null, the main thread will be used.

unbind

public abstract void unbind(@NonNull
                            IristickConnection connection)

Unbinds from the Iristick service.

If headsets are still connected when calling this function, the IristickConnection.onHeadsetDisconnected(Headset) method will be called for each of them.

Parameters:
connection - The connection to unbind.