ControllerManager

public class ControllerManager

ControllerManager manages the connection to a physical Daydream controller. It talks to the VR Service and creates a Controller object via the getController() method. This class is not thread-safe and should only be accessed on the main thread.

Nested Classes

class ControllerManager.ApiStatus Constants that represent the status of the controller API. 
interface ControllerManager.EventListener Receives VR Service events related to the Daydream controller. 

Public Constructors

Public Methods

Controller
void
start()
Connects to the VR Service and begins listening for a Controller connection.
void
stop()
Tears down the connection to the VR Service.

Inherited Methods

Public Constructors

public ControllerManager (Context context, ControllerManager.EventListener listener)

Parameters
context
listener

Public Methods

public Controller getController ()

Gets a Controller. This can be called at any time, but the controller will only be valid between calls to start() and stop(). Multiple calls will return the same Controller object unless you have called ERROR(/#refreshAllControllers).

Returns

public void start ()

Connects to the VR Service and begins listening for a Controller connection.

Errors related to this connection are sent via ControllerManager.EventListener. If the connection is successful, the Controller acquired via getController() will receive onConnectionStateChanged(int) events.

public void stop ()

Tears down the connection to the VR Service.