Root cause for Gear 2 high battery consumption found, at least for non-Samsung phones

Search This thread

aiu

Senior Member
Oct 26, 2008
54
3
Bucharest
Hi,

After installing the service battery drain is well better but I cannot figure out how to sync my favorites after adding a contact and also the logs seems not to sync at all. Does anybody else seen this?

Thanks,
Alex.
 

aiu

Senior Member
Oct 26, 2008
54
3
Bucharest
After multiple tests I come to the conclusion that with the service enabled the logs and contacts will not sync at all, ever. In order to get the logs and contacts to sync again you need to remount / rw and then disable the service with systemctl and reboot. Afterwards the sync works fine but the battery drain is of course back. Does anybody have an idea on how to keep the gear syncing without affecting the battery life? Is this behavior something expected or it is just my gear? Thanks in advance for any reply.
 

Skin1980

Inactive Recognized Developer
Nov 25, 2009
2,490
6,233
After multiple tests I come to the conclusion that with the service enabled the logs and contacts will not sync at all, ever. In order to get the logs and contacts to sync again you need to remount / rw and then disable the service with systemctl and reboot. Afterwards the sync works fine but the battery drain is of course back. Does anybody have an idea on how to keep the gear syncing without affecting the battery life? Is this behavior something expected or it is just my gear? Thanks in advance for any reply.

I have an LG G3 and my contacts are sync. Cannot help with call logs since it never worked for me, also with stock.
 

aiu

Senior Member
Oct 26, 2008
54
3
Bucharest
Hi mpogr,

First thanks a lot for all your work. Using the root/service method on the Gear 2 for me didn't work well because I was unable to sync contacts or logs anymore. I decided to flash stock back on Gear 2 and downgrade GM to 2.1.14052101 and use the goproviders apk you provided specially for this version of GM. Now battery drain is great, logs sync well but contacts will not sync again. If I manually try to sync them from the Gear 2 side it says Syncing for a while and then it stops without really syncing them. Do you have any suggestions on how to sync the contacts in this scenario?

Again thanks a lot for all your great work!
 

mpogr

Senior Member
Jan 16, 2008
185
63
Melbourne
Hi mpogr,

First thanks a lot for all your work. Using the root/service method on the Gear 2 for me didn't work well because I was unable to sync contacts or logs anymore. I decided to flash stock back on Gear 2 and downgrade GM to 2.1.14052101 and use the goproviders apk you provided specially for this version of GM. Now battery drain is great, logs sync well but contacts will not sync again. If I manually try to sync them from the Gear 2 side it says Syncing for a while and then it stops without really syncing them. Do you have any suggestions on how to sync the contacts in this scenario?

Again thanks a lot for all your great work!
What device do you have? On non-Samsung devices only contacts would synchronise anyway... If you have Samsung, why would you use these fixes anyway?
 

aiu

Senior Member
Oct 26, 2008
54
3
Bucharest
What device do you have? On non-Samsung devices only contacts would synchronise anyway... If you have Samsung, why would you use these fixes anyway?

Galaxy S5. As you wondered in the OP the problem exists even on Samsung devices. My Gear 2 drains a full battery in 8h without your mod. A friend of mine with a Note 3 has experienced the same.

Anyway how should contacts sync be affected by using your goproviders?

Again thanks for your great work.
 

mpogr

Senior Member
Jan 16, 2008
185
63
Melbourne
Galaxy S5. As you wondered in the OP the problem exists even on Samsung devices. My Gear 2 drains a full battery in 8h without your mod. A friend of mine with a Note 3 has experienced the same.

Anyway how should contacts sync be affected by using your goproviders?

