On Fri, Feb 19, 2010 at 1:06 PM, Karthik Kannappan <
[email protected]> wrote:

> Look at AVRCP.kl in development/emulator/keymap:
> key 164   MEDIA_PLAY_PAUSE    WAKE
> key 128   MEDIA_STOP          WAKE
> key 163   MEDIA_NEXT          WAKE
> key 165   MEDIA_PREVIOUS      WAKE
> key 168   MEDIA_REWIND        WAKE
> key 159   MEDIA_FAST_FORWARD  WAKE
>
> Ok guys, I think I didn't put my question in right way, let me try again.

I have all these details and its working as below.

case 1; With KEYCODE_CALL, I can answer incoming call by pressing my headset
button.
case 2: With KEYCODE_ENDCALL , i can end the call by pressing my headset
button.

But as I have headset with one button, I can report only one keycode at a
time , either KEYCODE_CALL or KEYCODE_ENDCALL
and not both.

My goal is that no matter whats the phone status, in-call or not, when I
press button, it would take proper action, take a call or end call if
already in-call.

If you have two button on headset, you can give CALL or ENDCALL for each
button and it would be fix and dedicated.
i.e press button1 to receive call, press button2 to end call
But with only one button, how you do this ? Is that needed to add this
toggle logic in android framework ?
is this logic already implemented in Android framework ?

Again, my goal is
Headset with one button, is that anything headset driver can do to implement
above logic or its should only taken care in framework ?







>
>
> On Fri, Feb 19, 2010 at 11:07 AM, Chris Stratton <[email protected]>wrote:
>
>> On Feb 18, 2:39 pm, Porting beginner <[email protected]>
>> wrote:
>> > Hi,
>> >
>> > I am trying from few days but don't get any information related to issue
>> as
>> > below.
>> >
>> > Which  KEYCODE to send to input dev ( /dev/input/event2 here ) on
>> headset
>> > button press event from my
>> > headset driver so can answer / hang-up call ?
>>
>> Please see arch/arm/mach-msm/htc_headset.c which says in part:
>>
>>    Button presses are interpreted as input event (KEY_MEDIA). Button
>> presses
>>    are ignored if the headset is plugged in, so the buttons on 11 pin
>> -> 3.5mm
>>    jack adapters do not work until a headset is plugged into the
>> adapter. This
>>    is to avoid serial RX traffic causing spurious button press
>> events.
>>
>> Also I don't think you want to inject  it into the event file
>> yourself:
>>
>> static void button_pressed(void)
>> {
>>        printk(KERN_INFO "[H2W] button_pressed\n");
>>        atomic_set(&hi->btn_state, 1);
>>        input_report_key(hi->input, KEY_MEDIA, 1);
>>        input_sync(hi->input);
>> }
>>
>> You will also want to read Documentation/input/input-programming.txt
>>
>> Finally you might want to learn about the -R flag to grep ;-)
>>
>> --
>> unsubscribe: 
>> [email protected]<android-kernel%[email protected]>
>> website: http://groups.google.com/group/android-kernel
>
>
>  --
> unsubscribe: 
> [email protected]<android-kernel%[email protected]>
> website: http://groups.google.com/group/android-kernel
>



-- 
Thanks

-- 
unsubscribe: [email protected]
website: http://groups.google.com/group/android-kernel

Reply via email to