Last Comment Bug 750511 - Samsung Galaxy Note's stylus will dismiss keyboard in Awesome-Screen when pen is near screen
: Samsung Galaxy Note's stylus will dismiss keyboard in Awesome-Screen when pen...
Status: VERIFIED FIXED
:
Product: Firefox for Android
Classification: Client Software
Component: Keyboards and IME (show other bugs)
: Trunk
: ARM Android
: -- normal (vote)
: Firefox 15
Assigned To: Wesley Johnston (:wesj)
:
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-04-30 14:54 PDT by Aaron Train [:aaronmt]
Modified: 2012-05-30 18:47 PDT (History)
8 users (show)
ryanvm: in‑testsuite-
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---
verified
verified
+


Attachments
Patch (5.26 KB, patch)
2012-05-24 16:59 PDT, Wesley Johnston (:wesj)
mark.finkle: review+
joe: approval‑mozilla‑aurora+
Details | Diff | Review

Description Aaron Train [:aaronmt] 2012-04-30 14:54:00 PDT
Currently when the Galaxy Note's pen's tip is close enough to the screen, the virtual keyboard will dismiss thus making it inconvenient to use the stylus as a navigation tool in order to browse the web.

The stylus works fine on the stock browser.

Irina, how popular is the Galaxy Note?


