Reputation: 1197
I'm using an EventInjector to auto hang-up on incoming calls but the first time a call comes in after the app is installed a dialog pops up saying:
"The application Phone is attempting to reset the security timer"
If I select "Do not ask again" and "Allow" all is fine, but how can I set this permission to allow right from the start?
Btw this is not running on BES
Upvotes: 1
Views: 290
Reputation: 75336
You cannot programmatically set this permission (it would defeat the whole purpose of permissions if you could), but you can request this permission from the user when your app first starts with the ApplicationPermissionsManager class. The specific permission you need to request is ApplicationPermissions.PERMISSION_IDLE_TIMER
.
Keep in mind that this may not work - in my experience, there are many scenarios in which the requested permissions are ignored, and you get the in-app popups anyway.
Upvotes: 2