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

why locationListener has been blocked on device?

Hi there,

 

I have an application to use LocationListener to get coordinates and update to my database server.

it works fine for a long time until last week, one of my customer complains that his device can not be tracked.

when I let him send the log file, I found that LocationListener has been denied?

 

>>>>(Error) Disconnecting LocationListner: java.lang.SecurityException: Permission denied

 

why this happened? how to chang to be allowed?

 

I rembered that device IT Policy is under of BES server control, where can I find it?

but user said they never changed IT Policy on BES server, can user change it to be enable on device itself?

 

 

Thanks in advanced. 

 

 

 

Please use plain text.
Administrator
MSohm
Posts: 14,226
Registered: ‎07-09-2008
My Device: BlackBerry Z30, BlackBerry PlayBook
My Carrier: Bell

Re: why locationListener has been blocked on device?

You are not able to view or modify an IT Policy on the BlackBerry, it is set in the BlackBerry Manager on the BlackBerry Enterprise Server.  This could be caused by an IT Policy.

 

A user can change the Application Permissions on a BlackBerry, which can control what an application can do.  However if this was locked down by an application permission setting your application should receive a ControlledAccessException, not a SecurityException.  You can view/change these settings by going to Options, Advanced Options, Applications, select your application and choose Edit Permissions from the menu.

 

 

 

 

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

Re: why locationListener has been blocked on device?

Hi Mark,

 

Thanks for your reply,

 

I trace my source code, and RIM API:

 

here is my source code:

 

try { _provider.setLocationListener(null,-1,-1,-1); _provider.reset(); //_provider = null; setStatus(GPSConstants.STATUS_DISCONNECTED); } catch(Exception e) { Logger.log("(Error) Disconnecting LocationListner: " + e.toString() + " Msg: " + e.getMessage()); }

and the _provider is :

_provider = LocationProvider.getInstance(null);

I believe that my application has permissions to access location function.

 

when I check RIM API about Provider on Exception, it says:

 

SecurityException - if the calling application does not have a permission to query the location information

 

According to your last kind answer, So I am wondering if it is caused by Carrier?

 

Thanks

 

Please use plain text.
Administrator
MSohm
Posts: 14,226
Registered: ‎07-09-2008
My Device: BlackBerry Z30, BlackBerry PlayBook
My Carrier: Bell

Re: why locationListener has been blocked on device?

What BlackBerry model and handheld software version are you testing on?  Older versions of BlackBerry handheld software (4.0.2) have another permission setting.  This is the Privacy Setting found under Options, Location Based Services.

 

Verizon does lock down GPS access to third party applications.  This is explained here.

 

What Is - Verizon GPSSettings signing requirement
Article Number: DB-00591

http://www.blackberry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800332/800703/What_Is...

 

Here is a summary of GPS support on BlackBerry handhelds. 

 

What Is - The BlackBerry smartphone models and their corresponding GPS capabilities
Article Number: DB-00615

http://www.blackberry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800332/800703/What_Is...

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

Re: why locationListener has been blocked on device?

Hi Mark,

 

There are two types Handheld, one is 8800,version 4.2.1.74, and the other one is 8820, version 4.2.2.193,

 

Their carrier are T-Mobile.

 

However, they have one device works fine, which is 8800 and version is 4.2.1.74.

Strange!!

 

I have checked the document that you mentioned last post, I can not figure it out.

 

what the problem?

 

Thanks in advanced.

Please use plain text.
Administrator
MSohm
Posts: 14,226
Registered: ‎07-09-2008
My Device: BlackBerry Z30, BlackBerry PlayBook
My Carrier: Bell

Re: why locationListener has been blocked on device?

This is most likely being caused by an IT Policy that is restricting access to GPS.  Please check with the BlackBerry Enterprise Server administrator to determine their IT Policy settings.
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.
Developer
Jeff_Lu
Posts: 384
Registered: ‎08-12-2008
My Device: 8700

Re: why locationListener has been blocked on device?

Hi Mark,

 

Thanks

 

I have checked RIM Document, however, it says user can change Application control policy to set smartphone GPS feature to control access third party GPS on the device. however, I did not get the right one to tell me how.

 

Would you mind giving a link or where i can find it?

 

Thnaks

 

Please use plain text.
Administrator
MSohm
Posts: 14,226
Registered: ‎07-09-2008
My Device: BlackBerry Z30, BlackBerry PlayBook
My Carrier: Bell

Re: why locationListener has been blocked on device?

[ Edited ]

Application control policies can be changed by the user by going to Options, Advanced Options, Applications, selecting your application and clicking on the Edit Permissions menu item.

 

However, please note that restrictions from application control policy restrictions should throw a ControlledAccessException, not a SecurityException.

 

GPS can also be locked down via an IT Policy set on the BlackBerry Enterprise Server.  A user is not able to modify this.

Message Edited by MSohm on 09-19-2008 11:07 AM
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.