I was so frustrated I rooted the phone, unlocked the boot-loader and flashed the original ftf of sony kitkat using flashtool just in the hope that I will not face the same problem. But I again faced the problem. I even tired flashing AOKP but the phone always turns off without any warning.
At the moment I have flashed cyanogenmod but the problem is always here.
So, I have come to the conclusion that it is not the problem on Sony firmware and next version of android(if they release) for Sony will not solve this problem. My question is do any one have any idea what is the problem? Is there any kernel or app that will help me?