How to override android turn off mobile function?

A

AC Question

i am developing an anti_theft application in which i want that if a particular option is turn on.....then after this any time a user long press phone button to turn off mobile ....then after pressing turn off option ...mobile should not be turn off but a particular option should be performed e.g siren in load volume etc.... how can we do it..?