Again thanks for your great work.
Look, what goproviders fix does it just dilutes the sync logic invocations 1:256 (in the latest version). Also, I didn't create that fix for the latest versions of Gear Manager, so using the modded goproviders with those is not recommended and could break all sorts of things. I don't really know why the fix on the Gear doesn't work for you though. After connecting the Gear to the phone, there is typically enough time for the contacts to synchronise, even just once. The sync process is killed every 2 minutes, so it's a matter of luck. But, if you attempt several times (just disconnect/reconnect the Gear with the phone), it should work.
 

aiu

Senior Member
Oct 26, 2008
54
3
Bucharest
Look, what goproviders fix does it just dilutes the sync logic invocations 1:256 (in the latest version). Also, I didn't create that fix for the latest versions of Gear Manager, so using the modded goproviders with those is not recommended and could break all sorts of things. I don't really know why the fix on the Gear doesn't work for you though. After connecting the Gear to the phone, there is typically enough time for the contacts to synchronise, even just once. The sync process is killed every 2 minutes, so it's a matter of luck. But, if you attempt several times (just disconnect/reconnect the Gear with the phone), it should work.

I am using goproviders with the corresponding older version of GM just as you recommended. I think it works ok now. How often is 1:254? I don't know the original behaviour so I cannot calculate it.
 

mpogr

Senior Member
Jan 16, 2008
185
63
Melbourne
I am using goproviders with the corresponding older version of GM just as you recommended. I think it works ok now. How often is 1:254? I don't know the original behaviour so I cannot calculate it.
It's hard to tell, because the frequency of the sync doesn't seem to be constant. It's probably about once in 1-2 hours.
 

GSBJackson

Member
Aug 20, 2003
25
5
Found my root cause. Had over 9,000 duplicate entries in my corporate contact list. Once deleted, now I can go all day with battery at 90%.

Running latest version from Samsung.

Sent from my SM-G900V using XDA Free mobile app
 

vinny.1967

Senior Member
Jan 26, 2010
170
18
Egg Harbor Twp.
To make kill_contacts permanent, you can create service so that it will automatically start on reboot

Code:
[Unit]
Description=Automatically Kill Contacts Every 2 Minutes

[Service]
ExecStart=/sbin/kill_contacts

[Install]
WantedBy=multi-user.target

push this file to /etc/systemd/system
change mod to 644
enable service
start service
Code:
c:\sdb root on
c:\sdb push kill_contacts.service /etc/systemd/system
c:\sdb shell
sh-3.2#chmod 644 /etc/systemd/system/kill_contacts.service
sh-3.2#systemctl enable /etc/systemd/system/kill_contacts.service
sh-3.2#systemctl start kill_contacts.service

check running service using :
Code:
journalctl -u kill_contacts.service

Hi wiedz, sorry to bothering you I'm very new to this but how do you create kill_contacts.service file?
thanx
 

JazonX

Senior Member
Edit: with new Gear Manager (Jun release), this method doesn't work anymore. The new approach is to install a "contact synchroniser killer" app on the rooted watch. More details are in this post.


Hi, Can I know the last version (Version Number if possible) of Gear Manager that worked with the modded GoProviders.APK Mate?
I'm on Galaxy Note 3, with Gear 1 (Null)

Thanks!
 

jazzdoctor

New member
Jun 26, 2014
3
0
New York
Help!!!!!

OK, the handler I updated in the 2 previous fixes didn't change from the previous version of "goproviders", so I hoped I could just use the same .class file, DEX it, stick into an APK, sign and be done with it. Unfortunately, it looks some other logic has changed, so now the same fix doesn't work anymore.
So I started investigating the other end, that is, the watch. The major difference is now we have ROOT on the Gear, so why not use it?
I quickly figured out that the offending process on the watch side was "w-contacts2-consumer". Apparently, if you just kill it, this stops Contact synchronisation only, while Contacts app on the watch remains fully functional. Unfortunately, this process is respawned every time Bluetooth connection is reestablished between the the phone and the watch.
I was looking for "cron" for Tizen, hoping to put "pkill" into a recurring task that'd run every couple of minutes. Unfortunately, I couldn't find "cron" on the watch, and the version of busybox suggested in one of the threads on this forum doesn't have it precompiled.
Then I thought: why the heck can't I just write a small app (command line) that would literally just do this:
Code:
while(1)
{
	system("pkill w-contacts2");
	sleep(120);
}
After a bit of playing around with Tizen SDK, I managed to produce this executable (attached). You can put it into /sbin, making sure permissions are 755. One last thing is to make it run as a service:
Code:
systemd-run --unit=kill_contacts.nonsamsung --description="Automatically Kill Contacts Every 2 Minutes" /sbin/kill_contacts
I don't think it'll survive a reboot though, I'll get it sorted later.

