[MOD][Xposed][4.2.2+] - Wireless Charging Xposed

Search This thread

eldarerathis

Senior Member
Jun 21, 2010
159
316
I got a wireless charger for my Nexus 5 this Christmas, and was a little disappointed to learn that Android 4.2.2 added a notification sound that plays whenever a device is placed on a wireless charger, but provided no way to disable it. The reason I wanted to silence the notification is because I intend to use the charger in my bedroom, and if I'm up late the little jingle is more than likely going to wake up my wife (who would not be pleased).

Now that Lollipop has rolled out, I am no longer supporting this. I have no way to test it because I don't use Xposed anymore. Sorry. However, I'm working on getting a subset of these settings into the native Android settings instead. Once I've got that down I can post links to the relevant repos here, so that others can cherry pick the changes into their ROMs if desired.

So I decided to throw together an Xposed module to address the issue, since I couldn't find anything else that would work cleanly, and I decided to release it for anyone else who might find it useful.

The module is pretty straightforward, and it provides you with a handful of settings for wireless charging:

  1. Play the system's notification sound when you put your device on the charger
  2. Vibrate when you put your device on the charger
  3. Play a custom notification sound instead of the system one
  4. Wake the display when placing your device on or removing it from a wireless charger

You can enable these in basically any combination you want. Need total silence? Turn everything off!

Wireless Charging Xposed has only been tested on my Nexus 5 running CyanogenMod 11, but it should work on any AOSP based ROMs without issue. I don't know about other system ROMs, but it will work as long as the manufacturer didn't alter the part of AOSP that plays the notification. It does not appear to work on TouchWiz ROMs currently; I may look into this in the future if I have the time/resources, but can unfortunately provide no guarantees/ETAs.

I'm distributing the module here on XDA for now as well as in the Xposed modules repository (web link). If you think this is totally awesome or something, and you feel like "donating", I'm also putting it up on Google Play for $0.99 USD. There are zero differences between the paid version and the .apks here on XDA (i.e. the free one does not have ads). You're not obligated to pay anything if you don't want to. The Google Play page is here.

You can find the source code on my GitHub repository; it is licensed under the GPLv3: https://github.com/eldarerathis/Wireless-Charging-Xposed. Contributions are always welcome!

Feel free to leave questions or comments, and if you find a bug you can let me know in this thread. I may consider suggestions, but I make no guarantees; this is just something I put together with a few hours of spare time to fix something I found to be seriously annoying.

And of course, thank you to rovo89 for the Xposed Framework that made this doable.

Having problems?

Because of the way this module hooks into charging events, it can be a bit picky about the order that you enable things. It's something that I'm working on, but for now, make sure you perform the installation in this order:

  1. Install the module and activate it in your Xposed Installer
  2. Reboot your device
  3. Open the module's settings page and configure it however you'd like

At this point, Wireless Charging Xposed is known not to work on Samusng devices that are running TouchWiz ROMs. If you have another device with a non-AOSP ROM, your results may vary. If you think you've found a bug, please take a peek at your Xposed logs (open the Xposed Installer and tap the "Logs" item) and attach anything that might be relevant.

Changelog:
  • v1.0 - Initial release
  • v1.0.1 - Fix a suspend blocker that may have caused excess battery drain
  • v1.1 - Add the custom notification sound setting
  • v1.2 - Add the wake on charge setting; Bulgarian translations (by mamutcho)
  • v1.3 - (apk removed) Add the wake on undock setting; fix the summary text of the custom ringtone preference
  • v.1.3.1 - Fix a potential crash when trying to resolve the custom ringtone name
 
Last edited:

Kenichi

Senior Member
Jan 17, 2010
214
28
Buddha almighty! :eek: So happy! I hate the wireless charging notification with a burning passion. Thank you for the module!
 

JakeyEck

Member
Dec 31, 2013
43
8
I'm having a problem getting it to play a custom sound. It will play any stock sound that comes on the phone, but when I put sounds I download from the internet or the ZEDGE app, it will not play them. Any idea why?
 

