are you sure it's not an OS issue?
been experiencing this problem after 5.0.8 update
same is happening with me in OnePlus 3
my phone is restarting itself randomly. I did factory reset and cleared cache data from recovery mode but still the problem is not solved. please help