The flag of long press is always ON during pressing key

82 views
Skip to first unread message

Mogimo

unread,
Mar 2, 2011, 2:41:49 AM3/2/11
to android-platform
On Gingerbread (e.x. Nexus S), FLAG_LONG_PRESS of KeyEvnet is always
ON when the key is pressing down. Previously, (i.e. Froyo or earlier)
the flag is ON only when mRepeatCount is 1. Therefore, onLongPress is
called-back repeatedly during pressing key-down.

Is this a bug? or is the behavior changed?

Jeffrey Brown

unread,
Mar 2, 2011, 8:48:55 PM3/2/11
to android-...@googlegroups.com, Mogimo
Ah.  This is a bug.  I think it also explains another bug I saw awhile back.
I'll fix it in AOSP.  However, you may need to modify your application to work around the issue.

Sorry,
Jeff.


--
You received this message because you are subscribed to the Google Groups "android-platform" group.
To post to this group, send email to android-...@googlegroups.com.
To unsubscribe from this group, send email to android-platfo...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/android-platform?hl=en.


Mogimo

unread,
Mar 2, 2011, 10:04:17 PM3/2/11
to android-platform
Thank you for your reply.

I'm a device implementer. Can we ship a gingerbread device with fixed
this bug?
I guess the patch like a below;

InputDispatcher::KeyEntry* InputDispatcher::synthesizeKeyRepeatLocked(
...
if (entry->repeatCount == 1) {
entry->flags |= AKEY_EVENT_FLAG_LONG_PRESS;
+ } else {
+ entry->flags &= ~AKEY_EVENT_FLAG_LONG_PRESS;
}
...

I'm also concerned about another bug ...

Dianne Hackborn

unread,
Mar 2, 2011, 10:32:04 PM3/2/11
to android-...@googlegroups.com, Mogimo
We would prefer you don't make such changes.  Android is not a specification, it is an implementation.  A particular version of Android should be feature *and* bug compatible across devices.
--
Dianne Hackborn
Android framework engineer
hac...@android.com

Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails.  All such questions should be posted on public forums, where I and others can see and answer them.

Mogimo

unread,
Mar 2, 2011, 11:01:29 PM3/2/11
to android-platform
OK, Dianne. I understood your suggestion. I'll wait for a new version
of gingerbread.
Do you have any plan to release version 2.3.4 shortly?
> hack...@android.com

Dianne Hackborn

unread,
Mar 2, 2011, 11:36:19 PM3/2/11
to android-...@googlegroups.com, Mogimo
This won't be fixed in Gingerbread -- since Gingerbread is already shipped, this is the behavior it has.  A fix will appear in a later version.
hac...@android.com

Mogimo

unread,
Mar 3, 2011, 1:44:40 AM3/3/11
to android-platform
Thanks a lot!
Reply all
Reply to author
Forward
0 new messages