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

Easily reproducible crash accessing Context constants #235

Closed
jtoledo1974 opened this issue May 13, 2014 · 2 comments
Closed

Easily reproducible crash accessing Context constants #235

jtoledo1974 opened this issue May 13, 2014 · 2 comments

Comments

@jtoledo1974
Copy link
Contributor

The following code crashes the remote shell (as it does on my app, as well)

from jnius import autoclass
PythonActivity = autoclass('org.renpy.android.PythonActivity')
activity = PythonActivity.mActivity
activity.POWER_MANAGER

It should return the string "power", as defined in the the Context class android API

I've checked it crashes as well when accessing WIFI_POWER, for instance. I suspect it's the same for other constants.

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@FeralBytes
Copy link
Contributor

When it crashes, what does adb logcat produce? I think it is probably a permission issue. Or after researching you may have the wrong object POWER_MANAGER should be POWER_SERVICE at least according android.app.Activity Even android.content.Context does not define POWER_MANAGER.
Also WIFI_POWER should be WIFI_SERVICE.

@FeralBytes
Copy link
Contributor

This should be closed.

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

No branches or pull requests

3 participants