Closed
Bug 908797
Opened 11 years ago
Closed 11 years ago
Update libui to the latest input code from JB MR2
Categories
(Core Graveyard :: Widget: Gonk, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
mozilla26
People
(Reporter: mwu, Assigned: mwu)
References
Details
Attachments
(3 files, 5 obsolete files)
(deleted),
patch
|
Details | Diff | Splinter Review | |
(deleted),
patch
|
Details | Diff | Splinter Review | |
(deleted),
patch
|
Details | Diff | Splinter Review |
The latest input code features api improvements that make bug 890186 easier to implement.
Assignee | ||
Comment 1•11 years ago
|
||
Got this running on JB. Now need to get it working on ICS.
Assignee | ||
Comment 2•11 years ago
|
||
Working on ICS. Now need to test back on JB..
Attachment #794965 -
Attachment is obsolete: true
Assignee | ||
Comment 3•11 years ago
|
||
Works as expected.
Attachment #795662 -
Attachment is obsolete: true
Assignee | ||
Comment 4•11 years ago
|
||
This is for reference during review.
Assignee | ||
Comment 5•11 years ago
|
||
Comment on attachment 795698 [details] [diff] [review]
Our changes to the Android files
Review of attachment 795698 [details] [diff] [review]:
-----------------------------------------------------------------
Most of these changes involve changing what headers are included. A bunch of them fix the code to point to local things. The logging change was a bit more intrusive in order to force the code to load our own logging header. There's also a bunch of #ifdef'ing in the SpriteController code to disable that code - IIRC, it tries to use surfaceflinger to draw the cursor.
::: widget/gonk/libui/InputReader.h
@@ +498,4 @@
> virtual ~InputReaderThread();
>
> private:
> + uint32_t mFoo;
This hack is also present in the current libui. Something was overwriting mReader, and we didn't have time to figure out the exact issue last year. Putting this dummy field in prevented mReader from getting corrupted.
Assignee | ||
Comment 6•11 years ago
|
||
Comment on attachment 795696 [details] [diff] [review]
Update libui, v2
Review of attachment 795696 [details] [diff] [review]:
-----------------------------------------------------------------
Most of this updating libui. There's a few files outside libui which are also updated:
nsAppShell.cpp
moz.build
Makefile.in
A large number of files were removed from libui since they were only necessary for building on Gingerbread.
::: widget/gonk/Makefile.in
@@ +34,4 @@
> LOCAL_INCLUDES += \
> -I$(ANDROID_SOURCE)/hardware/libhardware/include \
> -I$(ANDROID_SOURCE)/hardware/libhardware_legacy/include \
> + -I$(ANDROID_SOURCE)/frameworks/native/opengl/include \
libui now pulls in headers that look for EGL headers, so I added this in.
Assignee | ||
Comment 7•11 years ago
|
||
Comment on attachment 795696 [details] [diff] [review]
Update libui, v2
m1, would be nice to get your feedback on whether the headphone/mic insertion event stuff still works after this patch.
Attachment #795696 -
Flags: feedback?(mvines)
Assignee | ||
Comment 8•11 years ago
|
||
Comment on attachment 795698 [details] [diff] [review]
Our changes to the Android files
Review of attachment 795698 [details] [diff] [review]:
-----------------------------------------------------------------
::: widget/gonk/libui/EventHub.cpp
@@ +49,4 @@
> #include <sys/epoll.h>
> #include <sys/ioctl.h>
> #include <sys/limits.h>
> +#include <sha1.h>
This lets EventHub.cpp find bionic's implementation of sha1.h.
Assignee | ||
Comment 9•11 years ago
|
||
Comment on attachment 795696 [details] [diff] [review]
Update libui, v2
Ben, do you mind reviewing this? The last reviewer I had for this code is not available (cjones), and it seems like you might be familiar with this code.
Attachment #795696 -
Flags: review?(btian)
Comment 10•11 years ago
|
||
Comment on attachment 795696 [details] [diff] [review]
Update libui, v2
Looks like headset detection is broken by this patch. Here's what the event stream looks like on my device:
----
$ adb shell getevent -l /dev/input/event4
<Insert headset>
/dev/input/event4: EV_SW SW_HEADPHONE_INSERT 00000001
/dev/input/event4: EV_SW SW_MICROPHONE_INSERT 00000001
/dev/input/event4: EV_SYN SYN_REPORT 00000000
<Remove headset>
/dev/input/event4: EV_SW SW_HEADPHONE_INSERT 00000000
/dev/input/event4: EV_SW SW_MICROPHONE_INSERT 00000000
/dev/input/event4: EV_SYN SYN_REPORT 00000000
----
Attachment #795696 -
Flags: feedback?(mvines) → feedback-
Assignee | ||
Comment 11•11 years ago
|
||
Thanks. I'll review the headset detection code a bit more closely.
Also, it looks like updating this code will also fix bug 904544 .
Assignee | ||
Comment 12•11 years ago
|
||
Tried fixing the jack detection with this, but it doesn't seem to work and I'm too tired to figure it out tonight.
Comment 13•11 years ago
|
||
Comment on attachment 795696 [details] [diff] [review]
Update libui, v2
Michael, I've traced only part of key event flow and ain't familiar with libui code. Sorry can't help it.
Attachment #795696 -
Flags: review?(btian) → review-
Updated•11 years ago
|
Attachment #795696 -
Flags: review-
Assignee | ||
Comment 14•11 years ago
|
||
Comment on attachment 796373 [details] [diff] [review]
Fix headphone detection logic
I don't see what's wrong with this. Maybe it works better on the devices that require it?
Attachment #796373 -
Attachment description: WIP Fix headphone detection logic → Fix headphone detection logic
Attachment #796373 -
Flags: feedback?(mvines)
Assignee | ||
Comment 15•11 years ago
|
||
Comment on attachment 795696 [details] [diff] [review]
Update libui, v2
m1, would you be interested in reviewing this? We're low on reviewers familiar with the input code. This is mostly updating to the latest input code from Android so it shouldn't be too complicated, though I've made comments on the tricky bits.
I don't intend to check this in until we fix the jack detection, so I think we can treat that part as a follow up within this bug. (generating these patches was a pain..)
Attachment #795696 -
Flags: review?(mvines)
Comment 16•11 years ago
|
||
Comment on attachment 795696 [details] [diff] [review]
Update libui, v2
r+ based more on attachment 795698 [details] [diff] [review] than this.
Attachment #795696 -
Flags: review?(mvines)
Attachment #795696 -
Flags: review+
Attachment #795696 -
Flags: feedback-
Comment 17•11 years ago
|
||
Comment on attachment 796373 [details] [diff] [review]
Fix headphone detection logic
Does this fix N4?
On my device I see SW_HEADPHONE_INSERT at |getevents| but it doesn't make it up to GeckoInputDispatcher::notifySwitch(). SW_MICROPHONE_INSERT makes it all the way up though.
Assignee | ||
Comment 18•11 years ago
|
||
(In reply to Michael Vines [:m1] [:evilmachines] from comment #17)
> Comment on attachment 796373 [details] [diff] [review]
> Fix headphone detection logic
>
> Does this fix N4?
>
> On my device I see SW_HEADPHONE_INSERT at |getevents| but it doesn't make it
> up to GeckoInputDispatcher::notifySwitch(). SW_MICROPHONE_INSERT makes it
> all the way up though.
Doesn't work on N4, so I was wondering if it worked on your device. Guess I'm still missing something then.
Assignee | ||
Comment 19•11 years ago
|
||
This seems to work for me. Just had to treat the thing as a bitmask.
Attachment #796373 -
Attachment is obsolete: true
Attachment #796373 -
Flags: feedback?(mvines)
Attachment #799924 -
Flags: review?(mvines)
Updated•11 years ago
|
Attachment #799924 -
Flags: review?(mvines) → review+
Assignee | ||
Comment 20•11 years ago
|
||
Unbitrotted
Attachment #795696 -
Attachment is obsolete: true
Attachment #799924 -
Attachment is obsolete: true
Assignee | ||
Comment 21•11 years ago
|
||
Comment 22•11 years ago
|
||
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla26
Comment 23•11 years ago
|
||
This caused a regression reported on bug 914776.
There are multiple regressions reported on that bug; the specific one I'm talking about is that in the Gallery app, in landscape mode, the 'camera' button (which should allow switching back to the camera mode to take new pictures) does nothing.
Comment 24•11 years ago
|
||
It looks like the mXScale and mYScale is not correct in landscape mode, it will cause the touch event mapping incorrect.
I think problem comes from the mSurfaceWidth and mSurfaceHeight.
// The surface orientation, width and height set by configureSurface().
// The width and height are derived from the viewport but are specified
// in the natural orientation.
int32_t mSurfaceWidth;
int32_t mSurfaceHeight;
Take N4 for example, it should be 768(width)*1280(height) no matter it's landscape or portrait.
But we have 768*1280 in portrait and 1280*768 in landscape mode now.
Since we always setDisplayInfo with gScreenBounds.width and gScreenBounds.height in nsAppShell, I'm thinking we should used it directly as the mSurfacewidth and mSurfaceHeight in TouchInputMapper::configureSurface without considering the orientation.
Please feel free let me know if you want me to provide the patch. Thank you.
Flags: needinfo?(mwu)
Assignee | ||
Comment 25•11 years ago
|
||
Thanks for debugging!
Do you mind providing a patch? We don't have enough people working on this code, which is a problem when I need to get a review in this code.
Flags: needinfo?(mwu)
Comment 26•11 years ago
|
||
Hi Michael,
I'm not so sure if it's the best way to fix this since we do rotation calculating in different functions.
Thank you for any of your suggestion or feedback!
Attachment #805216 -
Flags: review?(mwu)
Assignee | ||
Comment 27•11 years ago
|
||
Can't you remove all rotation handling in GeckoPointerController::getBounds ? We shouldn't touch libui unless we need to.
Assignee | ||
Comment 28•11 years ago
|
||
Also, this follow up should be in a new bug.
Assignee | ||
Updated•11 years ago
|
Attachment #805216 -
Flags: review?(mwu)
Updated•6 years ago
|
Product: Core → Core Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•