eldarerathis

Senior Member
Jun 21, 2010
159
316
I'm having a problem getting it to play a custom sound. It will play any stock sound that comes on the phone, but when I put sounds I download from the internet or the ZEDGE app, it will not play them. Any idea why?

What type of files are they (i.e. MP3, OGG, etc) and where are they stored on your phone? I'll see if I can reproduce that when I have a chance.

I will note that the current implementation is intended to only allow you to pick things that are considered "notification sounds" by the system. The reason for that is because if you picked, say, a song file then when you put your device on the charging plate the entire song would play, with no way to stop it. That seemed like it would be kind of silly, so I write the code to support that scenario. Not saying that's what the problem is in your case, though.
 

JakeyEck

Member
Dec 31, 2013
43
8
What type of files are they (i.e. MP3, OGG, etc) and where are they stored on your phone? I'll see if I can reproduce that when I have a chance.

I will note that the current implementation is intended to only allow you to pick things that are considered "notification sounds" by the system. The reason for that is because if you picked, say, a song file then when you put your device on the charging plate the entire song would play, with no way to stop it. That seemed like it would be kind of silly, so I write the code to support that scenario. Not saying that's what the problem is in your case, though.

It may sound silly, but I wanted it to play a Mario power-up mp3 file when it was put onto the charger. It was a mp3 file I had downloaded and stored on my phone. It probably isn't considered a notification sound by Android though.

EDIT:
Well I tried it just now and it is working like I wanted it to. I'm not sure why it didn't work the first couple times.
 
Last edited:

JakeyEck

Member
Dec 31, 2013
43
8
It may sound silly, but I wanted it to play a Mario power-up mp3 file when it was put onto the charger. It was a mp3 file I had downloaded and stored on my phone. It probably isn't considered a notification sound by Android though.

EDIT:
Well I tried it just now and it is working like I wanted it to. I'm not sure why it didn't work the first couple times.

After having it for a day, it only seems to work with my downloaded mp3 file 1/5 times. I don't know what is keeping it from working all of the time.
 

eldarerathis

Senior Member
Jun 21, 2010
159
316
After having it for a day, it only seems to work with my downloaded mp3 file 1/5 times. I don't know what is keeping it from working all of the time.

Just out of curiosity, was your phone close to fully charged when you were testing this? I noticed the other day that the system doesn't fire the "charging began" event if your battery level is above a certain threshold (looks like 95% in AOSP). My assumption is that this is so that it won't notify you constantly once it hits 100%, because the charging circuit probably cuts out at that point, lets the battery drain a little bit, then bumps it back up to 100 (and repeats that cycle).
 

sgp77

Senior Member
Aug 25, 2012
66
14
For what it's worth, I'm having trouble getting it to play any custom sound, even stock Android sounds. It does mute things nicely, though :)

Before installing this module, I noticed that the charging sound would frequently get clipped (cut off in the middle). Not sure if that's related. I also have Gravity Box installed, so it could be a conflict.
 

kamaliqwan

Senior Member
Jun 17, 2011
667
67
Kuala Lumpur
www.facebook.com
this is a very useful mod..
but still not complete.. hahaha
can add more features?

i have problem with overheated on custom roms/kernels.. not all but few of it.. sometimes im worried if my device is overheating and i have to keep unlocking my phone to see the temperature - thanks to dashclock battery extension :)
i still couldn't find any app to enable sound notification.. LED notification is not enough..

so can u add enabling notification if device is overheat? :cowboy:

anyway thanks a lot for this!! great work man! :good:
 

Gu$houn*

Senior Member
Dec 10, 2010
879
430
Prague
@eldarerathis
Huge THANKS for this mod and confirmation of functionality on purity 14/12. :good:
ugyjyzy2.jpg

P.
[sntfrmnxs4]
 

dtreth

Senior Member
Dec 12, 2013
59
20
I got a wireless charger for my Nexus 5 this Christmas, and was a little disappointed to learn that Android 4.2.2 added a notification sound that plays whenever a device is placed on a wireless charger, but provided no way to disable it. The reason I wanted to silence the notification is because I intend to use the charger in my bedroom, and if I'm up late the little jingle is more than likely going to wake up my wife (who would not be pleased).

