FORUMS

[MOD][XPOSED][5.x+] Magnet Sensor Control - disable magnetic sensor sleep/wake

692 posts
Thanks Meter: 92
 
By crackers8199, Senior Member on 18th January 2016, 09:50 PM
Post Reply Email Thread
this xposed module is based on the MagnetOff module built by XDA use dubidu - however, that module was broken as of android 6.0. since dubidu has not contributed on the forums in a few months, i decided to write my own version of this module that works for both android 5.x as well as 6.x. i did not use any of dubidu's code (since it's not open source as far as i can see), but i do give full credit for the idea and where to look to disable the sensor (based on reading the thread related to that module).

this is confirmed working on nexus 6, both 5.1.1 (by myself) and 6.0.1 (by xda member porkisyummy). as far as i can see, it should work on any nexus device (and probably others as well)...but of course i can't confirm that and am not responsible if you break your phone trying to use this module.

changelog:

v1.0 (1/18/2016):
- initial release

v1.1 (1/18/2016):
- bug fixes

dubidu's MagnetOff module thread: http://forum.xda-developers.com/showthread.php?t=2621807

XDA:DevDB Information
Magnet Sensor Control, Xposed for the Nexus 6

Contributors
crackers8199, dubidu
Xposed Package Name:

Version Information
Status: Stable
Current Stable Version: 1.0
Stable Release Date: 2016-01-18

Created 2016-01-18
Last Updated 2016-01-19
The Following 16 Users Say Thank You to crackers8199 For This Useful Post: [ View ] Gift crackers8199 Ad-Free
19th January 2016, 08:54 AM |#3  
jaibar's Avatar
Senior Member
Flag Underwater, no Sh!t
Thanks Meter: 1,053
 
More
Oh, this is great!

I am suffering from the magnetic car mount havoc 🤕 (nexus 5).

Going to test it on next drive

[EDIT] Works great. However, could be nice to have a minimal user interface with a master switch. Thus, one can readily switch it on/off (for the sake of people who want to use magnetic cover, and turn on the module at will). At the present, one needs to enable/disable the module in xposed installer, then reboot..


Sent from my Nexus 5 using Tapatalk
19th January 2016, 09:39 AM |#4  
Senior Member
Thanks Meter: 40
 
More
Thank you very much, it would be useful to choose to activate sensor for sleep or wake

Sent from my Nexus 6 using Tapatalk
19th January 2016, 12:15 PM |#5  
Junior Member
Flag Ann Arbor, MI
Thanks Meter: 4
 
More
Thanks again for taking this project on! I tested it out on my drive home last night and was very pleased. I did notice one issue--when the screen turns off, the power button doesn't turn the screen back on while a magnet is present.

I can imagine that this might have been a problem with the original MagnetOff module as well. It seems that in addition to hooking into lid close events, hooks on power button events might be necessary as well. If you're willing to share source I'd be happy to contribute. Otherwise, I can look at the OS source and try to suggest changes.



[EDIT: to clarify, these issues were with the first release. I re-tested with the latest release and can confirm the power button works correctly when docked to a magnet.]
19th January 2016, 01:11 PM |#6  
Senior Member
Thanks Meter: 110
 
More
This might be stupid but does it save battery to turn it off?
19th January 2016, 03:19 PM |#7  
kalhimeo's Avatar
Inactive Recognized Developer
Flag Brussels
Thanks Meter: 34
 
More
Hi crackers,

Thank you very much for taking over with the development of this xposed module !

Is there any chance you can have a look why it's not working with the Galaxy S4 Google Play Edition (LP 5.1) ? Let me know if I can help anyhow.

Best regards,
Laurent
19th January 2016, 04:28 PM |#8  
Senior Member
Thanks Meter: 80
 
More
Hi,

works perfectly on Nexus 6P with latest firmware installed.
Just hope the magnet I'm using is not to strong to destroy something in the phone
19th January 2016, 04:37 PM |#9  
jaibar's Avatar
Senior Member
Flag Underwater, no Sh!t
Thanks Meter: 1,053
 
More
Quote:
Originally Posted by tbv2005

Hi,

works perfectly on Nexus 6P with latest firmware installed.
Just hope the magnet I'm using is not to strong to destroy something in the phone

Part of my research is in MRI environment, so over time I had the pleasure to put lots of cellphones into b rather strong magnetic fields (somewhere between 1.5-3 Tesla).

Surprisingly, they seem to survive mostly without noticeable damage. In an old Nokia 3210 I managed to get the speaker fubered. Other than that, I can't recall any other damages.

Sent from my Nexus 5 using Tapatalk
The Following User Says Thank You to jaibar For This Useful Post: [ View ] Gift jaibar Ad-Free
19th January 2016, 04:41 PM |#10  
OP Senior Member
Thanks Meter: 92
 
Donate to Me
More
Quote:
Originally Posted by piraboy

Thank you very much, it would be useful to choose to activate sensor for sleep or wake

Sent from my Nexus 6 using Tapatalk

that's already on my to-do list, in fact i started working on it last night. no ETA, though...

Quote:
Originally Posted by porkisyummy

Thanks again for taking this project on! I tested it out on my drive home last night and was very pleased. I did notice one issue--when the screen turns off, the power button doesn't turn the screen back on while a magnet is present.

I can imagine that this might have been a problem with the original MagnetOff module as well. It seems that in addition to hooking into lid close events, hooks on power button events might be necessary as well. If you're willing to share source I'd be happy to contribute. Otherwise, I can look at the OS source and try to suggest changes.



[EDIT: to clarify, these issues were with the first release. I re-tested with the latest release and can confirm the power button works correctly when docked to a magnet.]

i know you've seen the newest version fixes this, but i wanted to chime in that's actually one of the first things i noticed on my first drive with this active. came home and found the other function i needed to hook to fix that, and voila...tested again on my trip to the store last night and saw no issues at all. seemed to be working flawlessly...

Quote:
Originally Posted by kalhimeo

Hi crackers,

Thank you very much for taking over with the development of this xposed module !

Is there any chance you can have a look why it's not working with the Galaxy S4 Google Play Edition (LP 5.1) ? Let me know if I can help anyhow.

Best regards,
Laurent

the GPE phones use AOSP with no modifications, right? or are there still some tweaks samsung puts into the code? what build are you on?
The Following User Says Thank You to crackers8199 For This Useful Post: [ View ] Gift crackers8199 Ad-Free
19th January 2016, 04:51 PM |#11  
OP Senior Member
Thanks Meter: 92
 
Donate to Me
More
Quote:
Originally Posted by xk0niR

This might be stupid but does it save battery to turn it off?

to turn off the sensor? i'm not sure (that isn't really the point of the module)...this is more to stop the screen from going crazy when using a magnetic car mount.
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes