Closed Bug 1107760 Opened 5 years ago Closed 5 years ago

(gonk-l) Can not get the Headset-Button message

Categories

(Firefox OS Graveyard :: General, defect)

All
Gonk (Firefox OS)
defect
Not set

Tracking

(feature-b2g:2.2+)

RESOLVED FIXED
2.2 S3 (9jan)
feature-b2g 2.2+

People

(Reporter: askeing, Assigned: viralwang)

References

Details

Attachments

(1 file, 2 obsolete files)

STR:
1. power on Nexus 5
2. plug in the Headset and run marionette.
3. run the following async script by marionette:
navigator.mozSetMessageHandler( "headset-button", function (message) { marionetteScriptFinished(JSON.stringify(message)); } );
ref: https://developer.mozilla.org/en-US/docs/Web/API/Navigator.mozSetMessageHandler
4. click the Headset button.

Expected:
get the headset button message.

Actual:
no message from headset button.
Hi Viral, Since you are working on sensor parts, I assign this bug to you.
If you think this is a wrong assignment, please let me know.
Assignee: nobody → vwang
E/KeyLayoutMap(  191): /system/usr/keylayout/hs_detect.kl:4: Expected key code label, got 'VOICE_ASSIST'.

Looks like new keycode here for API level 21.
I would like to update keycode.h to fix this bug
No longer blocks: gonk-L-Sensors
Blocks: gonk-L
Since it's a functional failure, mark as feature-b2g:2.2+.
feature-b2g: --- → 2.2+
Target Milestone: --- → 2.2 S3 (9jan)
Actually we can have a quick solution to remove the new keycode for "VOICE_ASSIST" in /system/usr/keylayout/hs_detect.kl

If we would like to sync our libui code to L, the change will cover more than 20 files.
(since we have InputEventLabels.h in L to replace the KeycodeLabels.h)
The benefit is we can have latest code as L but not sure the compatibility for ICS/JB/KK.

Hi Michael,

Any suggestion we can have now?
Thank you.
Flags: needinfo?(mwu)
Status: NEW → ASSIGNED
Adding support for L key codes is the quickest solution, but if you can sync libui to the latest code, that works too (but requires a lot more testing to ensure things work on ICS/JB/KK).
Flags: needinfo?(mwu)
Attached patch add new keycode mapping for L (obsolete) — Splinter Review
Hi Michael,

Thank you for your feedback:)
I prefer the quick solution first since the changing in libui looks really risky to us.
Could you please help to review this patch?
Thanks!
Attachment #8545161 - Flags: review?(mwu)
Attachment #8545161 - Attachment is patch: true
Comment on attachment 8545161 [details] [diff] [review]
add new keycode mapping for L

Review of attachment 8545161 [details] [diff] [review]:
-----------------------------------------------------------------

::: widget/gonk/libui/KeycodeLabels.h
@@ +259,5 @@
> +    { "TV_RADIO_SERVICE", 232 },
> +    { "TV_TELETEXT", 233 },
> +    { "TV_NUMBER_ENTRY", 234 },
> +    { "TV_TERRESTRIAL_ANALOG", 235 },
> +    { "TV_TERRESTRIAL_DIGITAL", 216 },

236. Please double check these numbers.

::: widget/gonk/libui/android_keycodes.h
@@ +301,5 @@
> +    AKEYCODE_TV_ZOOM_MODE    = 255,
> +    AKEYCODE_TV_CONTENTS_MENU = 256,
> +    AKEYCODE_TV_MEDIA_CONTEXT_MENU = 257,
> +    AKEYCODE_TV_TIMER_PROGRAMMING = 258,
> +    AKEYCODE_HELP            = 259

Put a comma at the end of this line.
Attachment #8545161 - Flags: review?(mwu)
Hi Michael,

So sorry for the missing in last patch.
Please help to review the updated patch.
Thank you!
Attachment #8545161 - Attachment is obsolete: true
Attachment #8545667 - Flags: review?(mwu)
Comment on attachment 8545667 [details] [diff] [review]
Bug 1107760 - add new keycode mapping for L (v2)

Review of attachment 8545667 [details] [diff] [review]:
-----------------------------------------------------------------

Looks good.

::: widget/gonk/libui/KeycodeLabels.h
@@ +261,5 @@
> +    { "TV_NUMBER_ENTRY", 234 },
> +    { "TV_TERRESTRIAL_ANALOG", 235 },
> +    { "TV_TERRESTRIAL_DIGITAL", 236 },
> +    { "TV_SATELLITE", 237 },
> +    { "TV_SATELLITE_BS", 238},

nit: no space after 238
Attachment #8545667 - Flags: review?(mwu) → review+
correct the nit and add reviewer in comment
Attachment #8545667 - Attachment is obsolete: true
https://hg.mozilla.org/mozilla-central/rev/6aefb4703601
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.