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 Contributor
floor51
Posts: 5
Registered: ‎09-08-2010
My Device: Not Specified

BES causing ControlledAccessException on LocationProvider.getInstance

Hi,

  I have an app that uses LocationProvider.getInstance and it works fine on non-BES devices installing using the browser. However when I deploy via a BES synced device I get a ControlledAccessException.

 

All the configs like the app control policy and device policy are set to not disable the Location permission and indeed I use ApplicationPermissionsManager to check and request the permission if it isn't granted on device. It is allowed and still I get the ControlledAccessException. I try disabling and enabling the permission manually but it still doesn't work. I've tried other approaches such as using a global event as mentioned elsewhere. I've tried invokeAndWait to request on the main thread and before enterEventDispatcher like in the GPSDemo in the doc.

 

I can get a location when using the settings app and selecting refresh GPS. The built in maps work fine.

 

Is there a bug in BB OS 7 in relation to this? I think it worked on 7.1.0.1046 on a 9720 but I get the exception on 7.1.0.336 on a 9320.

 

Chris

 

Please use plain text.
New Contributor
floor51
Posts: 5
Registered: ‎09-08-2010
My Device: Not Specified

Re: BES causing ControlledAccessException on LocationProvider.getInstance

Hmm I get this on BB OS 5 as well.

 

Not sure if it is related to turning a prosumer into a BES device or the firmware build settings - the one that worked is a Carphone Warehouse firmware, the others are Orange.

Please use plain text.
Developer
peter_strange
Posts: 19,603
Registered: ‎07-14-2008
My Device: Not Specified

Re: BES causing ControlledAccessException on LocationProvider.getInstance

If I were swapping a consumer to BES device, or the other way round, I think I would wipe the device completely before attempting to use it in the new environment.  Here is how:

 

http://helpblog.blackberry.com/2012/01/remove-blackberry-it-policy/

 

I appreciate the document is focused on Enterprise to consumer, but I would think the reset to factory would also be useful in this circumstance just to be sure there is nothing 'hanging over'. 

 

Just a thought, never done this myself.

Please use plain text.
New Contributor
floor51
Posts: 5
Registered: ‎09-08-2010
My Device: Not Specified

Re: BES causing ControlledAccessException on LocationProvider.getInstance

Thanks Peter yes I did do this. Still get ControlledAccessException even though it appears the permission is granted.

Please use plain text.
New Contributor
floor51
Posts: 5
Registered: ‎09-08-2010
My Device: Not Specified

Re: BES causing ControlledAccessException on LocationProvider.getInstance

Note this is BES Express 5.0.3. I've upgraded to 5.0.4 and still no luck.

Please use plain text.