title: Manifest-declared broadcast receiver does not receive custom broadcast on Android 8
body: <p>First, I created a <code>BroadcastReceiver</code> with empty body. Then, I added it to the AndroidManifest.xml. But I found out that <code>BroadcastReceiver</code> declared in manifest does not receive any broadcast. I sent broadcast by </p>
  
  <pre><code>sendOrderedBroadcast(new Intent("com.example.action"), null)
  </code></pre>
  
  <p>or</p>
  
  <pre><code>adb shell am broadcast -a com.example.action
  </code></pre>
  
  <p>Both methods works on Android 7 but it does not work on Android 8. However, if the <code>BroadcastReceiver</code> is declared through <code>registerReceiver</code>, then it can still receive the broadcast.</p>
  
  <p>On the other hand, <code>android.hardware.usb.action.USB_DEVICE_ATTACHED</code> works fine on both Android 7 and 8.</p>
  
  <p>I want to ask why does it happen? I have tested it in both emulator and a physical device. They have the same behavior.</p>
  
  <p><strong>AndroidManifest.xml</strong></p>
  
  <pre><code>...
  &lt;receiver
      android:name=".device.UsbBroadcastReceiver"
      android:exported="true"&gt;
      &lt;intent-filter&gt;
          &lt;action android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED" /&gt;
          &lt;action android:name="com.example.action" /&gt;
      &lt;/intent-filter&gt;
      &lt;meta-data
          android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED"
          android:resource="@xml/device_filter" /&gt;
  &lt;/receiver&gt;
  ...
  </code></pre>