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
Posts: 41
Registered: ‎07-07-2009
My Device: Not Specified

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!

 

Highlighted
Developer
Posts: 1,807
Registered: ‎04-28-2009
My Device: Z10 (STL100-4)-10.3.2.858, Z10 (STL100-3)-10.3.1.2576, Z30 (STA100-5)-10.3.1.2582, Passport (SQW100-1)-10.3.1.2576, PlayBook (16GB)-2.1.0.1917
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.

---Spends time in #blackberrydev on freenode (IRC)----
Three simple rules:
1. Please use the search bar before making new posts.
2. "Like" 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.
New Developer
Posts: 15
Registered: ‎08-13-2009
My Device: Not Specified

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.

 

Trusted Contributor
Posts: 227
Registered: ‎12-16-2009
My Device: 9530,8900,9000
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
Contributor
Posts: 27
Registered: ‎02-28-2011
My Device: Not Specified

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

Trusted Contributor
Posts: 227
Registered: ‎12-16-2009
My Device: 9530,8900,9000
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
Contributor
Posts: 27
Registered: ‎02-28-2011
My Device: Not Specified

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

 

Trusted Contributor
Posts: 227
Registered: ‎12-16-2009
My Device: 9530,8900,9000
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
Contributor
Posts: 27
Registered: ‎02-28-2011
My Device: Not Specified

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