The Following 2 Users Say Thank You to SPARTAN563 For This Useful Post: | ||
![]() |
2011-06-20
, 16:40
|
|
Posts: 92 |
Thanked: 92 times |
Joined on May 2011
@ Stellenbosch, South Africa
|
#22
|
The Following User Says Thank You to SPARTAN563 For This Useful Post: | ||
![]() |
2011-06-20
, 17:23
|
Posts: 96 |
Thanked: 51 times |
Joined on Jul 2010
@ India
|
#23
|
Okay, SIMLock is now in the autobuilder que, will let you all know if/when it is in extras-devel.
As for the idea of locking your phone when an app is started, it isn't the actual UI part that would chew battery power (since that would only be visible for as long as it took you to enter your code in the first place) but rather the background daemon which would have to do something like this (since there doesn't appear to be a DBus signal for "app launched"):
Which means that every 5 seconds (less if you wanted to reduce the chance of someone performing that race hack I spoke about) it is gonna have to grab all your running apps, check them against a database of your locked apps, and then if it finds a locked app that is busy running it locks the phone. But each time it has to do that it will be chowing CPU cycles. So in order to lower that you would make it only check while the phone is in an "active" state (i.e. unlocked, the kind that is done with the lock switch). But that still will chew power while the phone is in an active state.Code:QList<QString> runningUnlocked; while(!exit) { //Get a list of all the running apps on the phone QList<QString> runningApps = GetRunningApps(); //Loop through them and find out if they are locked, and if they have been unlocked by the person unlocking the phone for(int i = 0; i < runningApps.length(); i++) { if(IsLockedApp(runningApps[i]) && !runningUnlocked.contains(runningApps[i])) { LockPhone(); WaitForUnlock(); //We don't want to keep calling the lock function while the phone is locked, so wait for it to unlock runningUnlocked << runningApps[i]; //Add the app to the list of unlocked ones (temporary) continue; } //Remove any of the apps that were running unlocked but have been closed for(int i = 0; i < runningUnlocked.length(); i++) { if(!runningApps.contains(runningUnlocked[i])) runningUnlocked.removeAt(i); } } sleep(5); }
If you'd like though, I'll code it up in Qt, should make it a little less power hungry than if it were in Python.
As for keeping it running after a killall command, you could just use an event.d script that would restart it continually until the phone was turned off.
EDIT: Okay, package has been built by the Autobuilder and should appear in extras-devel relatively soon. I will update this and the first post when it has been uploaded there correctly.
EDIT2: Package is now available in extras-devel
![]() |
2011-06-20
, 17:42
|
|
Posts: 92 |
Thanked: 92 times |
Joined on May 2011
@ Stellenbosch, South Africa
|
#24
|
![]() |
2011-06-21
, 01:42
|
|
Posts: 4,365 |
Thanked: 2,467 times |
Joined on Jan 2010
@ Australia Mate
|
#25
|
![]() |
2011-06-21
, 06:23
|
|
Posts: 92 |
Thanked: 92 times |
Joined on May 2011
@ Stellenbosch, South Africa
|
#26
|
![]() |
2011-06-21
, 08:11
|
|
Posts: 4,365 |
Thanked: 2,467 times |
Joined on Jan 2010
@ Australia Mate
|
#27
|
![]() |
2011-06-21
, 17:59
|
|
Posts: 92 |
Thanked: 92 times |
Joined on May 2011
@ Stellenbosch, South Africa
|
#28
|
The Following User Says Thank You to SPARTAN563 For This Useful Post: | ||
![]() |
2011-06-22
, 08:00
|
|
Posts: 92 |
Thanked: 92 times |
Joined on May 2011
@ Stellenbosch, South Africa
|
#29
|
The Following User Says Thank You to SPARTAN563 For This Useful Post: | ||
![]() |
2011-06-22
, 08:29
|
|
Posts: 4,365 |
Thanked: 2,467 times |
Joined on Jan 2010
@ Australia Mate
|
#30
|
As for the idea of locking your phone when an app is started, it isn't the actual UI part that would chew battery power (since that would only be visible for as long as it took you to enter your code in the first place) but rather the background daemon which would have to do something like this (since there doesn't appear to be a DBus signal for "app launched"):
If you'd like though, I'll code it up in Qt, should make it a little less power hungry than if it were in Python.
As for keeping it running after a killall command, you could just use an event.d script that would restart it continually until the phone was turned off.
EDIT: Okay, package has been built by the Autobuilder and should appear in extras-devel relatively soon. I will update this and the first post when it has been uploaded there correctly.
EDIT2: Package is now available in extras-devel
Last edited by SPARTAN563; 2011-06-20 at 14:50.