Google adds new Rescue Party feature in Android Oreo to prevent bootloops
Unfortunately, the Rescue Party feature is enabled in Android 8.0 Oreo only, so it will not work on other versions of the OS. It's also worth mentioning that the new feature is enabled by default, so you don't need to do anything to set it up.
Finally, Rescue Party will automatically trigger if the system_server restarts more than 5 times in 5 minutes, or if a persistent system app crashes more than 5 times in 30 seconds. Keep in mind that no special hardware support is needed in order for Rescue Party to work.
source: Google
Things that are NOT allowed: