Conversation
Method `vibrate(milliseconds)` was deprecated in API level 26, now we should use ` vibrate(android.os.VibrationEffect)`. See also: https://developer.android.com/reference/android/os/Vibrator#vibrate(long)
AndreMiras
left a comment
There was a problem hiding this comment.
LGTM thanks!
Regarding plyer vs pyjnius I haven't dug into it, but if as you said the plyer fix is merged, but not released, then you have you response.
Also I have never played much with the testapp myself, but I see a lot of code smell, just in the context of this diff.
First to me we should be using on device unit testing using for instance Python unittest library.
Second it already has a lot of DRY violation prior your diff that why you ended up having to copy past your fix.
I don't see why it's necessary to test_pyjnius() so often across all the apps. Again I haven't studied the test apps so I may miss something.
So to recap, I think this PR is OK for a merge as it fixes the deprecated behavior you described.
But I think we may want to address this whole testapp thing in the future as it feel a technical debt in our testing tools to me
|
Yeah, I agree with you, we should give a little more love to our testing tools, let's merge this for now, since as you said, fixes the deprecated behavior. Thanks @AndreMiras !! 😆 |
Method
vibrate(milliseconds)was deprecated in API level 26,now we should use
vibrate(android.os.VibrationEffect).I labeled this
WIPbecause I thing that we should consider the possibility to useplyerinstead of using the more low level way ofpyjnius, because we are repeating the code a lot with all the testapps (except for the flask testapp...which uses the same solution but written slightly differently). But the vibration fix forplyerit was merged recently, and we still not have a release with it, so it will force us to put a github requirement in our testapp setup.py files and pin it to a commit or master branch...so...@inclement and @AndreMiras, what do you think about this,
plyerorpyjnius?Note:
testapp_flaskand the standard onetestapp_sqlite_openssland this last one, you could also test it, without building it, via the corresponding job, you can download the testapps built with gh-actions via theArtificatsbutton 😄See also: https://developer.android.com/reference/android/os/Vibrator#vibrate(long)