Now battery consumption is back to normal, and contacts get synchronised every time the watch connects to the phone, which is more than fine with me.
I really appreciated the GoProviders fix....now back to the same 12hr to dead Gear2 paired with Samsung Note3...any thoughts as to how I can address this...I work in a Mac/Apple environment . Not sure if that program functions on the Mac. Any direction would be greatly appreciated. Thanks!!!
 

mpogr

Senior Member
Jan 16, 2008
185
63
Melbourne
I switched to using TizenMod 3.0 Gear 2 ROM, which has the fix already built in, and never looked back ever since...
 

jazzdoctor

New member
Jun 26, 2014
3
0
New York
Tizen sounds great....but....

I switched to using TizenMod 3.0 Gear 2 ROM, which has the fix already built in, and never looked back ever since...
Where do you find this? Sorry for the ignorance!!!

---------- Post added at 12:57 AM ---------- Previous post was at 12:44 AM ----------

I switched to using TizenMod 3.0 Gear 2 ROM, which has the fix already built in, and never looked back ever since...

Specifically can I do this with a mac?
 

yulaw5110

Member
Jan 31, 2013
17
1
Dublin
i had a note 3 got the note 4 having the same issue with both . got the watch good while ago and was getting maybe 3 days out of the watch battery . then started to get this error message saproviders has stopped thats when i started to get 30 40 % watch drain in 2 to 3 hours very annoying
 

