Prevent mobile data from automatically turning off after a while on Xiaomi Mi 4 I use Xiaomi Mi 4 (Android 7.1.2 Nougat) phone's hotspot to surf the internet on a laptop. After sometime approximately 20 minutes, the phone automatically turns off the mobile data and I have to turn on the mobile data manually.

I think the phone turns off the data automatically because it is left undisturbed and to save battery. However, the phone is already plugged-in to the charging spot.

How to prevent mobile data from automatically turning off after a while on Xiaomi Mi 4?
this solved my problem 

developer options > Networking > Cellular Data always active 

toggle this option on