Skip to content

Most visited

Recently visited

navigation

UserDriverManager

UserDriverManager

public class UserDriverManager
extends Object

java.lang.Object
   ↳ com.google.android.things.userdriver.UserDriverManager


Manager for all user drivers. This class is used to register/unregister user-defined drivers for sensors and input devices.

Summary

Public methods

static UserDriverManager getManager()

Get a UserDriverManager object.

void registerAudioInputDriver(AudioInputDriver driver, int encoding, int sampleRate, int channelCount, int deviceType, int bufferSize)

Register an audio input driver with the user driver manager.

void registerAudioInputDriver(AudioInputDriver driver, AudioFormat format, int deviceType, int bufferSize)

Register an audio input driver with the user driver manager.

void registerAudioOutputDriver(AudioOutputDriver driver, AudioFormat format, int deviceType, int bufferSize)

Register an audio output driver with the user driver manager.

void registerAudioOutputDriver(AudioOutputDriver driver, int encoding, int sampleRate, int channelCount, int deviceType, int bufferSize)

Register an audio output driver with the user driver manager.

void registerGpsDriver(GpsDriver driver)

Register a GPS driver with the user driver manager.

void registerInputDriver(InputDriver driver)

Register a input driver with the user driver manager.

void registerSensor(UserSensor sensor)

Register a user sensor with the user driver manager.

void unregisterAudioInputDriver(AudioInputDriver driver)

Unregister an Audio Input driver.

void unregisterAudioOutputDriver(AudioOutputDriver driver)

Unregister an Audio Output driver.

void unregisterGpsDriver()

Unregister the GPS driver.

void unregisterInputDriver(InputDriver driver)

Unregister an input driver.

void unregisterSensor(UserSensor sensor)

Unregister a sensor driver.

Inherited methods

From class java.lang.Object

Public methods

getManager

UserDriverManager getManager ()

Get a UserDriverManager object.

Returns
UserDriverManager An instance of a UserDriverManager. If one doesn't exist, it will be created.

registerAudioInputDriver

void registerAudioInputDriver (AudioInputDriver driver, 
                int encoding, 
                int sampleRate, 
                int channelCount, 
                int deviceType, 
                int bufferSize)

Register an audio input driver with the user driver manager.

Parameters
driver AudioInputDriver: Driver to register.
encoding int
sampleRate int
channelCount int
deviceType int
bufferSize int

registerAudioInputDriver

void registerAudioInputDriver (AudioInputDriver driver, 
                AudioFormat format, 
                int deviceType, 
                int bufferSize)

Register an audio input driver with the user driver manager.

Parameters
driver AudioInputDriver: Driver to register.
format AudioFormat
deviceType int
bufferSize int

registerAudioOutputDriver

void registerAudioOutputDriver (AudioOutputDriver driver, 
                AudioFormat format, 
                int deviceType, 
                int bufferSize)

Register an audio output driver with the user driver manager.

Parameters
driver AudioOutputDriver: Driver to register.
format AudioFormat
deviceType int
bufferSize int

registerAudioOutputDriver

void registerAudioOutputDriver (AudioOutputDriver driver, 
                int encoding, 
                int sampleRate, 
                int channelCount, 
                int deviceType, 
                int bufferSize)

Register an audio output driver with the user driver manager.

Parameters
driver AudioOutputDriver: Driver to register.
encoding int
sampleRate int
channelCount int
deviceType int
bufferSize int

registerGpsDriver

void registerGpsDriver (GpsDriver driver)

Register a GPS driver with the user driver manager. There can only be one GPS sensor per device. If the device has a built-in GPS sensor, this method will fail.

Parameters
driver GpsDriver: Driver to register.

registerInputDriver

void registerInputDriver (InputDriver driver)

Register a input driver with the user driver manager.

Parameters
driver InputDriver: Driver to register.

registerSensor

void registerSensor (UserSensor sensor)

Register a user sensor with the user driver manager.

Parameters
sensor UserSensor: Sensor to register.

unregisterAudioInputDriver

void unregisterAudioInputDriver (AudioInputDriver driver)

Unregister an Audio Input driver. Only user-defined Audio Input drivers can be unregistered.

Parameters
driver AudioInputDriver

unregisterAudioOutputDriver

void unregisterAudioOutputDriver (AudioOutputDriver driver)

Unregister an Audio Output driver. Only user-defined Audio Output drivers can be unregistered.

Parameters
driver AudioOutputDriver

unregisterGpsDriver

void unregisterGpsDriver ()

Unregister the GPS driver. Only user-defined GPS drivers can be unregistered.

unregisterInputDriver

void unregisterInputDriver (InputDriver driver)

Unregister an input driver.

Parameters
driver InputDriver: Driver to register.

unregisterSensor

void unregisterSensor (UserSensor sensor)

Unregister a sensor driver.

Parameters
sensor UserSensor: Sensor to unregister.
This site uses cookies to store your preferences for site-specific language and display options.

Get the latest Android developer news and tips that will help you find success on Google Play.

* Required Fields

Hooray!

Browse this site in ?

You requested a page in , but your language preference for this site is .

Would you like to change your language preference and browse this site in ? If you want to change your language preference later, use the language menu at the bottom of each page.

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.

Take a short survey?
Help us improve the Android developer experience.
(Sep 2017 survey)