Skip to content
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

wakelock == 1 not preventing screen from locking on sdl2 #1061

Closed
brentpicasso opened this issue Jun 2, 2017 · 1 comment · Fixed by #1066
Closed

wakelock == 1 not preventing screen from locking on sdl2 #1061

brentpicasso opened this issue Jun 2, 2017 · 1 comment · Fixed by #1066

Comments

@brentpicasso
Copy link
Contributor

After migrating to Kivy 1.10 / latest p4a I'm seeing the case where android device is not staying awake where it should be.

wakelock == 1 (android.wakelock = True in buildozer.spec) and android permissions include WAKE_LOCK.

our buildozer.spec file has not changed in this area when it was built for 1.9.1, and wakelock was working as expected.

I hacked PythonActivity.java to output some debug information if it chose the branch to set wakelock, and I was able to see it setting the wakelock in action. See screenshots:

image

image

Running latest buildozer / kivy / py4a

Let me know how else I can help debug.

@brentpicasso
Copy link
Contributor Author

One more thing I noticed; the implementation for the pygame bootstrap has the wakelock.acquire() / release() in the onResume() and onPause() methods.
https://github.com/kivy/python-for-android/blob/c36cf0df31a95f974a3ca2717451c0b186b7c90b/pythonforandroid/bootstraps/pygame/build/src/org/renpy/android/SDLSurfaceView.java

In the SDL2 implementation I don't see the equivalent code.

I hacked in a forced acquire as a test:
image

And this seemed to keep my device on.

If I'm on to something I'd be happy to submit a PR. Let me know - thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant