-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[TextInputLayout] fix crash when focusing TextInputEditText on Meizu devices #358
[TextInputLayout] fix crash when focusing TextInputEditText on Meizu devices #358
Conversation
…facturer is Meizu as their modifications in Textview leads to a crash see https://issuetracker.google.com/issues/112105087
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happens on Meizu devices now that we aren't calling getHint()
on the TextInputLayout
if the hint was only specified on the TextInputLayout?
Can you debug, step through this function, and step into layout.getHint()
and see if that is called correctly?
Maybe the problem is that super.getHint()
isn't called? What happens if we always call super.getHint() for Meizu devices but then return the value from layout.getHint()
thanks for working on this bug!
@cketcham I explained my investigation and my tests in the Google issue here https://issuetracker.google.com/issues/112105087
The layout works correctly, same behaviour as if we had put the hint on the TextInputLayout wich is the same behaviour as on other devices
After further investigation, the crashing Meizu proprietary Editor.updateCursorPositionMz() method (see Google issue link) calls getHint(), but more important, it calls the final method TextView.getHintLayout() which is null as there is no Hint in the TextView.
So there is 2 solutions:
Not working |
Thanks for the info. This definitely looks like a crash because the device is expecting If we can't find anything better, I your current approach could be ok. One other thought I had is to call something like:
in |
Indeed it is a very good balance between solutions 1 and 2. I tested it and it worked perfectly on several devices. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great! That looks good to me, I can merge this internally and we'll push the fix to github soon.
Great! Thank you :) |
@CmoaToto We're considering moving the call to |
1d3dfa0
to
9fde954
Compare
@cketcham You're right, this way the fix will be called only once per View creation on not at each onDraw. |
The next release should happen around the end of May |
Crash still occurs on some Meizu devices, with all the fixes in place. Looking at the fix vs the crash logs, this happens because |
@adriancretu According to several dumps of FlymOS (Meizu) found on Github (https://github.com/search?p=4&q=%22ro.build.display.id%3DFlyme%22&type=Code) you're right, there is like 1 Meizu device on 20 that uses ro.product.manufacturer=meizu instead of ro.product.manufacturer=Meizu. I'll do a PR to fix this. FYI I searched but didn't find other ro.product.manufacturer from Meizu. |
@adriancretu Here is the PR #411 @cketcham Please review it to completely fix this problem :) |
I have this crash on material:1.2.0-alpha02. I'm using AutoCompleteTextView, inside TextInputLayout |
Don't return parent hint from TextInputEditText.getHint() if the manufacturer is Meizu as their modifications in Textview leads to a crash
solve https://issuetracker.google.com/issues/112105087
(closed because duplicated Github issue: #216 )