Top Liked Posts

  • There are no posts matching your filters.
  • 19
    Edit: with new Gear Manager (Jun release), this method doesn't work anymore. The new approach is to install a "contact synchroniser killer" app on the rooted watch. More details are in this post.

    ==================================================================================================================================================================================

    Hi all,

    Ever since I started using my Gear 2 Neo with my HTC One M8 phone (using the guide in this forum), I noticed that my watch consumes battery significantly faster than most of the users have been reporting. Even more strangely, sometimes after resetting both the phone and the watch (and I've done this a lot while experimenting and trying to get more stuff working) I had streaks of stellar battery life, well in line with optimistic reports here and elsewhere, but then, after a while, it started deteriorating very quickly.

    So I decided it was time to do something about it. I installed Tizen SDK, hooked the watch up and started poking around. The first thing I noticed my watch CPU was, most of the time, sitting on 40%! Well, that doesn't sound right, does it? Then I noticed the log (located under /var/log/dlog_main) was full with messages related to contact synchronisation. It turns out the damn thing synchronises all of my contacts every several seconds. The trouble is I have well over 1500 contacts (that's consolidated from different sources, the number of raw contacts should be well over 3000). So it takes significant time to do this, meaning my watch (and the phone!) are thrashed by these stupid full contact syncs all the time! What's even more striking is the fact it doesn't help when I change it to "favourites only". Apparently, this affects only the contacts displayed on the watch, however, the sync process still takes all of them.

    At this point I started poking around Samsung APK files to try and understand what was going on. Apparently, the APK responsible for contact sync is called GOPROVIDERS. Indeed, if you kill it, the thrashing stops, however, other important functions cease working as well. Aside of Contacts vanishing from the Gear, "Find my phone" is gone as well, but, more importantly, notifications stop working. While I could tolerate the first two, the last one was too much to give up.

    I started decompiling and analysing sources. Apparently, there is a process running every several seconds that analyses if any changes have been made to the contacts. It uses pretty bizarre logic which seems to be relying on Samsung-specific fields in the contacts. Now, this already sounds suspicious, and, apparently, leads to full sync every several seconds. Obviously, the more contacts you have, the harder you're hit.

    An interesting point in all this is that I'm not 100% sure the logic is working properly even on Samsung devices, so it might well be that the same issue is affecting people with high number of contacts using Samsung phones as well. I'd be really interested to see any feedbacks regarding this.

    So, long story short, instead of fixing the logic (which is quite difficult in SMALI), I made a simple change which dilutes this logic invocations, right now 1:64. Since then I'm enjoying MUCH improved battery life.

    The fixed APK is attached. You're welcome to give it a try at your own risk (you need to enable installation from untrusted sources + reboot and clean dalvik cache).
    6
    New approach

    OK, the handler I updated in the 2 previous fixes didn't change from the previous version of "goproviders", so I hoped I could just use the same .class file, DEX it, stick into an APK, sign and be done with it. Unfortunately, it looks some other logic has changed, so now the same fix doesn't work anymore.
    So I started investigating the other end, that is, the watch. The major difference is now we have ROOT on the Gear, so why not use it?
    I quickly figured out that the offending process on the watch side was "w-contacts2-consumer". Apparently, if you just kill it, this stops Contact synchronisation only, while Contacts app on the watch remains fully functional. Unfortunately, this process is respawned every time Bluetooth connection is reestablished between the the phone and the watch.
    I was looking for "cron" for Tizen, hoping to put "pkill" into a recurring task that'd run every couple of minutes. Unfortunately, I couldn't find "cron" on the watch, and the version of busybox suggested in one of the threads on this forum doesn't have it precompiled.
    Then I thought: why the heck can't I just write a small app (command line) that would literally just do this:
    Code:
    while(1)
    {
    	system("pkill w-contacts2");
    	sleep(120);
    }
    After a bit of playing around with Tizen SDK, I managed to produce this executable (attached). You can put it into /sbin, making sure permissions are 755. One last thing is to make it run as a service:
    Code:
    systemd-run --unit=kill_contacts.nonsamsung --description="Automatically Kill Contacts Every 2 Minutes" /sbin/kill_contacts
    I don't think it'll survive a reboot though, I'll get it sorted later.

    Now battery consumption is back to normal, and contacts get synchronised every time the watch connects to the phone, which is more than fine with me.
    2
    To make kill_contacts permanent, you can create service so that it will automatically start on reboot

    create file named kill_contacts.service
    Code:
    [Unit]
    Description=Automatically Kill Contacts Every 2 Minutes
    
    [Service]
    ExecStart=/sbin/kill_contacts
    
    [Install]
    WantedBy=multi-user.target

    push this file to /etc/systemd/system
    change mod to 644
    enable service
    start service
    Code:
    c:\sdb root on
    c:\sdb push kill_contacts.service /etc/systemd/system
    c:\sdb shell
    sh-3.2#chmod 644 /etc/systemd/system/kill_contacts.service
    sh-3.2#systemctl enable /etc/systemd/system/kill_contacts.service
    sh-3.2#systemctl start kill_contacts.service

    check running service using :
    Code:
    journalctl -u kill_contacts.service
    1
    Could you please explain your "logic invocations, right now 1:64" change?
    In the fixed APK the logic is actually invoked 1 time out of 64 attempts. It makes its frequency about every 40 minutes instead of every 30 seconds.
    1
    thanks but I am not been able to uninstall the goproviders app. there is no option to uninstalled View attachment 2807827

    please advice if you can

    Sent from my SM-N900T using Tapatalk
    I use Super Manager for this sort of tasks. Look it up in Google Play store.

    Sent from my GT-I9505 using Tapatalk