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
leisuresuit
Posts: 4
Registered: ‎07-16-2008
My Device: Not Specified

ApplicationPermissionsManager.invokePermissionsRequest

In our MIDlet, I call ApplicationPermissionsManager.invokePermissionsRequest to display the Permission dialog to let the user accept the request edapplication permissions.

When the permission dialog is displayed, and the user presses the END (Hangup) button. The ribbon screen is displayed. If the user attempts to launch the MIDlet again, nothing happens. It looks like it's because the But it looks like ApplicationPermissionsManager.invokePermissionsRequest still hasn't returned.


Is it possible to programmatically dismiss or foreground the permission dialog?

Thanks,

Larry

Developer
richard_puckett
Posts: 191
Registered: ‎04-03-2008
My Device: Bold 9700

Re: ApplicationPermissionsManager.invokePermissionsRequest

This could surely stand to be cleaned up, but here's what I got:

 

First, kick off a thread to run your invokePermissionsRequest request.  This will keep it from blocking your app.

Second, put the following in your UiApplication's "activate" method:

 

 

ApplicationDescriptor[] ad = appMgr.getVisibleApplications(); for (int i = 0; i < ad.length; i++) { if (ad[i].getModuleName().equals("net_rim_bb_application_permissions_proxy")) { try { appMgr.runApplication(ad[i]); } catch (ApplicationManagerException ignore) { } } }

 

I'm not sure why the application doesn't come back to life when you click it again, but the above code will at least cause the Permissions Manager to put itself back up when you try to relaunch the app.   I don't know of a way to dismiss the Permissions Manager (short of possibly using key injection, but my goal is to go through life never having used that method).  It seems to be a fully fledged process and killing processes is something I've never figured out.

 

 

BlackBerry Development Advisor
shaque
Posts: 237
Registered: ‎07-14-2008
My Device: Not Specified

Re: ApplicationPermissionsManager.invokePermissionsRequest

Which Handheld software are you using? This can be found from Options>About.
New Developer
leisuresuit
Posts: 4
Registered: ‎07-16-2008
My Device: Not Specified

Re: ApplicationPermissionsManager.invokePermissionsRequest

It's a Sprint 8130 v4.3.0.71 (Platform 3.1.0.37), but I can dupe this in other BBs as well. 

New Developer
leisuresuit
Posts: 4
Registered: ‎07-16-2008
My Device: Not Specified

Re: ApplicationPermissionsManager.invokePermissionsRequest

I tried the fix you suggested, but still no luck. :-(

 

This is a MIDlet, so UiApplication.activate() doesn't apply. I added your code in the equivalent method MIDlet.startApp(). But when I try to launch the app after pressing Hangup in the Permissions dialog, the startApp() method doesn't get called at all. I don't understand why it would still block, since I'm now calling invokePermissionsRequest() in a thread.

BlackBerry Development Advisor
MSohm
Posts: 14,753
Registered: ‎07-09-2008
My Device: BlackBerry Passport

Re: ApplicationPermissionsManager.invokePermissionsRequest

I have been able to reproduce this issue and will direct it to our development team.  The problem is that MIDlet is waiting for control to return to it from the screen that allows the user to select the permissions.  Once the user dismisses that screen control returns to the MIDlet.

 

The problem is that the permissions screen is not shown when the user clicks on the MIDlet icon (after pressing the End key).  As a work around they can use the Alt+Escape shortcut to task switch into the permissions screen.  Once that is closed they should see the MIDlet again.

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker