BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 12-01-2009, 07:58 PM   #1 (permalink)
Knows Where the Search Button Is
 
Join Date: Sep 2007
Model: 8100
PIN: N/A
Carrier: Vodafone
Posts: 18
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default LED.setState Exception

Please Login to Remove!

I have a Blackberry J2ME application that calls LED.setState(LED.STATE_ON) to turn the LED on. This works fine in the JDE 4.2.1 to 4.7.0.

However, in the JDE 5.0 Beta 5, I am getting an exception in the internal Blackberry API function LEDEngine.setStateInternal(int,int) when running in the Blackberry 9700 Simulator. I have also had a report that this is happening on the actual Bold 9700 device as well.

Apart from not turning the LED on, is this a bug that needs fixing in the API or is there something special I need to do in 5.0?
Offline  
Old 12-01-2009, 08:46 PM   #2 (permalink)
BlackBerry Extraordinaire
 
Join Date: Mar 2008
Location: Austin, TX
Model: 9700
PIN: N/A
Carrier: T-Mobile
Posts: 1,644
Post Thanks: 0
Thanked 34 Times in 33 Posts
Default

Where did you find LEDEngine ??

Not in any of my documentation.

If it is not documented, then it is not "supported", so RIM will not accept it as a bug.

What was wrong with the LED class that works?
Offline  
Old 12-01-2009, 09:23 PM   #3 (permalink)
Knows Where the Search Button Is
 
Join Date: Sep 2007
Model: 8100
PIN: N/A
Carrier: Vodafone
Posts: 18
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

This is an internal function that is only displayed in the call stack when the exception occurs. The code flow goes from the function I call which is LED.setState(int) to the first internal one of LED.setState(int,int) and then to LEDEngine.setStateInternal(int,int) which is where the uncaught exception occurs, deep in the API code. This is why I believe this is an API bug in 5.0.

Doing some more testing I see that the LED.STATE_ON and LED.STATE_PATTERN both cause the exception while the LED.STATE_BLINKING and LED.LED_TYPE_STATUS both work fine. I can actually use the LED.STATE_BLINKING in my application, so that is a workaround for me but may not be for other people.
Offline  
Old 12-01-2009, 11:06 PM   #4 (permalink)
BlackBerry Extraordinaire
 
Join Date: Mar 2008
Location: Austin, TX
Model: 9700
PIN: N/A
Carrier: T-Mobile
Posts: 1,644
Post Thanks: 0
Thanked 34 Times in 33 Posts
Default

OK - I misunderstood.

Did you verify that the device supports the trackball LED activation?

public static void setState(int type,int state)Sets the specified LED state.

Trackball LED can only be set if supported by device. Use isSupported(int) to determine if trackball LED can be set.
Offline  
Old 12-02-2009, 02:30 PM   #5 (permalink)
Knows Where the Search Button Is
 
Join Date: Sep 2007
Model: 8100
PIN: N/A
Carrier: Vodafone
Posts: 18
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

I did add the isSupported(int) check to my code just in case that was the problem, but it didn't make any difference.

Also I'm not trying to set the Trackball LED at all, just the Status LED using the API calls for that LED only, not the ones that specify type in the first parameter. All I call directly is LED.setState(int).
Offline  
Old 12-02-2009, 06:25 PM   #6 (permalink)
BlackBerry Extraordinaire
 
Join Date: Mar 2008
Location: Austin, TX
Model: 9700
PIN: N/A
Carrier: T-Mobile
Posts: 1,644
Post Thanks: 0
Thanked 34 Times in 33 Posts
Default

I have an application that makes the same call, and runs on 5.0.0.3xxx with no issues.
Offline  
Old 12-02-2009, 09:26 PM   #7 (permalink)
Knows Where the Search Button Is
 
Join Date: Sep 2007
Model: 8100
PIN: N/A
Carrier: Vodafone
Posts: 18
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

It's possible this may just be a Simulator bug in the Blackberry 9700 OS 5.0.0.334 (Beta 5) simulator? Is this what you tried it your application with and was it using LED.setState(LED.STATE_ON) method?
Offline  
Old 12-03-2009, 09:14 AM   #8 (permalink)
BlackBerry Extraordinaire
 
Join Date: Mar 2008
Location: Austin, TX
Model: 9700
PIN: N/A
Carrier: T-Mobile
Posts: 1,644
Post Thanks: 0
Thanked 34 Times in 33 Posts
Default

Might be - I'm using the 5.0.0.228 simulator, and also tested on 5.0.0.321, 5.0.0.330, and 5.0.328 devices.
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.