Ticket Hash: | 25f9e9d002b31cf8fef3db6646143bd08a867b10 | ||
Title: | Detect headset state and microphone button events | ||
Status: | Review | Type: | Feature_Request |
Severity: | Minor | Priority: | Medium |
Subsystem: | Resolution: | Open | |
Last Modified: |
2019-10-16 20:05:13 5.73 years ago |
Created: |
2019-10-15 21:50:06 5.73 years ago |
Version Found In: | all |
User Comments: | ||||
anonymous added on 2019-10-15 21:50:06:
How can one detect the state of a headset and its buttons'?
How could one check the state of HEADSET_PLUG and MEDIA_BUTTON programmatically? The state of HEADSET_PLUG is reported upon registering the callback, but is there a way to poll it? Thanks much. dzach anonymous added on 2019-10-15 21:56:24:
Actually, to be usefull, a virtual event should report both the ON and OFF state of the buttons, so that the duration of the press could be determined for various actions to be called, as specified in (2) above, e.g.: anonymous added on 2019-10-15 22:24:21:
I read here that there might be a need to include something like the following in AndroidManifest.xml:
chw added on 2019-10-16 05:06:29: Regarding the HEADSET_PLUG event you might use the event command to make it into a virtual event in the handler procedure of that broadcast receiver. However, for the MEDIA_BUTTON, don't expect me to add a special broadcast receiver tag in AndroidManifest.xml for a plain AndroWish. This clearly is something which has to be done for a separately bundled App e.g. using the AndroWish SDK since it's an intervention in the overall device user experience despite the priority field. anonymous added on 2019-10-16 12:48:50:
I see. anonymous added on 2019-10-16 20:05:13: It seems like just adding a <receiver> tag in the <application> section of the AndroidManifest.xml is not enought to make it work. Tried also to see if any permissions are needed/defined for MEDIA_BUTTON or anything like it, but there doesn't seem to be any. Any suggestions? |