HeadphoneFence

public final classHeadphoneFenceextendsObject

Use this class to create headphone state fences.

Note: Values that indicate a changing state are momentarilyTRUE for about 5 seconds, then automatically revert toFALSE.

Please be sure to follow the guidelines in theAwareness API Guide.

Public Method Summary

staticAwarenessFence
during(int headphoneState)
This fence is in the TRUEstate when the headphones are in the specified state.
staticAwarenessFence
pluggingIn()
This fence is momentarily (about 5 seconds) in the TRUEstate when headphones are plugged in to the device.
staticAwarenessFence
unplugging()
This fence is momentarily (about 5 seconds) in the TRUEstate when headphones are unplugged from the device.

Inherited Method Summary

Public Methods

public staticAwarenessFence during(int headphoneState)

This fence is in theTRUE state when the headphones are in the specified state.

Parameters
headphoneState Valid values are PLUGGED_INor UNPLUGGED
Returns

public staticAwarenessFence pluggingIn()

This fence is momentarily (about 5 seconds) in theTRUE state when headphones are plugged in to the device.

Returns

public staticAwarenessFence unplugging()

This fence is momentarily (about 5 seconds) in theTRUE state when headphones are unplugged from the device.

Returns