--
Nightly (04/30)
Samsung Galaxy Note (Android 2.3)
Comment 1 Chris Peterson [:cpeterson] 2012-04-30 14:59:00 PDT
aaronmt, does the stylus dismiss the VKB when entering text into a page's text form? Or does this bug only affect the Awesome Bar?
Comment 2 Aaron Train [:aaronmt] 2012-04-30 15:19:58 PDT
Tried out a couple of forms, and sign-ins -- looks like this only affects our Awesome Bar
Comment 3 Aaron Train [:aaronmt] 2012-05-17 12:34:28 PDT
Note users who download Firefox Beta tomorrow might run into this. Should this be a release note somewhere visible on the Google Play store or in the list of known issues?
Comment 4 Jaclyn Fu 2012-05-17 12:37:19 PDT
I'll be updating the What's New Tab tmrw to include multi locale support. The Galaxy Note is the top 3rd most popular device (7k users), so I'll add a note for this known issue as well
Comment 5 Irina Sandu 2012-05-17 12:50:38 PDT
(In reply to Aaron Train [:aaronmt] from comment #0)
> Currently when the Galaxy Note's pen's tip is close enough to the screen,
> the virtual keyboard will dismiss thus making it inconvenient to use the
> stylus as a navigation tool in order to browse the web.
> 
> The stylus works fine on the stock browser.
> 
> Irina, how popular is the Galaxy Note?
> 


It is rather popular. As Jaclyn says, not only is the Galaxy Note one of the top devices for current users, but it is a model that is selling pretty well, so it should be a P1.
Comment 6 Jaclyn Fu 2012-05-17 12:51:29 PDT
akebyl - will you be adding this in the Release Notes known issue?
Comment 7 Alex Keybl [:akeybl] 2012-05-18 09:41:42 PDT
(In reply to Jaclyn Fu from comment #6)
> akebyl - will you be adding this in the Release Notes known issue?

I've release noted it.
Comment 8 Mark Finkle (:mfinkle) (use needinfo?) 2012-05-18 12:08:52 PDT
Wes - Let's get you a Note. This might be in the gesture handling code (just a guess)
Comment 9 Kevin Brosnan [:kbrosnan] 2012-05-18 16:27:53 PDT
Sending a Note via the MV <-> SF delivery service IT device #08109. Should be up there on Wednesday.
Comment 10 Aaron Train [:aaronmt] 2012-05-24 10:19:06 PDT
Wes is now a happy Note user.
Comment 11 Wesley Johnston (:wesj) 2012-05-24 10:42:00 PDT
So we hide the keyboard on MotionEvents here:

http://mxr.mozilla.org/mozilla-central/source/mobile/android/base/AwesomeBarTabs.java#741

Since the note isn't running ICS, we can't use Android's built in stuff for MotionEvent.getToolType(). The SPen SDK also doesn't seem to give much helpful stuff beyond a canvas class you can draw on:

http://innovator.samsungmobile.com/cms/cnts/knowledge.detail.view.do?platformId=1&cntsId=10210

So, I think I'm going to look at the size of the touch on screen and if there's only one and its small enough, we'll leave the keyboard on screen? Sound good? Better ideas?
Comment 12 Chris Peterson [:cpeterson] 2012-05-24 10:55:43 PDT
wesj, what kind of MotionEvent do we actually receive when the stylus has not even touched the screen yet? Do MotionEvent.getDeviceId() or getPressure() return any interesting differences between the Note's stylus and your finger?
Comment 13 Wesley Johnston (:wesj) 2012-05-24 12:03:08 PDT
Dang it. I was wrong. When the pen is near the screen, but not on it, we actually hit this FocusChange listener:

http://mxr.mozilla.org/mozilla-central/source/mobile/android/base/AwesomeBar.java#205
Comment 14 Wesley Johnston (:wesj) 2012-05-24 16:59:29 PDT
Created attachment 627031 [details] [diff] [review]
Patch

So this switches us to use one single massive onInterceptTouchEvent handler for the AwesomeBarTabs view (aka everything but the search box). If you tap anywhere on that with anything, we hide the keyboard (We have to use onInterceptTouchEvent instead of onTouchEvent because (I think) listviews and tabhost already have touch handlers listening motion events which prevent onTouchEvent from firing on the AwesomeBarTabs view).

Removing the focus change listener fixes the stylus-near-the-page problem (but it will still go away if the stylus touches the screen). What do you think?
Comment 15 Chris Peterson [:cpeterson] 2012-05-24 18:03:48 PDT
Comment on attachment 627031 [details] [diff] [review]
Patch

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

::: mobile/android/base/AwesomeBarTabs.java
@@ +1005,5 @@
> +
> +    @Override
> +    public boolean onInterceptTouchEvent(MotionEvent ev) {
> +        InputMethodManager imm = (InputMethodManager)(getContext().getSystemService(Context.INPUT_METHOD_SERVICE));
> +        imm.hideSoftInputFromWindow(getWindowToken(), 0);

You can just call AwesomeBarTabs.hideSoftInput(), a helper function that already consolidates this hideSoftInputFromWindow() boilerplate.
Comment 16 Mark Finkle (:mfinkle) (use needinfo?) 2012-05-24 21:33:46 PDT
Comment on attachment 627031 [details] [diff] [review]
Patch

Sounds like this will address the primary issue - non-touches causing the keyboard to close. As long as we don't regress current touch-behavior, I am OK with this change.

Don't forget Chris' suggestion.
Comment 18 Wesley Johnston (:wesj) 2012-05-25 14:06:24 PDT
Comment on attachment 627031 [details] [diff] [review]
Patch

[Approval Request Comment]
Bug caused by (feature/regressing bug #): The release of the Galaxy Note
User impact if declined: Note users may be (more?) frustrated
Testing completed (on m-c, etc.): Landed on MC 5/25
Risk to taking this patch (and alternatives if risky): Low risk. Should have the same behavior as the old code, without the bug.
String or UUID changes made by this patch:
Comment 19 Ryan VanderMeulen [:RyanVM] 2012-05-26 05:25:02 PDT
https://hg.mozilla.org/mozilla-central/rev/54d0d95a2b5f
Comment 20 Joe Drew (not getting mail) 2012-05-28 11:35:38 PDT
Comment on attachment 627031 [details] [diff] [review]
Patch

Please land ASAP for the Fennec beta build.
Comment 21 Aaron Train [:aaronmt] 2012-05-28 11:36:15 PDT
Verified Fixed

Nightly (05/27), Galaxy Note (2.3.4)
Comment 22 Wesley Johnston (:wesj) 2012-05-29 09:51:27 PDT
https://hg.mozilla.org/releases/mozilla-aurora/rev/192b18bb4d24
Comment 23 Kevin Brosnan [:kbrosnan] 2012-05-30 18:47:17 PDT
Verified in Aurora 2012-05-30

Note You need to log in before you can comment on or make changes to this bug.