IHeadset Action Callback
IHeadsetActionCallback
Description :
This interface represent the API for all event related to Headset event(Hardware button). This interface is used with the STWHeadsetManager in order to delegate event linked to Headset event.
Example of use :
- Implementation :
IHeadsetActionCallback mHeadsetActionCallback = new IHeadsetActionCallback() { public boolean shouldHandleActions() { //code ... } public void onHeadsetMediaButtonClicked() { //code ... } public void onHeadsetButtonPressed() { //code ... } public void onHeadsetButtonReleased() { //code ... } public void onHeadsetSosButtonPressed() { //code ... } public void onHeadsetSosButtonReleased() { //code ... } }Content copied to clipboard - Registration:
to register your callback you must call :STWHeadsetManager.getInstance().registerForHeadsetMediaButtonCallback(context, mHeadsetActionCallback);Content copied to clipboardContent copied to clipboard - Unregister:
to unregister your callback you must call :STWHeadsetManager.getInstance().unregisterForHeadsetMediaButtonCallback(context);Content copied to clipboardContent copied to clipboard
Functions
Link copied to clipboard
Callback triggered when click (action down) on media button of headset working with AtX events
Link copied to clipboard
Callback triggered when click (action up) on media button of headset working with AtX events
Link copied to clipboard
Callback triggered when click on media button of standard headset Note that : long click is not detected for standard headset because of event is catched from device to open for example google voice or other recognizing voice application).
Link copied to clipboard
Callback triggered when click (action down) on SOS button of headset working with AtX events
Link copied to clipboard
Callback triggered when click (action up) on SOS button of headset working with AtX events
Link copied to clipboard
Called every time receiving an event to check if we should handle event.