google / paco

The Paco behavioral science mobile research platform
http://www.pacoapp.com/
Apache License 2.0
327 stars 93 forks source link

Add runtimepermission trigger #1460

Closed BramBonne closed 8 years ago

BramBonne commented 8 years ago

This pull request implements functionality to support triggering on runtime permission changes in Android Marshmallow (6.0) and up. It captures these events both when a runtime permission request dialog pops up (i.e. when an app asks for a permission at runtime) and when the user changes a permission for an app in the settings (by either going to an app's permissions settings activity, or by going to the activity listing all apps that request a specific permission).

It is implemented as an accessibility service listening only for events from Android's package installer, and the necessary controls for a user to enable this service are added to Paco. For a rationale of why we had to go with this route, see the comment at the top of RuntimePermissions.java.

I tried to adhere as much to the style and structure of existing Paco code, but please let me know if you'd like to see anything changed or moved to a different package / class.

googlebot commented 8 years ago

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

:memo: Please visit https://cla.developers.google.com/ to sign.

Once you've signed, please reply here (e.g. I signed it!) and we'll verify. Thanks.


googlebot commented 8 years ago

CLAs look good, thanks!

BramBonne commented 8 years ago

I incorporated your feedback in my code. Please let me know if you have any other comments :-)

BobEvans commented 8 years ago

Thanks for the contribution!