So I decided to throw together an Xposed module to address the issue, since I couldn't find anything else that would work cleanly, and I decided to release it for anyone else who might find it useful.

Love it, but the vibrate option doesn't work on my Droid MAXX, rooted and Xposed but stock beyond that. I can send you any data you need.
 
  • Like
Reactions: livinitwarrior

kalowski

New member
Mar 7, 2008
2
0
wireless charging sound

I have wireless charging installed and xposed but it plays no sound.no mp3 no stock sound nothing.want can i do?
 

eldarerathis

Senior Member
Jun 21, 2010
159
316
For what it's worth, I'm having trouble getting it to play any custom sound, even stock Android sounds. It does mute things nicely, though :)

Before installing this module, I noticed that the charging sound would frequently get clipped (cut off in the middle). Not sure if that's related. I also have Gravity Box installed, so it could be a conflict.

I noticed the clipping and some other aberrations on CM without any kind of Xposed modifications, so I'm wondering if it's something in the system that's causing it. I'm hoping that's not it, but if it is then I'm not sure if I can fix it :(

Love it, but the vibrate option doesn't work on my Droid MAXX, rooted and Xposed but stock beyond that. I can send you any data you need.

Can you take a look at the Xposed logs and see if there's anything unusual? Just tap the "Logs" item on the Xposed Installer's main screen and check the most recent entries at the bottom. Also, does the sound work, or is that busted too?


I have wireless charging installed and xposed but it plays no sound.no mp3 no stock sound nothing.want can i do?

I guess first would be some general troubleshooting, like checking to make sure your system volume isn't muted or anything. Does it play the sound without the module installed, completely stock? Is your battery below 95% when you start charging it?
 

eldarerathis

Senior Member
Jun 21, 2010
159
316
Anyone having difficulty with custom sound files:

I can't reproduce the problem on my N5, but I re-implemented the piece of code that does the playback to use a different method. A test build of the .apk is attached to this post, so give it a try and see if it makes a difference. You may need to toggle the custom sound option off and then back on again before the first time you try.

If it doesn't work, check your Xposed logs and see if there is anything there. It should write some information if the playback fails due to an exception or error. If there's nothing there and it doesn't work, then let me know:

  1. What kind of phone you have
  2. What version of Android you have
  3. What ROM you're using (or "stock", if you're not using a custom one)

