Reboots an Android device at least when called from a WorkManager (OneTimeWorkRequestBuilder).
Then the Android loops on the logo and is unusable ! BEWARE !
Use that source code at your own risk, but only on emulator.
If the Android devices loops on the logo screen, you can unlock it with ADB from your computer with the following command :
adb uninstall yourpackagename