Notices


Reply
Thread Tools
F2thaK's Avatar
Posts: 4,365 | Thanked: 2,467 times | Joined on Jan 2010 @ Australia Mate
#1
I have an idea but not the coding skills for an app:

"PocketLock."

When you put your N9oo in your pocket, it locks itself!
(When proximity sensor is covered.)
Possibly even unlocks itself upon removal from pocket.

Anyone interested in making such an app?



F2K.
 
Posts: 1,680 | Thanked: 3,685 times | Joined on Jan 2011
#2
No.

1. This would require proximity sensor polling which is a massive drain on battery.

2. The proximity sensor is well known for how much it sucks balls (although few people have investigated the possibility of replacing resistor R1541 to alter it's sensitivity) and would be locking all the time in bright sunlight.

Otherwise, keep those ideas coming!
__________________
N900: One of God's own prototypes. A high-powered mutant of some kind never even considered for mass production. Too weird to live, and too rare to die.
 

The Following 3 Users Say Thank You to vi_ For This Useful Post:
F2thaK's Avatar
Posts: 4,365 | Thanked: 2,467 times | Joined on Jan 2010 @ Australia Mate
#3
couldnt you lock screen with shortcutD though?

just thought about it, will hava look

Last edited by F2thaK; 2011-04-04 at 10:01.
 
Posts: 151 | Thanked: 93 times | Joined on Sep 2009 @ sofia, bulgaria
#4
There is similar program for N810 (autolock).
N810 does not have proximity sensor, so it is light sensor that is used.
Works pretty well there, I'm not sure if it is feasible to be ported to N900.
 
damnshock's Avatar
Posts: 179 | Thanked: 86 times | Joined on Dec 2009 @ Barcelona
#5
Originally Posted by vi_ View Post

1. This would require proximity sensor polling which is a massive drain on battery.
I thought the proximity sensor was always on whether we use it or not. Ain't it suppose to send a dbus signal (or something alike) when it's switched on?

Regards
 

The Following User Says Thank You to damnshock For This Useful Post:
Posts: 1,680 | Thanked: 3,685 times | Joined on Jan 2011
#6
Originally Posted by damnshock View Post
I thought the proximity sensor was always on whether we use it or not. Ain't it suppose to send a dbus signal (or something alike) when it's switched on?

Regards
Nope, while the proximity sensor is possibly 'on' at a very basic hardware level it is essentially ignored by the OS until somthing requests to read its condition. It does not cause a signal on dbus unless you have proximityd (promity daemon) running which is polling the hardware. This causes extra wakeups for the kernel and stops the CPU sleeping so much.
__________________
N900: One of God's own prototypes. A high-powered mutant of some kind never even considered for mass production. Too weird to live, and too rare to die.
 
Posts: 2,225 | Thanked: 3,822 times | Joined on Jun 2010 @ Florida
#7
Originally Posted by damnshock View Post
I thought the proximity sensor was always on whether we use it or not. Ain't it suppose to send a dbus signal (or something alike) when it's switched on?

Regards
It's "on" in that the hardware is technically supplied power. But the rest of the hardware, where the OS itself is being executed, has to send a signal to the proximity sensor hardware "are you covered", to which the proximity sensor sends back yes/no. The proximity sensor is NOT in possession of its own processor, or capable of fancy computations - DBus is a complicated thing, and happens inside the operating system. In order for that dbus signal to happen, the N900's OS first has to get the response of either covered or un-covered from the sensor hardware. It's like when your computer interfaces with it's CD drive - the CD drive doesn't read the disk and tell the rest of the computer "there's files X, Y, and Z, of sizes A, B, and C respective, containing the following contents, on this disk" - the CD drive just receives the commands that tell it to spin up the disk and what coordinates on it to read, and then sends back a stream of ones/zeroes back to the operating system.

Same thing, except the proximity sensor is a lot "simpler", and only has one one or one zero that it sends, per every "polling". Now, every time the OS has to poll the proximity sensor, it has to send a little burst of electricity to the proximity sensor, and while that's not that bad for energy consumption if done only when you're in a phone call or whatever, it IS pretty bad if it's doing it hundreds of times every minute, all the time.
 
Alfred's Avatar
Posts: 855 | Thanked: 612 times | Joined on Oct 2010 @ Germany
#8
There is lockd.py in the net. I mean it's been a while since i got it from somewhere. It is a simple python that locks ur screen when you shut the proximity sensor and unlocks ur screen when you shake the phone. You can set time, for how long should the sensor be shut in order to lock the scree.
P.s. don't forget to change format to .py
Attached Files
File Type: txt lockd.py.txt (1.5 KB, 171 views)
 

The Following 5 Users Say Thank You to Alfred For This Useful Post:
Posts: 183 | Thanked: 33 times | Joined on Aug 2010
#9
How about you double-click the power-button through your pants?
 
F2thaK's Avatar
Posts: 4,365 | Thanked: 2,467 times | Joined on Jan 2010 @ Australia Mate
#10
its so you can quickly throw it in your pocket
 
Reply

Tags
autolock, lock screen, proximitysensor

Thread Tools

 
Forum Jump


All times are GMT. The time now is 11:33.