...and I'll see if I can figure out what's going on.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 31
    I got a wireless charger for my Nexus 5 this Christmas, and was a little disappointed to learn that Android 4.2.2 added a notification sound that plays whenever a device is placed on a wireless charger, but provided no way to disable it. The reason I wanted to silence the notification is because I intend to use the charger in my bedroom, and if I'm up late the little jingle is more than likely going to wake up my wife (who would not be pleased).

    Now that Lollipop has rolled out, I am no longer supporting this. I have no way to test it because I don't use Xposed anymore. Sorry. However, I'm working on getting a subset of these settings into the native Android settings instead. Once I've got that down I can post links to the relevant repos here, so that others can cherry pick the changes into their ROMs if desired.

    So I decided to throw together an Xposed module to address the issue, since I couldn't find anything else that would work cleanly, and I decided to release it for anyone else who might find it useful.

    The module is pretty straightforward, and it provides you with a handful of settings for wireless charging:

    1. Play the system's notification sound when you put your device on the charger
    2. Vibrate when you put your device on the charger
    3. Play a custom notification sound instead of the system one
    4. Wake the display when placing your device on or removing it from a wireless charger

    You can enable these in basically any combination you want. Need total silence? Turn everything off!

    Wireless Charging Xposed has only been tested on my Nexus 5 running CyanogenMod 11, but it should work on any AOSP based ROMs without issue. I don't know about other system ROMs, but it will work as long as the manufacturer didn't alter the part of AOSP that plays the notification. It does not appear to work on TouchWiz ROMs currently; I may look into this in the future if I have the time/resources, but can unfortunately provide no guarantees/ETAs.

    I'm distributing the module here on XDA for now as well as in the Xposed modules repository (web link). If you think this is totally awesome or something, and you feel like "donating", I'm also putting it up on Google Play for $0.99 USD. There are zero differences between the paid version and the .apks here on XDA (i.e. the free one does not have ads). You're not obligated to pay anything if you don't want to. The Google Play page is here.

    You can find the source code on my GitHub repository; it is licensed under the GPLv3: https://github.com/eldarerathis/Wireless-Charging-Xposed. Contributions are always welcome!

    Feel free to leave questions or comments, and if you find a bug you can let me know in this thread. I may consider suggestions, but I make no guarantees; this is just something I put together with a few hours of spare time to fix something I found to be seriously annoying.

    And of course, thank you to rovo89 for the Xposed Framework that made this doable.

    Having problems?

    Because of the way this module hooks into charging events, it can be a bit picky about the order that you enable things. It's something that I'm working on, but for now, make sure you perform the installation in this order:

    1. Install the module and activate it in your Xposed Installer
    2. Reboot your device
    3. Open the module's settings page and configure it however you'd like

    At this point, Wireless Charging Xposed is known not to work on Samusng devices that are running TouchWiz ROMs. If you have another device with a non-AOSP ROM, your results may vary. If you think you've found a bug, please take a peek at your Xposed logs (open the Xposed Installer and tap the "Logs" item) and attach anything that might be relevant.

    Changelog:
    • v1.0 - Initial release
    • v1.0.1 - Fix a suspend blocker that may have caused excess battery drain
    • v1.1 - Add the custom notification sound setting
    • v1.2 - Add the wake on charge setting; Bulgarian translations (by mamutcho)
    • v1.3 - (apk removed) Add the wake on undock setting; fix the summary text of the custom ringtone preference
    • v.1.3.1 - Fix a potential crash when trying to resolve the custom ringtone name
    3
    I got a wireless charger for my Nexus 5 this Christmas, and was a little disappointed to learn that Android 4.2.2 added a notification sound that plays whenever a device is placed on a wireless charger, but provided no way to disable it. The reason I wanted to silence the notification is because I intend to use the charger in my bedroom, and if I'm up late the little jingle is more than likely going to wake up my wife (who would not be pleased).

    So I decided to throw together an Xposed module to address the issue, since I couldn't find anything else that would work cleanly, and I decided to release it for anyone else who might find it useful.

    The module is pretty straightforward, and it provides you with a handful of settings for wireless charging:

    1. Play the system's notification sound when you put your device on the charger
    2. Vibrate when you put your device on the charger
    3. Play a custom notification sound instead of the system one
    4. Wake the display when placing your device on or removing it from a wireless charger

    You can enable these in basically any combination you want. Need total silence? Turn everything off!

    Wireless Charging Xposed has only been tested on my Nexus 5 running CyanogenMod 11, but it should work on any AOSP based ROMs without issue. I don't know about other system ROMs, but it will work as long as the manufacturer didn't alter the part of AOSP that plays the notification. It does not appear to work on TouchWiz ROMs currently; I may look into this in the future if I have the time/resources, but can unfortunately provide no guarantees/ETAs.

    I'm distributing the module here on XDA for now as well as in the Xposed modules repository (web link). If you think this is totally awesome or something, and you feel like "donating", I'm also putting it up on Google Play for $0.99 USD. There are zero differences between the paid version and the .apks here on XDA (i.e. the free one does not have ads). You're not obligated to pay anything if you don't want to. The Google Play page is here.

    You can find the source code on my GitHub repository; it is licensed under the GPLv3: https://github.com/eldarerathis/Wireless-Charging-Xposed. Contributions are always welcome!

    Feel free to leave questions or comments, and if you find a bug you can let me know in this thread. I may consider suggestions, but I make no guarantees; this is just something I put together with a few hours of spare time to fix something I found to be seriously annoying.

    And of course, thank you to rovo89 for the Xposed Framework that made this doable.

    Having problems?

    Because of the way this module hooks into charging events, it can be a bit picky about the order that you enable things. It's something that I'm working on, but for now, make sure you perform the installation in this order:

    1. Install the module and activate it in your Xposed Installer
    2. Reboot your device
    3. Open the module's settings page and configure it however you'd like

    At this point, Wireless Charging Xposed is known not to work on Samusng devices that are running TouchWiz ROMs. If you have another device with a non-AOSP ROM, your results may vary. If you think you've found a bug, please take a peek at your Xposed logs (open the Xposed Installer and tap the "Logs" item) and attach anything that might be relevant.

    Changelog:
    • v1.0 - Initial release
    • v1.0.1 - Fix a suspend blocker that may have caused excess battery drain
    • v1.1 - Add the custom notification sound setting
    • v1.2 - Add the wake on charge setting; Bulgarian translations (by mamutcho)
    • v1.3 - (apk removed) Add the wake on undock setting; fix the summary text of the custom ringtone preference
    • v.1.3.1 - Fix a potential crash when trying to resolve the custom ringtone name

    "I'm distributing the module here on XDA for now as well as in the Xposed modules repository (web link). If you think this is totally awesome or something, and you feel like "donating", I'm also putting it up on Google Play for $0.99 USD. There are zero differences between the paid version and the .apks here on XDA (i.e. the free one does not have ads). You're not obligated to pay anything if you don't want to. The Google Play page is here."

    This statement/stance/business model/free market alone, is worth the donation 10 times over, if i get in a position to need this i hope i have the forsight to remember this great approach.......automatic donation.......plus, nice mod
    3
    View attachment 2511956 I get this notice on 1.3. I rebooted. I even un-installed and re installed. Any suggestions?

    Bah, made a stupid mistake in the code that tries to resolve the name of custom ringtones. It was choking on the URI of the system ringtone. A 1.3.1 build is posted now (here and on the Xposed repo/Google Play) that should fix the issue. I also removed 1.3 from the OP.

    Sorry about that!
    2
    Any chance of adding an option to have the device treat the wireless charger as a dock. So that, for example, daydream could be set to activate in dock mode when my device is wirelessly charging on my desk, but not when it is plugged in at night.

    That's an interesting idea. I don't know a whole lot about how devices determine when they're in dock mode, but I could look into it.

    Hi!

    The mod works fine with my nexus 4 on rooted stock (4.4.2).

    I have activated screen on when charging, but there's only one thing that disturbs me.
    Before I go to bed I put my phone on the charger, the screen on to tell it's on charge => great!
    But during the night, the phone get's fully charged, charging goes off, the battery begins to discharge, after a few seconds charging goes on, and the screen goes on... and it awakes me!
    And so on during the whole night...

    Would it be possible to add a parameter so that the screen doesn't go on if the charge is over 99℅ for example?

    Thanks!

    --
    Steph

    This is an idea I've actually started playing with a bit, and I'm working to implement. Originally I was looking to make the app always trigger the notifications, regardless of battery level, because it makes it easier to test things (otherwise I have to let my battery run down a bit; it won't trigger above a certain percentage). Ultimately I ended up creating a "notification threshold" concept, where you could define how low your battery level needs to be in order for the notifications to trigger. It's still buggy right now, but once I get it ironed out, you'd be able to set the threshold at, say, 90% so that the little bounces between 98-100 won't fire any of the notifications.

    RE: the various people with Samsung devices - I would like to get this working for you, but it might be a bit of a slow process since I don't have readily accessible Samsung devices that support wireless charging. I'll be sure to keep you posted in this thread if I make any good progress, though.
    2
    A new version (1.2) has been added to the OP, and will be going up on Google Play/Xposed shortly. It adds a "Wake on Charge" option. Enabling this (default behavior) will cause the display to turn on when you start charging your device. Disabling it will cause the display to remain off. There are also Bulgarian translations added to the app, courtesy of mamutcho.