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
Developer
Posts: 384
Registered: ‎08-12-2008
My Device: 8700

How to set Trusted permission programatically?

Hi All,

 

RIM 4.5 and beyond will pop a dialog to ask user Trusted or not when a new application is installed.

 

How to programatically set this permission with applicationpermission mananger?

 

Thanks

Developer
Posts: 1,305
Registered: ‎01-21-2009
My Device: Not Specified

Re: How to set Trusted permission programatically?

[ Edited ]
Something like this:

 

int[] needed = {
// Array of ApplicationPermissions.PERMISSION_* values
};
ApplicationPermissions perms = new ApplicationPermissions();
for (int i = 0; i < needed.length; ++i) {
needed.addPermission(needed[i]);
}
boolean ok = ApplicationPermissionsManager.getInstance()
.invokePermissionsRequest(needed);
if (ok) {
// all permission(s) granted
} else {
// at least one permission denied
}

 

 

 

Message Edited by Ted_Hopp on 05-27-2009 10:06 PM



Solved? click "Accept as solution". Helpful? give kudos by clicking on the star.
Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: How to set Trusted permission programatically?

There is a sample provided isn't there?
Developer
Posts: 384
Registered: ‎08-12-2008
My Device: 8700

Re: How to set Trusted permission programatically?

Hi Guys,

 

Thanks for your response.

 

Maybe my question is not clear.

 

what I want to do is set Trusted status for application.

 

as you know, A trusted dialog will pop up after a new application installed beyond 4.5 version OS.

 

I know to set file access permission and connection permission via ApplicationPermissionManager.

 

for example, If I set connection allowed, there will no Connection dialog pops up.

 

however, on OS 4.5 device there is still a dialog says "Would you like to grant myApp Trusted Application Status? "

 

pops up.

 

 

I want to dismiss this dialog if I can set some parameter via ApplicationPermissionManager.

 

Thanks.

 

 

 

 

 

 

 

  

 

 

 

 

 

 

 

 

 

Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: How to set Trusted permission programatically?

I don't think you can do anything about this prompt.  Please review this video for more:

 

http://www.blackberry.com/DevMediaLibrary/view.do?name=SecurityPrompts