title: BOOT_COMPLETED not called if device restarted using hardware buttons
body: <p>I have registered a BroadcastReceiver called CheckReceiver:-</p>
  
  <pre><code> &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="com.example.captchachecker"
      android:versionCode="1"
      android:versionName="1.0" &gt;
  
      &lt;uses-sdk
          android:minSdkVersion="16"
          android:targetSdkVersion="21" /&gt;
  
      &lt;uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" /&gt;
      &lt;uses-permission android:name="android.permission.WAKE_LOCK" /&gt;
  
      &lt;application
          android:icon="@drawable/ic_launcher"
          android:installLocation="internalOnly"
          android:label="@string/app_name"
          &gt;
          &lt;activity
              android:name=".MainActivity"
              android:label="@string/app_name" &gt;
              &lt;intent-filter&gt;
                  &lt;action android:name="android.intent.action.MAIN" /&gt;
  
                  &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
              &lt;/intent-filter&gt;
          &lt;/activity&gt;
  
          &lt;receiver android:name=".CheckReceiver" &gt;
              &lt;intent-filter&gt;
                  &lt;action android:name="android.intent.action.BOOT_COMPLETED" /&gt;
                  &lt;action android:name="android.intent.action.QUICKBOOT_POWERON" /&gt;
              &lt;/intent-filter&gt;
          &lt;/receiver&gt;
  
      &lt;/application&gt;
  
  &lt;/manifest&gt;
  </code></pre>
  
  <p>CheckReceiver code:-</p>
  
  <pre><code>public class CheckReceiver extends WakefulBroadcastReceiver {
  
      @Override
      public void onReceive(Context context, Intent intent) {
          Log.d("Check Receiver", "Captcha Receiver called");
  
          Toast.makeText(context, "Receiver called", Toast.LENGTH_SHORT).show();
          Intent service = new Intent(context, CheckService.class);
          startWakefulService(context, service);
      }
  }
  </code></pre>
  
  <p>The problem is that when I press the power button and choose Power off option, BroadcastReceiver is not being called.
  If I restart the device using:-</p>
  
  <pre><code>adb shell am broadcast -a android.intent.action.BOOT_COMPLETED
  </code></pre>
  
  <p>then BroadcastReceiver is being called.
  I have read about launching activity atleast once for BroadcastReceiver and launch an activity 2-3 times before checking.</p>