I have a Fairphone first generation running Kola Nut 1.8.7. I do regular updates of my apps whenever the Playstore notifies me of new updates.
I always turn off the wifi connection before going to bed and I usually plug in the charging cable. In the last few weeks, I really don’t know since when exactly, when I got up I noticed that my phone’s wifi was on. I thought it strange, because I couldn’t recall enabling it in the first place. Since then this started to happen more and more often and now I realized, when I plug in the charger cable, eventually the wifi turns itself on automatically. Sometimes it takes a couple of minutes, sometimes it take one 5 seconds.
I was looking for this behaviour and I found a lot of threads on other android forums but they always seemed to be related to specific “smart wifi” app/settings installed by the carriers (spring, at&t, etc). And there were always US carriers. This doesn’t apply to me because I live in Germany and my carrier has no software installed on my phone.
I tried to find some obscure setting (perhaps I enabled something without realizing what I was doing) and then I went to Settings -> Wifi and then I pressed on the left button to to the advanced settings. There I found the setting “Keep Wi-Fi on during sleep”. I set this option from Always to Never, hoping that this would help but it doesn’t. Whenever I charge my phone, wifi turns itself on.
I don’t know what to do. It could be that an app got updated and brought a new setting by default like “turn wifi on when charging”, something like the “smart wifi” apps from the carriers mentioned above. I looked at many of the apps I usually use and I haven’t found any setting that goes in that direction. I cannot check every app to see which may be causing trouble, that would take me ages.
Does anybody have or had this issue? Do you know some way that I can track which app or which process is turning on the wifi? Perhaps some debugging option in the developer’s menu?
I installed the CatLog, but I’ll test the Logcat from F-droid. In the mean time I saved a log file where I have this behaviour. Even though I cleared the log before plugin in the usb cable the log got long very quicky.
On page at the beginning I see that wpa_supplicant is active and shortly thereafter the wifi turns itself on. However I cannot determine which process spawns the activation of the wifi. Would you please take a quick look?
Well, restarting wpa_supplicant didn’t solve the problem. When I plug in a an USB cable connected to my computer or a charging usb cable the wifi turns itself on.
I wasn’t able to install Logcat (Android Logcat without Root), F-droid displays the entry gray and the “Install” button is missing. I downloaded the apk file from the website you posted and I only got an error that parsing the file went wrong.
I want to try adb but it seems I’m doing something wrong.
@home I use Gentoo and installed dev-util/android-tools (5.1.1_p13) which has the adb command.
With adb shell I was able to connect to my phone. Executing logcat gets me a lot of logs, I’m unable to find anything. Do you have a suggestion what I should be filtering for?
Okay, sorry, I’m using an alpha build of kitkat. Seems that the app I linked to doesn’t work below Android 4.4. It’s quite a hassle to use anyway, since it works without root.
You can directly use adb logcat. Filter for wifi for example.
Another idea that came to my mind: I use the app “Autostarts” (F-Droid) to block other apps that automatically start at certain events. I have one app that starts at the event “Power disconnected”. Maybe you have an app installed that does something on “Power connected”.
40049 D/WifiManager(19000): Enter init, sThreadRefCount:0 40050 W/System.err( 555): java.lang.SecurityException: WifiService: Neither user 10154 nor current process has android.permission.CHANGE_WIFI_STATE. 40051 W/System.err( 555): at android.app.ContextImpl.enforce(ContextImpl.java:1613) 40052 W/System.err( 555): at android.app.ContextImpl.enforceCallingOrSelfPermission(ContextImpl.java:1642) 40053 W/System.err( 555): at com.android.server.WifiService.enforceChangePermission(WifiService.java:641) 40054 W/System.err( 555): at com.android.server.WifiService.getWifiServiceMessenger(WifiService.java:1067) 40055 W/System.err( 555): at android.net.wifi.IWifiManager$Stub.onTransact(IWifiManager.java:408) 40056 W/System.err( 555): at android.os.Binder.execTransact(Binder.java:351) 40057 W/System.err( 555): at dalvik.system.NativeStart.run(Native Method) 40058 E/WifiManager(19000): mWifiServiceMessenger == null
the logs appear so fast, I think this is the place where the wifi activated itself. It seems that the WifiService activates when there is a trigger from ACTION_BATTERY or something. I don’t know what to do
I am not aware of having such an app. I haven’t installed new apps for a long time, I’ve been just updating my current apps. How could I find out if I have such an app? I’ll try the Autostarts app.
I don’t have that option. I only have “Network notification” (not checked), “Keep Wifi on…”, “wifi optimization” (checked), “MAC Address” (read-only) and “IP Address” (also read-only).
I installed autostarts, in the “Power connected” section I have:
AccuWeather
Amazon Shopping
Fairphone Updater
Google+ (4 times)
Picasa Uploader
Google Play services (3 times)
IBM Verse
Flashlight
Navigation
I disabled them all (using the disable option in the autostarts app) but when I plug in the charging cord the wifi turns on again