durka / HallMonitor

clean room Galaxy S4 View Cover driver
Apache License 2.0
45 stars 21 forks source link

Hall Monitor

About

This is an Android app that reimplements some of the behaviors specific to the Samsung Galaxy S4, so that they can be used with alternative ROMs, such as CyanogenMod, where the proprietary Samsung components are not available. At this time, these behaviors are:

  1. Support the S View Cover. There is a magnet in the cover, and a hall effect sensor built in to the S4, so that when you close the cover, we can automatically display the lock screen for a few seconds before putting the phone to sleep, and when you open the cover the phone wakes up.

Why use Hall Monitor instead of one of the other apps that locks the screen when you close the cover? As far as I can tell, they all use the proximity sensor to detect when the cover closes. Well, the S4 has a hall effect sensor, which is a much more accurate way to detect when the cover closes, and is what this app uses (but see below).

This app is a "clean room" implementation. I'm not extracting Samsung's binaries from the stock ROM, or anything like that, just attempting to reimplement the functionality that I like.

Screenshots:

Configuration screen (okay, it's the only screen) GIF of opening and closing the cover

Important: The preponderance of the evidence so far indicates that there should be no problem running this app on any Galaxy S4, and even on the S4 mini/mega. However, I have only personally tested it under the following configuration(s):

Others have tested this under the following configuration(s):

If you test this on something other than the above (including another carrier's S4) and it works, please let me know! You can contact me at android@alexburka.com. If it doesn't work, please file an issue here. But no promises, because I can't really do tech support for devices I don't own.

Installation / Usage

The current release is: 0.4.1 (see changelog)

Limitations / Known Issues

Future Plans

  1. Comment the code more
  2. Remove the above limitations
  3. Enhance the view cover lockscreen:
    • (done) Either modify cLock, or make a new lockscreen widget, that crams more information into the space you can see through the view cover
    • (done) Make the lockscreen, or just a fullscreen activity, come up immediately when you close the cover instead of turning the screen off and back on (this could supersede the previous point)
    • (in progress) More enhancements to the fullscreen activity; see the issues/wiki for a roadmap
  4. Add options to support other S4-specific things:
    • Keep the screen on while the camera can see your eyes
    • Air gestures? I never used them myself and don't know exactly how they work, but maybe people want them?
    • Smart scroll/pause? (see above point)
    • Other cool features that Samsung HASN'T thought of! If you have a good idea, file a feature request or, better yet, a pull request.

Hacking

This should serve as quick guide if you're trying to find your way around my code.

Happy hacking! File an issue or contact me at android@alexburka.com with any questions.