Proximity Sensor

From WebOS Internals
Revision as of 01:38, 28 April 2010 by Nt4cats (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

While poking around in code I found some code that interacts with the IR proximity sensor. I think quite a few apps could use it as an input, for one the stock "Clock" app can utilize it to control it's alarm / snooze / dismiss functions. I haven't done much with it yet and don't think it would be appropriate to cut-paste code here but if you're interested in exploring this functionality check out:


I'll try and update this page when I find more information / code examples.

UPDATE: The code in "proximity-assistant.js" does not get any events from the proximity sensor. It is unable to know whether a user has gotten close to the proximity sensor. All it can do is turn the sensor on (and be notified that it successfully set it on). The screen turning off is done by the sensor, NOT by the phone app's code. Unfortunately unless we find a way to get events from the proximity sensor it is effectively useless for apps like the alarm clock suggested above.