You have water damage. On any any cell phone or smartphone, water/liquid damage can interfer with hardware and, thus, software. It appears, based on your question, that some liquid got into the internals (inside) of the phone. If any vital part got wet, your phone will not operate the same...