Page Summary
-
The HeadphoneFence class is used to create fences based on headphone state.
-
Fences indicating a changing state are momentarily TRUE for about 5 seconds before reverting to FALSE.
-
The
duringmethod creates a fence that is TRUE when headphones are in a specified state (plugged in or unplugged). -
The
pluggingInmethod creates a fence that is momentarily TRUE when headphones are plugged in. -
The
unpluggingmethod creates a fence that is momentarily TRUE when headphones are unplugged.
Use this class to create headphone state fences.
Note: Values that indicate a changing state are momentarily TRUE
for about 5 seconds, then automatically revert to FALSE
.
Please be sure to follow the guidelines in the Awareness API Guide .
Public Method Summary
| static AwarenessFence | |
| static AwarenessFence | pluggingIn
()
This fence is momentarily (about 5 seconds) in the
TRUE
state when headphones are plugged in to the device. |
| static AwarenessFence | unplugging
()
This fence is momentarily (about 5 seconds) in the
TRUE
state when headphones are unplugged from the device. |
Inherited Method Summary
Public Methods
public static AwarenessFence during (int headphoneState)
This fence is in the TRUE
state when the headphones are in the specified state.
Parameters
Returns
public static AwarenessFence pluggingIn ()
This fence is momentarily (about 5 seconds) in the TRUE
state when headphones are plugged in to the device.
Returns
public static AwarenessFence unplugging ()
This fence is momentarily (about 5 seconds) in the TRUE
state when headphones are unplugged from the device.

