Welcome!

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

Reply
New Developer
Posts: 86
Registered: ‎05-13-2009
My Device: Not Specified

Problem with application permissions setting for recording ?

 Hi All,

    I use the code below for setting recording permission for my application as i have a click a photo feature in my application using jsr 135

 

checkPermissions();

    /**
     * A method that will be called for checking as well as setting the required application permissions
     */
    private void checkPermissions() {
   
       
        ApplicationPermissionsManager apm = ApplicationPermissionsManager.getInstance();
        ApplicationPermissions original = apm.getApplicationPermissions();
        if(original.getPermission(ApplicationPermissions.PERMISSION_RECORDING) == ApplicationPermissions.VALUE_ALLOW) {
            return;
        }
        ApplicationPermissions permRequest = new ApplicationPermissions();
        permRequest.addPermission(ApplicationPermissions.PERMISSION_RECORDING);
        boolean acceptance = ApplicationPermissionsManager.getInstance().invokePermissionsRequest(permRequest);
        if(acceptance) {
           
            // User has accepted all of the permissions.
            return;
        }
    } 

 

It works fine and i get the requested permission set when i check it in application permissions but when under options -> Advanced Options ->Application -> Edit Default Permissions i changed the recording permission to deny it doesnt work i my view it should coz when i go to 

options -> Advanced Options  ->Application ->Edit Permissions which are my application permissions it has recording set to allow Does any who know whats going wrong here plz help me. I am testing this on bb 8900 OS 4.6.1.250

 

Thanks a lot,

Sagar

Developer
Posts: 1,474
Registered: ‎04-14-2009
My Device: Not Specified

Re: Problem with application permissions setting for recording ?

If you change Default Permissions, the change does not apply to modules that are already on the handheld. You can apply Default Permissions to all modules manually -- there's a menu item for that.

 

P.S. When you request permissions using ApplicationPermissionsManager, you need to list all permission that are needed for your module's operation. Permissions not listed in the invokePermissionsRequest are reset to defaults (those in Default Permissions) after the user accepts the permissions prompt.

New Developer
Posts: 86
Registered: ‎05-13-2009
My Device: Not Specified

Re: Problem with application permissions setting for recording ?

Hi klyubin,

thanks for the reply but when i install my application which has the permissions code for recording i see a dialog that application want scertain permission i click on view and then save from menu this causes the application permission for recording to be set to allow but in Edit default permission i have already set the permission for recording to deny so what is happening is i am unable to get the snapshot.But if i change the permission for recording under Edit default permission i can take the snap shot.Can u plz help me where i am going wrong.

 

Thanks,

Sagar

New Developer
Posts: 86
Registered: ‎05-13-2009
My Device: Not Specified

Re: Problem with application permissions setting for recording ?

Hi All,

 

   I think i got the problem reason well understood now but still dont know how to fix.Actually what has happened is

 

1)I have an application (and in this applications dependencies -> the option in jde i have added a library i.e. all the ui code)  so actually when i create an alx of my application it has the cod name of the library and also when  i go to options -> Advanced Options -> Applications i can see 2 applications my application and the library as an application.

 

2)So when i set permissions to my application they are actually set to my application only and not the library on which my application depends on. So how do i fix this or How do i add a library to my application.

 

Help me in this regards,

 

Thanks,

Sagar

 

 

New Contributor
Posts: 7
Registered: ‎01-22-2010
My Device: 8330/8900
My Carrier: AT&T

Re: Problem with application permissions setting for recording ?

HI,

 

I'm having the same problem as described above. It seems that the only way you can get an ApplicationPermissionsManager to deal with permissions is by using the static getInstance() method to return the current application's manager. The library's permissions can never be prompted for modification with the calling application.

 

Would it be necessary then to create a libMain method within the library to run at startup which would prompt the user to change permissions from there? I'm hoping there is a cleaner way....

 

Thanks,

Keith