title: Android ACTION_SHUTDOWN Broadcast not working
body: <p>Code -</p>
  
  <pre><code>public class ShutdownReceiver extends BroadcastReceiver {
      private static final String TAG = "ShutdownReceiver";
  
      @Override
      public void onReceive(final Context context, final Intent intent) {
          Logger.i(TAG, "Shutting Down..........................");
          if("android.intent.action.ACTION_SHUTDOWN".equals(intent.getAction())) {
              //Power Off
          }
      }
  }
  </code></pre>
  
  <p><strong>Service -</strong> </p>
  
  <pre><code>private BroadcastReceiver mReceiver = null;
  
      @Override
      public void onCreate() {
           super.onCreate();
           // INITIALIZE RECEIVER
           //It is used to register broadcast for ShutDown or Power Off
           IntentFilter filter = new IntentFilter(Intent.ACTION_SHUTDOWN);
           mReceiver = new ShutdownReceiver();
           registerReceiver(mReceiver, filter);
     }
  
     @Override
     public void onDestroy() {
         unregisterReceiver(mReceiver);
     }
  </code></pre>
  
  <p>Permissions - </p>
  
  <pre><code>&lt;uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /&gt;
  &lt;uses-permission android:name="android.permission.INTERNET" /&gt;
  &lt;uses-permission android:name="android.permission.ACCESS_WIFI_STATE" /&gt;
  &lt;uses-permission android:name="android.permission.CHANGE_WIFI_STATE" /&gt;
  &lt;uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /&gt;
  &lt;uses-permission android:name="android.permission.CALL_PHONE" /&gt;
  &lt;uses-permission android:name="android.permission.READ_PHONE_STATE" /&gt;
  &lt;uses-permission android:name="android.permission.CALL_PRIVILEGED" /&gt;
  &lt;uses-permission android:name="android.permission.CHANGE_CONFIGURATION" /&gt;
  &lt;uses-permission android:name="android.permission.GET_TASKS" /&gt;
  &lt;uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" /&gt;
  &lt;uses-permission android:name="android.permission.DEVICE_POWER" /&gt;
  </code></pre>