Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

New Developer
Posts: 9
Registered: ‎04-24-2009
My Device: Not Specified

Application Permissions Issue

In my application I am setting Application Permissions programatically. 


My sequence is:

1) Check any Permission is not in NOT Allow  state.

2) If so invoke the permission list.

3) Then user have to save them

4) After that I am again checking any permission is in "Deny" state. (To make sure permission have properly set).


This set of code part working fine in my BB. However my client requested complaint it is not working properly. Also he says it is requesting for reboot. I am in a big difficult of reproducing the scenario. Do you guys have any idea.


Code is attached here.




public class ApplicationPermissionSettings { private ApplicationPermissions customApplicationPermission; private boolean needPermission = false; public ApplicationPermissionSettings() { customApplicationPermission = new ApplicationPermissions(); } /** * Check whether Application Permissions are "ALLOW" */ private void checkApplicationPermissionIsAllowed() { int[] keys = ApplicationPermissionsManager.getInstance() .getApplicationPermissions().getPermissionKeys(); for (int x = 0; x <= keys.length - 1; x++) { if (ApplicationPermissionsManager.getInstance() .getApplicationPermissions().getPermission(keys[x]) != ApplicationPermissions.VALUE_ALLOW) { needPermission = true; customApplicationPermission.addPermission(keys[x]); } } } /** * Check weather Application Permissions are "Deny" */ public boolean checkApplicationPermissionIsDeny() { boolean isPermissionDeny = false; int[] keys = ApplicationPermissionsManager.getInstance() .getApplicationPermissions().getPermissionKeys(); for (int x = 0; x <= keys.length - 1; x++) { if (ApplicationPermissionsManager.getInstance() .getApplicationPermissions().getPermission(keys[x]) == ApplicationPermissions.VALUE_DENY) { isPermissionDeny = true; } } return isPermissionDeny; } /** * Prompt the message, if Application Permissions are not "AllOWED" */ public void promptApplicationPermission() { checkApplicationPermissionIsAllowed(); if (needPermission) { ApplicationPermissionsManager .getInstance().invokePermissionsRequest( customApplicationPermission); } else { } } }



BlackBerry Development Advisor
Posts: 15,874
Registered: ‎07-09-2008
My Device: BlackBerry PRIV
My Carrier: Bell

Re: Application Permissions Issue

[ Edited ]
What BlackBerry Smartphone model and BlackBerry handheld software version are you testing on?  You can find this under Options, About on the BlackBerry Smartphone.  What were his permission settings before and after your application requested the change?
Message Edited by MSohm on 05-07-2009 02:31 PM
Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Posts: 105
Registered: ‎05-22-2008
My Device: Not Specified

Re: Application Permissions Issue

I too am running into various isses with Permissions / invoke


The same code behaves differently on 4.2 / 4.6 / 4.7 and 5.x devices.


There have been TOO MANY issues with this for me to try and list every combination.


Fortunately, when the App is pused, setting perms via BES software configs seem to be OK (so far).


RIM :- PLEASE sort this out !!