Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,733,293 Members 39,058 Now Online
XDA Developers Android and Mobile Development Forum

Wireless Charger Detector -- Orb

Tip us?
 
bobaka
Old
(Last edited by bobaka; 27th September 2013 at 10:50 PM.) Reason: add
#31  
Member
Thanks Meter 1
Posts: 69
Join Date: Dec 2007
For me the problem only occurs if the phone is left on the charger once it is fully charged.

If I leave it on the charger when full it will stay awake and drain quickly. Example 30% drain in 10 hrs (overnight).
And the charger never comes back on.

If I charge it again and take it off the charger when it's fully charged, the battery drain will be only 3-5% in 10 hrs.
And the awake time will be very low. And battery usage over the next day(s) doesn't seem to be abnormal.
And I don't have to restart the phone to get this result even if I've previously left it on the charger overnight and
seen the excessive drain.

So this seems to be a problem being a result of the phone detecting the presence of the wireless
charger and remaining awake as a result.

The wakelock that seems to be the culprit is suspend_backoff

This wouldn't be a problem if it the charger came back on at say 80% but it does not.
And it wouldn't be a problem if the phone didn't stay 'awake' but it does.

There doesn't seem to be any point in being aware there's a wireless charger present if charging is
never going to restart no matter how low the battery goes, or in staying away because there's a charger
present that's never going to be utilized.

I'm not an android programmer but perhaps some of you who know more about how it's working could see
a way to work around this.

For now the workaround is to take the phone off the charger before going to bed and the convenience of
the wireless charger is worth it, but it would obviously be better if you could just leave it on the charger and not worry about it.

My phone is Nexus 4 purchased new in September. came with 4.2.. ota update to 4.3. stock. no root (yet)
I'm using a generic Qi charger purchased on ebay for around $22
I'm still using Safe Charge while charging.
Haven't had a chance to try the same routines without it yet.
 
dzo
Old
(Last edited by dzo; 28th September 2013 at 01:37 PM.)
#32  
dzo's Avatar
Senior Recognized Developer
Thanks Meter 4641
Posts: 2,208
Join Date: Apr 2008
Location: Auckland

 
DONATE TO ME
Attached is a new version of my app and it certainly works for me. The previous version didn't always trigger when you lifted it off the charger.
My nexus 4 has been running it for the last 10 days, wireless charging every night and the wakelock is not held except during charging, see attached screenshot.
Attached Thumbnails
Click image for larger version

Name:	Screenshot_2013-09-29-00-29-28.jpg
Views:	295
Size:	40.5 KB
ID:	2288515  
Attached Files
File Type: apk Nexus4WirelessChargingFix-release.apk - [Click for QR Code] (27.4 KB, 183 views)
The Following 3 Users Say Thank You to dzo For This Useful Post: [ Click to Expand ]
 
mangoman
Old
#33  
Senior Member
Thanks Meter 18
Posts: 302
Join Date: Dec 2006
So, for this you would need a charger that trickle charge? Once my phone is charged it stops charging then eats up battery.

Stupid question but how can i check it does its job?
Attached Thumbnails
Click image for larger version

Name:	w.pngakelock.jpg
Views:	148
Size:	33.9 KB
ID:	2289022  
 
fluffysaw
Old
#34  
Junior Member
Thanks Meter 1
Posts: 2
Join Date: Mar 2011
affected +1
@cm10.1.3 stable (4.2.2)
 
gbarayah
Old
#35  
gbarayah's Avatar
Senior Member
Thanks Meter 140
Posts: 931
Join Date: Dec 2009
Location: California
Quote:
Originally Posted by dzo View Post
Attached is a new version of my app and it certainly works for me. The previous version didn't always trigger when you lifted it off the charger.
My nexus 4 has been running it for the last 10 days, wireless charging every night and the wakelock is not held except during charging, see attached screenshot.
Thanks - been running the app for the last two days - so far, so good!
LG Nexus 5
ROM: Stock 4.4.2 KOT49H
Kernel: Stock


Retired:
Nexus 4
Samsung Galaxy Nexus
HTC Flyer
HTC Sensation
Kindle Fire
Motorola XT860
HTC Desire Z
HTC Fuze
BB 8100, 8900, 9000
Nokia E71
 
dzo
Old
#36  
dzo's Avatar
Senior Recognized Developer
Thanks Meter 4641
Posts: 2,208
Join Date: Apr 2008
Location: Auckland

 
DONATE TO ME
Quote:
Originally Posted by gbarayah View Post
Thanks - been running the app for the last two days - so far, so good!
Glad it's useful to you.

I found that sometimes the wakelock doesn't get released so I updated the app to make sure it always releases it.

The new version is attached, I've also put the source on github:

https://github.com/dzo/Nexus4WirelessChargingFix
Attached Files
File Type: apk Nexus4WirelessChargingFix-release.apk - [Click for QR Code] (27.4 KB, 125 views)
The Following 9 Users Say Thank You to dzo For This Useful Post: [ Click to Expand ]
 
Lush78
Old
#37  
Lush78's Avatar
Senior Member
Thanks Meter 265
Posts: 330
Join Date: Dec 2011
Just testing your latest fix... Will post results. My problem is that I flash new ROM updates nearly daily... Will this fix survive a dirty flash update? Does it survive a normal reboot?
 
dzo
Old
#38  
dzo's Avatar
Senior Recognized Developer
Thanks Meter 4641
Posts: 2,208
Join Date: Apr 2008
Location: Auckland

 
DONATE TO ME
Yes to both those. It only runs when charging state changes so if it's installed it will work.

Sent from my Nexus 7 using xda app-developers app
My Camera App:
The Following 2 Users Say Thank You to dzo For This Useful Post: [ Click to Expand ]
 
Lush78
Old
#39  
Lush78's Avatar
Senior Member
Thanks Meter 265
Posts: 330
Join Date: Dec 2011
The wireless charger detector has kept my phone awake since this morning... I dirty flashed an AOKP update (wiped cache and dalvik) yesterday and did nothing with the fix app... Pulled of my wireless charger ~5 hours ago and it hasn't deep slept yet....
 
dzo
Old
#40  
dzo's Avatar
Senior Recognized Developer
Thanks Meter 4641
Posts: 2,208
Join Date: Apr 2008
Location: Auckland

 
DONATE TO ME
Quote:
Originally Posted by Lush78 View Post
The wireless charger detector has kept my phone awake since this morning... I dirty flashed an AOKP update (wiped cache and dalvik) yesterday and did nothing with the fix app... Pulled of my wireless charger ~5 hours ago and it hasn't deep slept yet....
Try running the app and hitting the button, does that help?

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes