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
sdb1031
Posts: 2
Registered: ‎09-10-2008
My Device: Not Specified

Programmically setting ITSecurity options without a BES?

Hi all,

I'm brand new to blackberry development and would like to begin with a project.  I'd like to be able to programmatically set the security options available on a Blackberry Pearl 8100 without relying on a BES server.  Preferrably the ones found under Options->Security Options->General Settings.  I've been reading the ITpolicy class via this link:

http://www.blackberry.com/developers/docs/4.0.2api/index.html

It indicates that the policy options can be read, but I'm unsure if there's a way to set/change a policy option using the class.

 

The other alternative that I've found is via the EventInjector class found via this link:

http://www.blackberry.com/developers/docs/4.0.2api/index.html

 It looks like it could be  possible via this method, but I would think it could get messy using wheel movements, especially when a user's icons could be located in different areas.  Also, the security of the device would need to be manually loosened on the BB to allow EventInjections to occur.

Does anyone have any suggestions or ideas that could point me in the right direction?  If this is possible, any example could would be greatly appreciated.

 

 Thanks!

Please use plain text.
Developer
malcolm
Posts: 41
Registered: ‎08-01-2008
My Device: Not Specified

Re: Programmically setting ITSecurity options without a BES?

[ Edited ]

I'm not sure if or how you can change those global settings, but any programmatic method which might exist will almost certainly rely on your application having permission to modify the device settings. You can do this by...

 

 

ApplicationPermissionsManager appPermMan =
ApplicationPermissionsManager.getInstance();

ApplicationPermissions myPerms = appPermMan.getApplicationPermissions();

myPerms.addPermission(ApplicationPermissions.PERMISSION_CHANGE_DEVICE_SETTINGS);

boolean result = appPermMan.invokePermissionsRequest(myPerms);

 Check the result variable for whether your request was successful (ie whether the user clicked yes on the popup screen that the invokePermissionsRequest() call causes).

 

Edit: doing it with Event Injection will be very hairy, and liable to completely break if the layout of the screen is ever changed in a future OS version. Do that only as a very very last resort.

 

Message Edited by malcolm on 09-10-2008 11:25 AM
Please use plain text.
BlackBerry Development Advisor
MSohm
Posts: 14,649
Registered: ‎07-09-2008
My Device: BlackBerry Z30, BlackBerry PlayBook

Re: Programmically setting ITSecurity options without a BES?

It is not possible to programmatically modify IT Policy settings on a BlackBerry.  You could modify these settings through the use of event injection.
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
Please use plain text.
New Developer
sdb1031
Posts: 2
Registered: ‎09-10-2008
My Device: Not Specified

Re: Programmically setting ITSecurity options without a BES?

Is it known how the BES server is able to set the policy items remotely and send them down to the device? If it can be done remotely via a BES, why not programmatically with code that exists on the Blackberry itself?
Please use plain text.