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. New to the forum? Please visit the ‘Getting Started’ link below.
inside custom component

Java Development

Reply
Developer
seasonw
Posts: 41
Registered: ‎07-07-2009

lockSystem in OS version 5.0

Hi, I have the following code works great in version 4.5, but it does not work in version 5.0, is there any problem with new OS version 5.0? Or this command has been replaced?

 

ApplicationManager.getApplicationManager().lockSystem(true);

 

Thanks!

 

Please use plain text.
Developer
rcmaniac25
Posts: 1,789
Registered: ‎04-28-2009
My Carrier: Verizon

Re: lockSystem in OS version 5.0

It might be depreciated because up until, and including 4.7 the function has a comment for the "force" parameter. In the current 5.0 API the "force" parameter simply says depreciated. Maybe they put it in the wrong place, maybe it actually is depreciated. I don't know a fix, sorry.

------------------------------------------------------------
Three simple rules:
1. Please use the search bar before making new posts.
2. Kudo posts that you find helpful.
3. If a solution has been found for your post, mark it as solved.
--I code too much. Well, too bad.
Please use plain text.
New Developer
jrasania
Posts: 15
Registered: ‎08-13-2009

Re: lockSystem in OS version 5.0

Hi


Actually lockSystem( force ) is working with OS version lesser than 5.0.

In ApplicationManager.lockSystem( force ), parameter force is deprecated not api.

 

There are mainly two point.

01. In ApplicationManager.lockSystem( force ) parameter force is deprecated not api so, api should work in 6.0.

02. force parameter is deprecated in 6.0 not 5.0 so, it must work in 5.0.

 

Waiting for reply.

 

Please use plain text.
Trusted Contributor
hims_3009
Posts: 227
Registered: ‎12-16-2009
My Carrier: Airtel,Docomo

Re: lockSystem in OS version 5.0

Its working with my device..  I am using bold 9700 with os 5.0.0.593...

 

Lathiya Himanshu
Please use plain text.
Contributor
holkar_abhi
Posts: 27
Registered: ‎02-28-2011

Re: lockSystem in OS version 5.0

R u sure .?? As many have reckon its not working and is depreceated in BB OS 5.0 onwards.

 

And if its working is it a workaround or simple API as needed.

 

ApplicationManager.getApplicationManager().lockSystem(true);

 

Kindly let us know.

 

Cheers

~Abhi

Please use plain text.
Trusted Contributor
hims_3009
Posts: 227
Registered: ‎12-16-2009
My Carrier: Airtel,Docomo

Re: lockSystem in OS version 5.0

yes it's working.

appManager=ApplicationManager.getApplicationManager();

if(!appManager.isSystemLocked())

{

      appManager.lockSystem(true);

}

I am using only these code and it is working fine with my simulator as well as with my Device...

 

Lathiya Himanshu
Please use plain text.
Contributor
holkar_abhi
Posts: 27
Registered: ‎02-28-2011

Re: lockSystem in OS version 5.0

Thanks for responding.

 

I tried the code with Application Permissions... No luck..

 

I have tried 2 solutions :

 

1   . With Your code ---- >     I get Controlled Access exception when I try to lockSytem on BB 5.0 Simulator and device.

 I therefore added application permissions programmatically but now I get Runtime exception .

 

I understand invoking application permissions needs some mandation like it be invoked before app enters event dispatcher.

 

2. I tried using Event Injector for LEY_LOCK ..-- Surprisingly this doesnt work . It works for other keys like KEY_END.

 

Awaiting for your kind suggestion and request.

 

Cheers,

~~Abhi

 

Please use plain text.
Trusted Contributor
hims_3009
Posts: 227
Registered: ‎12-16-2009
My Carrier: Airtel,Docomo

Re: lockSystem in OS version 5.0

Forget to mention that It's locking the device if and only if you set the password for device..

Lathiya Himanshu
Please use plain text.
Contributor
holkar_abhi
Posts: 27
Registered: ‎02-28-2011

Re: lockSystem in OS version 5.0

Ok thanks I shall try and let u know.

 

However the device locks as such if kept idle for a while.

 

 

That does means the password is set .

 

 

Cheers,

Abhi



Please use plain text.