@resto you don't need to change any code - just enter the intent (often looking like cn.nihao.action.SHUTDOWN instead of android.intent.action.SHUTDOWN) into "Shutdown intent" Poweramp option. Usually can be googled by "shutdown intent YOUR HEADUNIT NAME". Poweramp supports like 5-6 of these, but it looks like each headunit model/firmware (again for unknown reason) changes the intent name, so this is why Shutdown Intent option is there.