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: 32
Registered: ‎08-26-2008
My Device: Not Specified

Application Permissions, Connector.open(), and the Firewall

I'm trying to verify that the Application Permissions are acceptable for my network requests (internal/external, by domain).

I am testing on the following devices, with equal results:
* AT&T 8700c with OS 4.5.0.110
* Verizon Wireless Storm 9530 with OS 4.7.1.148

All devices are connecting with BIS. The devices are not on a BES, and do not have an IT policy installed. (i used javaloader -usb resettofactory)

I've found that when the firewall is disabled, and the "Carrier Internet" permission is set to Deny, my application will still connect to the server. (HTTP and HTTPS connections)
Is this expected behavior?
When the firewall is enabled, and I click "deny" for the firewall prompt, Connector.open() throws a java.lang.SecurityException. Even if the ApplicationPermissions is set to ALLOW, the connection will not open.

Connector.open() does not seem to be connected to the ApplicationPermissions settings at all.

Has anyone had any luck with this? Is there any way to programatically re-display the firewall prompt? How does your application verify there are no security restrictions preventing your application from connecting to the network?
Developer
Posts: 1,474
Registered: ‎04-14-2009
My Device: Not Specified

Re: Application Permissions, Connector.open(), and the Firewall

[ Edited ]

Carrier Internet permission having no effect is a known issue. You may want to report your test case into RIM Developer Issue Tracker under issue ID JAVAAPI-135.

 

As to checking whether the firewall will prompt the user for access permission or not, I'm not aware of a way to find this out. You can definitely find it out post-facto if the firewall denied access.

Message Edited by klyubin on 20-09-2009 05:01 PM
Retired
Posts: 856
Registered: ‎07-15-2008
My Device: Passport
My Carrier: Bell

Re: Application Permissions, Connector.open(), and the Firewall

Yes, the first instance seems to be a bug that we should track under that issue ID.

 

The second test is a little different. The permission settings for prompt only actually create a prompt when the firewall is on. ie: a permission setting of Prompt is the same as Allow with the firewall off, but creates a real prompt when the firewall is on. When you respond to that prompt and select one of the checkboxes, your answer gets placed into the permissions db for that exact URL that you answered for. So, if you say Deny when prompted for access to say www.url.com, any further attempts to access that are denied - even if you change the overall setting to Allow later.

 

The Application Permissions API will allow you to request permission for the application at one time rather than hoping the user clicks on the right buttons as they appear. In 4.5.0 we added the ReasonProvider so that you can nicely tell the user what you are asking for, and in 4.7.0 we updated 2 parts of the API to work with these firewall details. As of 4.7.0, if you get the permissions for your application and the firewall is off, you will receive VALUE_ALLOW responses when the Permissions are set to ALLOW or PROMPT, as this is the effective permission setting. Secondly, checking for the permission to access a given URL takes into account any blocks set by the firewall itself. Originally this only looked at permission settings from the IT Policy, but since 4.7.0 you can use this to test if the user has clicked on Deny for your URL, and actually re-request that permission from them using the Application Permissions API.

Tim Windsor
Open Source Technical Lead
Developer
Posts: 32
Registered: ‎08-26-2008
My Device: Not Specified

Re: Application Permissions, Connector.open(), and the Firewall

Thank you for your detailed answer, Tim.  So in 4.7.0, the Application Permissions are tied into the firewall, and , but prior to that, they are separate and there isn't a way to re-prompt the firewall dialog?
Highlighted
Retired
Posts: 856
Registered: ‎07-15-2008
My Device: Passport
My Carrier: Bell

Re: Application Permissions, Connector.open(), and the Firewall

Sorry for not noticing the question here earlier, but that is correct.

Tim Windsor
Open Source Technical Lead