Welcome to XDA

Search to go directly to your device's forum

Register an account

Unlock full posting privileges

Ask a question

No registration required
Post Reply

[APP] Proximity Sensor for Screen Off v0.2

OP exidler

27th January 2010, 03:51 PM   |  #1  
OP Senior Member
Thanks Meter: 84
 
150 posts
Join Date:Joined: Oct 2007
Donate to Me
More
May be this tool will be usefull.
It switch off screen using proximity sensor detection.
Like alternative power button.
After proximity detected - screen switched off and proximity sensor don't used until screen will be switched on again manualy.

No screenshots
Second time running will unload program from memory, it can be used for switching on/off proximity lock feature.

All settings in registry, settings reloaded on each program run.

HKEY_CURRENT_USER\Software\Exidler\Hd2ProximityScr eenOff
AfterCallReactivateSensor = dword:150 - time in ms when activate proximity sensor after call ended
SensorOffWhenProximity = dword:0 - time in ms when disabling proximity sensor on proximity detected. May be useful for disabling accident detection. This time proximity sensor is still active and if no porximity detected with this time - screen will be switched on automatically
ActiveOnlyIfLocked = dword:0 - Activate Proximity sensor only if Phone locked.

HKEY_CURRENT_USER\Software\Exidler\Hd2ProximityScr eenOff\Exceptions
Create any named sub keys with values:
ClassName = string - name of windows class
WndTitle = string - title of window
ProcName = string - name of process

For exception windows proximity sensor will be disabled if this one window is active.
All criterias are optional. For example create only one value ProcName="Explorer.exe" for disabling proximity lock when Resco Explorer is active.

Proximity sensor activated only in portrait mode.

Change log
2010-01-29: v0.2
- full uninstallable cab
- add options: After Call Reactivate Sensor, Sensor Off When Proximity, Active Only If Phone Locked, Exception windows
- disbaling Proximity lock when landscape mode

2010-01-28: v0.1 Test version. Bugs possible.
Attached Files
File Type: cab Hd2ProxmityScreenOff-0.1.CAB - [Click for QR Code] (9.4 KB, 1713 views)
File Type: cab Hd2ProximityScreenOff-0.2.CAB - [Click for QR Code] (79.5 KB, 11158 views)
Last edited by exidler; 29th January 2010 at 08:51 PM. Reason: new version
27th January 2010, 04:00 PM   |  #2  
richardirv's Avatar
Senior Member
Thanks Meter: 7
 
383 posts
Join Date:Joined: Mar 2008
Great something to get us started, did you make this yourself? Are you willing to put some time in to perfect it & create some options etc. if we bug test it?
27th January 2010, 04:05 PM   |  #3  
ET's Avatar
Senior Member
Thanks Meter: 1
 
389 posts
Join Date:Joined: Aug 2006
More
Exclamation
Quote:
Originally Posted by exidler

May be this tool will be usefull.
It switch off screen using proximity sensor detection.
Like alternative power button.
After proximity detected - screen switched off and proximity sensor don't used until screen will be switched on again manualy.

No screenshots, not settings, just install and reboot phone (or run tool manual from Install directory)

Second time running will unload program from memory.

Test version. Bugs possible.

How will this effect the screen turning on after a phonecall, i wan't the screen automatically turned on after a call without having to press a button.
Will this tweak allow default function in that case?
27th January 2010, 04:13 PM   |  #4  
OP Senior Member
Thanks Meter: 84
 
150 posts
Join Date:Joined: Oct 2007
Donate to Me
More
Quote:
Originally Posted by richardirv

Are you willing to put some time in to perfect it & create some options etc. if we bug test it?

I don't know which options may be added.
I'm can't full control proximity sensor. It's only possible to enable proximity sensor, and htc drivers switching off screen by itself. The i'm disable proximity sensor again

But if it's will be possible to implement some features - i can try to do this.
27th January 2010, 04:15 PM   |  #5  
richardirv's Avatar
Senior Member
Thanks Meter: 7
 
383 posts
Join Date:Joined: Mar 2008
Ok this is a good start, for me the following things need to be worked out for this to work good.

1. Only works when phone is upright, ie. Portrait. Reason being is if the screen goes off via Proximity in when holding the phone in landscape there will be allot of accidental activations, especially while playing games etc. It is much less likely that proximity will be detected when holding the phone upright.

2. Screen needs to come back on when proximity not detected, as to not cancel out the in call screen off feature.

Will keep thinking! Really hope you can work some magic here exidler!! Thanks
27th January 2010, 04:15 PM   |  #6  
OP Senior Member
Thanks Meter: 84
 
150 posts
Join Date:Joined: Oct 2007
Donate to Me
More
Quote:
Originally Posted by ET

How will this effect the screen turning on after a phonecall, i wan't the screen automatically turned on after a call without having to press a button.

it will handle proximity sensor to default behavior after call. so i think (and shure) - screen will blink for short time (~200ms) and will be switched off by tool.
27th January 2010, 04:18 PM   |  #7  
ET's Avatar
Senior Member
Thanks Meter: 1
 
389 posts
Join Date:Joined: Aug 2006
More
Quote:
Originally Posted by exidler

it will handle proximity sensor to default behavior after call. so i think (and shure) - screen will blink for short time (~200ms) and will be switched off by tool.

Let me test, I assume the cab can be de-installed and everything is back to default behaviour?
27th January 2010, 04:23 PM   |  #8  
OP Senior Member
Thanks Meter: 84
 
150 posts
Join Date:Joined: Oct 2007
Donate to Me
More
Quote:
Originally Posted by richardirv

1. Only works when phone is upright, ie. Portrait. Reason being is if the screen goes off via Proximity in when holding the phone in landscape there will be allot of accidental activations, especially while playing games etc. It is much less likely that proximity will be detected when holding the phone upright.

2. Screen needs to come back on when proximity not detected, as to not cancel out the in call screen off feature.

in call screen back on when no proximity
when not in call - it switch off. or you talking about switching on screen when not in call?

about landscape and portrait. it's make easy if screen orientation really changed (if not - polling g-sensor - is not a good idea for battery i'm think)
27th January 2010, 04:25 PM   |  #9  
OP Senior Member
Thanks Meter: 84
 
150 posts
Join Date:Joined: Oct 2007
Donate to Me
More
Quote:
Originally Posted by ET

Let me test, I assume the cab can be de-installed and everything is back to default behaviour?

Cab is Uninstallable, but you must close program manually before uninstalling: run program second time, it will show message about closing
27th January 2010, 04:27 PM   |  #10  
richardirv's Avatar
Senior Member
Thanks Meter: 7
 
383 posts
Join Date:Joined: Mar 2008
Quote:
Originally Posted by exidler

in call screen back on when no proximity
when not in call - it switch off. or you talking about switching on screen when not in call?

about landscape and portrait. it's make easy if screen orientation really changed (if not - polling g-sensor - is not a good idea for battery i'm think)

I just ment you don't want it to interfere with the in call actions the HD2 already has.

As you say g-sensor polling etc. no good for battery. I have a feeling this maybe flawed before we get started.

Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes