BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 12-05-2008, 08:35 AM   #1 (permalink)
New Member
 
Join Date: Oct 2008
Model: NO
PIN: N/A
Carrier: MTEL
Posts: 9
Post Thanks: 0
Thanked 0 Times in 0 Posts
Arrow Programatically check IT Policy Presence?

Please Login to Remove!

Hi all.

How can i check is there any policy installed on device?

Thanks
Offline  
Old 12-05-2008, 09:03 AM   #2 (permalink)
Talking BlackBerry Encyclopedia
 
Join Date: Apr 2008
Location: Germany, BW
Model: -
PIN: N/A
Carrier: -
Posts: 310
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

net.rim.device.api.itpolicy.ITPolicy has several static functions to get policy values.

In general I would say...
- IT policy can only be present on the device if it was enterprise activated.
- If it was enterprise activated there must be service books named "Desktop"

so I would look for the presence of such a service book, but it might be not the best way to do what you want...
__________________
Blessed is the end user who expects nothing, for he/she will not be disappointed. (Franklin's Rule)
Offline  
Old 12-05-2008, 09:26 AM   #3 (permalink)
BlackBerry Extraordinaire
 
CO_BBTechie's Avatar
 
Join Date: Jul 2007
Location: Denver
Model: 8310
Carrier: AT&T
Posts: 2,044
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Not if the device is no longer on a BES, but still has a policy. This happens a lot. A general security wipe will remove the service books, but will not remove an IT policy.
__________________
Treat your password like your toothbrush. Don't let anybody else use it, and get a new one every six months.
Clifford Stoll
Offline  
Old 12-05-2008, 09:38 AM   #4 (permalink)
Talking BlackBerry Encyclopedia
 
Join Date: Apr 2008
Location: Germany, BW
Model: -
PIN: N/A
Carrier: -
Posts: 310
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

thanks, good to know.
That means ITPolicy class would still return valid values although the device is not under control of the BES any more?
__________________
Blessed is the end user who expects nothing, for he/she will not be disappointed. (Franklin's Rule)
Offline  
Old 12-05-2008, 09:41 AM   #5 (permalink)
BlackBerry Extraordinaire
 
CO_BBTechie's Avatar
 
Join Date: Jul 2007
Location: Denver
Model: 8310
Carrier: AT&T
Posts: 2,044
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

I can't confirm that, but the policy may exist without any other data on the device.
__________________
Treat your password like your toothbrush. Don't let anybody else use it, and get a new one every six months.
Clifford Stoll
Offline  
Old 12-05-2008, 09:44 AM   #6 (permalink)
New Member
 
Join Date: Oct 2008
Model: NO
PIN: N/A
Carrier: MTEL
Posts: 9
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Ok, as well as i know this class ITPolicy read from ITPolicyTemplate2 table, which is part of MSSQL storage running on BES machine, so i don't see how i can use it in case that device is not in BES. Anyway the usage of this class is not very clear for me.

By now a begin to search for something like system storage on device where a expect to find something for currently installed IT Policy and device configuration at all.

Any help is welcome.
Offline  
Old 12-05-2008, 09:49 AM   #7 (permalink)
Talking BlackBerry Encyclopedia
 
Join Date: Apr 2008
Location: Germany, BW
Model: -
PIN: N/A
Carrier: -
Posts: 310
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

what actually do you expect to find in the IT Policy that might interest you? Normally you would get Exceptions if trying to do something not allowed by the policy.
__________________
Blessed is the end user who expects nothing, for he/she will not be disappointed. (Franklin's Rule)
Offline  
Old 12-05-2008, 10:02 AM   #8 (permalink)
New Member
 
Join Date: Oct 2008
Model: NO
PIN: N/A
Carrier: MTEL
Posts: 9
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

No no, i don't want to modify the policy. At the beginning i wrote that all i wanna do is to detect is there any policy on device or is there not. That is all.
Offline  
Old 12-05-2008, 10:19 AM   #9 (permalink)
Talking BlackBerry Encyclopedia
 
Join Date: Apr 2008
Location: Germany, BW
Model: -
PIN: N/A
Carrier: -
Posts: 310
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

I meant if you would for example try to open an external HTTP connection and it would be disallowed by the policy you would get a corresponding exception so if you caught it, you can react.

However you can programatically listen on ITPolicy cahnges by registering your own listener.
using
Code:
boolean appEnabled = ITPolicy.getBoolean(xxx8220;DemoAppEnabledxxx8221;, true);
you can check the values. Here it is a custom value, but maybe it also works with the standard policy values.
__________________
Blessed is the end user who expects nothing, for he/she will not be disappointed. (Franklin's Rule)
Offline  
Old 12-09-2008, 03:20 AM   #10 (permalink)
New Member
 
Join Date: Oct 2008
Model: NO
PIN: N/A
Carrier: MTEL
Posts: 9
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

May be i dont understand the ITPolicy class, but this return to me false
ITPolicy.getBoolean("Allow Split-Pipe Connections", false)
and this true
ITPolicy.getBoolean("Allow Split-Pipe Connections", true).
What is going on?
Offline  
Old 12-09-2008, 03:24 AM   #11 (permalink)
Talking BlackBerry Encyclopedia
 
Join Date: Apr 2008
Location: Germany, BW
Model: -
PIN: N/A
Carrier: -
Posts: 310
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

well it's clearly defined:

Quote:
public static boolean getBoolean(int id, boolean defaultValue)

Returns a boolean value from the IT policy database.

Parameters:
id - The parameter id.
defaultValue - The value to be returned if no entry was found.
Returns:
The parameter value.
means if the policy value was not found you will get the default value you've passed as second parameter
__________________
Blessed is the end user who expects nothing, for he/she will not be disappointed. (Franklin's Rule)
Offline  
Old 12-09-2008, 04:29 AM   #12 (permalink)
New Member
 
Join Date: Oct 2008
Model: NO
PIN: N/A
Carrier: MTEL
Posts: 9
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Solved! Thanks Ivanov!

Last edited by debelin : 12-11-2008 at 03:23 AM.
Offline  
Closed Thread


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On





Copyright 2004-2014 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.