[Sony Xperia M2] Miche1asso:
If like me after installing Lollipop you're experiencing the GPS going nut, a bad battery drain or the WiFi showing an exclamation mark dropping the connections these could be your solutions!

GPS LOSING SIGNAL (it needs root):

OBSOLETE - GPS is now fixed in 18.6.A.0.182

After reading some complaints about the GPS not working in Lollipop I checked it in my phone and I discovered it was indeed behaving poorly. In my case it does get the signals from the satellites, computes the position and other value and then after just few seconds it starts all over again. Comparing the 5.1.1 /etc/gps.conf file with the the one in KitKat and some suggested in the internet I tested few changes and I managed to make it fully operational just changing a single parameter:

Actually it seems the gps.conf file from KitKat does fix the issue. It happened that I made a mess with the file permissions (umask is set by default to 0077). [MENTION=5402897]nunu00[/MENTION] made me notice that it worked for him. So I tested it again, and after fixing the file permissions it does seem to do the job.

You can find a copy of the KK file in http://xdaforums.com/showpost.php?p=63285443&postcount=2.

As root make a backup of the original /etc/gps.conf and copy it over (as gps.conf. Remove the ".txt" postfix).

Be sure the file is readable by everyone.

Then reboot the phone and the GPS will be back to normal.

Additionally (but not necessarily) one may want to use an NTP server for his or her geographical region, like for example, if one is in Europe should comment out the stock NTP server and set instead the European one:

#Test
# NTP_SERVER=time.gpsonextra.net
#Asia
# NTP_SERVER=asia.pool.ntp.org
#Europe
[B]NTP_SERVER=europe.pool.ntp.org[/B]
#North America
# NTP_SERVER=north-america.pool.ntp.org

Even better on can add the NTP server, if available, for the Country, like I did for Italy:

#Italy
NTP_SERVER=it.pool.ntp.org

All other servers must obviously be commented out.

I/O WAIT ALWAYS AT 50% (it needs root):

Lollipop added in the Xperia M2 the compressed virtual memory, also known as zram. It is a feature that I personally like (I implemented it in the kernel for my crappy low range/low memory/low quality Samsung phone I had previously) as long as it works as it must. At the cost of little CPU time one can benefit from few hundreds megabytes of more usable RAM. Unfortunately in Lollipop it seems bugged, since the zram makes the process kswapd0 in constant I/O Wait (about 50%), which may degrade the max performances and also keeps at least two cores running at 1190MHz, draining the battery. One can see it with the "busybox top" command (busybox is installable in /data/local/tmp by anyone - no root needed):

Mem: 733016K used, 152060K free, 0K shrd, 40788K buff, 180220K cached
CPU: 1.2% usr 7.4% sys 0.0% nic [B][COLOR="red"]47.3% idle[/COLOR] [COLOR="Blue"]43.8% io[/COLOR][/B] 0.0% irq 0.0% sirq

- Solution 1: enable the "laptop mode" and change the swappiness value

It has been reported by [MENTION=6966272]semil[/MENTION] and confirmed by [MENTION=4787101]linuxct[/MENTION] that changing the swappiness value to something between 40-60 improves it (with zram enabled). Obviously you need root. Just make a /etc/init.d script with the following line

sysctl -w vm.swappiness=60

(you can change 60 to 40 or else while testing) or add it to /etc/init.d/00stop_ric. It changed nothing in my phone, though, so I tried tampering with other parameters and eventually I've been successful. Appending after the command above the following two lines

sysctl -w vm.laptop_mode=1
sysctl -w vm.drop_caches=1

finally the kernel moved out of the I/O wait. In my phone with 130-140 apps installed it always takes a about 10 minutes after boot, so be patient while testing. The two parameters above are non destructive and they get rewritten after each boot, so they can't make things worse than what they already are.

After the update 18.6.A.0.182 the IO Wait is still there. I did some some tests and I could raise the swappiness to 90. The IO Wait still goes down, but theoretically giving a slightly better "multitasking" than with a 40 or 60 value.

- Solution 2: disable the zram

Well, the trick is simple: disable the zram and the iowait has gone. To disable it as root one needs to execute

swapoff /dev/block/zram0

At any time. But it is obviously suggested to put the command in a script in /etc/init.d (just add it at the end of /etc/init.d/00stop_ric). And this is how the idle and iowait times are now:

Mem: 780028K used, 105048K free, 1000K shrd, 2284K buff, 149080K cached
CPU: 3.9% usr 4.9% sys 0.0% nic [B][COLOR="Red"]91.0% idle[/COLOR] [COLOR="RoyalBlue"]0.0% io[/COLOR][/B] 0.0% irq 0.0% sirq

WIFI DROPPING CONNECTIONS SHOWING AN EXCLAMATION MARK:

If you see an exclamation mark on the right of the WiFi status icon it means that Lollipop can't access the Internet still being connect to a WiFi AP. This is apparently due to some incompatibility between the new drivers and the Captive Networks, the Hot Spots showing as open but that indeed require a web login to be used.

- Solution 1: Disable the Capitve Networks all together:

The good news is that as regular users (non root) we can still switch it off. From a terminal emulator app or via "adb shell" (google to know how to install and play with the latter) simply type:

settings put global captive_portal_detection_enabled 0

and reboot. To re-enable it give the command:

settings put global captive_portal_detection_enabled 1

To check the current state (I'd suggest to do it before setting it. It should report 1) type:

settings get global captive_portal_detection_enabled

To run it via a Terminal emulator on the phone you need to have UID shell. Just execute first:

su shell

and then one of the commands above. But one needs the phone to be rooted for that.

UPDATE: In 18.6.A.0.182 as soon as I enable the Global Captive Support I get the exclamation mark. It doesn't drop the connection anymore but it is quite annoying.

- Solution 2: Disable the check for open/public networks:

This is still under investigation, but it seems to do the job. Simply go to the WiFi Settings/Advanced and disable the open networks notification. UPDATE: I still get the exclamation mark but it doesn't drop the connection.

GOOGLE SEARCH BAR ANIMATIONS AND VOICE SEARCH (requires root):

In the Xperia Home we can now have the Google search bar (to hide it just "swipe in" two fingers in the screen as when we add widgets and touch the hide button on the right of the bar. Which is my most favorite solution). The ugly thing is that when touching the bar Google Now opens with no animation. Also the option to enable "voice search" from any screen isn't available anymore. The value of "ro.config.low_ram " in /system/buil.prop is set to "true". An user suggested that changing (as root) it to "false" as in below

ro.config.low_ram=false

should fix it. Always make a backup of build.prop file before modifying it!!

I tested it myself and the option to have the voice search in all screens did appear indeed. I didn't see any changes in the animations, though.

LITTLE ICONS IN XPERIA HOME:

If like me you have been shocked by the new huge icons in the Xperia Home, so much that you were already thinking about switching the home launcher, don't fret: the small icons are still there!! Simply "swipe in" two fingers in the screen and together with the ability of adding widgets, changing themes and else on the bottom right there is the new "Home Settings". Click on it and you get the option to have the new rotating Xperia Home and.. yes, the smaller lovely icons back!

ENABLE MULTI USER (it needs root):

Due to the low amount of RAM (see the need for the zram above) and internal memory Sony doesn't support the multi user option in Lolliopop 5.1.1 for devices with 1GB. To enable it just add to the /system/build.prop file the following two lines:

fw.show_multiuserui=1
fw.max_users=3

where 3 users mean the main account, the guest account and a second account. Always remember to make a

backup

of the stock build.prop before any modification! If one just wants to test it without messing up with build.prop, the same behavior is achievable withthe following commands:

setprop fw.show_multiuserui 1
setprop fw.max_users 3

Unfortunately it is missing the user icon in the top right of the notification panel and frankly it is a lag fest. Which should be the reason why Sony removed it.

To disable it first

delete any account

you have eventually created (otherwise I'm afraid you end up wasting precious internal memory for nothing), restore the build.prop file in case it has been modified and reboot. Everytthing will be back to normal.

[CONTINUE]

--------------------

I hope this helps. If you have any other suggestion/solution, please write about them in the thread and I will add them in the main post. Also this is not a thread about getting help, use the forum for it. Still questions about the mentioned tips are welcome