title: Apk fails CTS test: shouldNotFIndUnexpectedIntents, no idea why
body: <p><strong>History:</strong></p>
  
  <p>A client of ours has integrated our SDK library for Android. They try to pass Google's compatibility test (CTS). </p>
  
  <p><strong>The issue:</strong></p>
  
  <p>They failed CTS test suit with the following message:
  android.signature.cts.intent.intentTest#shouldNotFindUnexpectedIntents | Result fail | java.lang.AssertionError: [package &lt;<em>their package</em>> Invalid Intent: [android.intent.action.ACTION_BOOT_COMPLETE]].</p>
  
  <p><strong>The main question:</strong></p>
  
  <p><strong><em>My goal is to help them pass this test but I'm not sure what the real problem is and how to solve it. Can anyone help?</em></strong></p>
  
  <p><strong>Details:</strong></p>
  
  <p>1) I cannot currently extract information from our client at all about their host apk. All I know is that they're testing a <strong>priv-app apk</strong> for <strong>Android 8.0 devices</strong>. (It's legitimately a priv-app and should be). I cannot be sure for the next few days but I believe their targetSdk is 26 (i.e., Android 8.0.0)</p>
  
  <p>2) Our SDK library contains a Broadcast Receiver that's defined as following:</p>
  
  <pre><code>&lt;receiver android:enabled="true" android:exported="false" android:name="&lt;our Broadcast Receiver class path&gt;"&gt;
          &lt;intent-filter&gt;
              &lt;action android:name="android.intent.action.BOOT_COMPLETED"/&gt;
              &lt;action android:name="android.intent.action.MY_PACKAGE_REPLACED"/&gt;
              &lt;action android:name="com.dt.ignite.startService"/&gt;
              &lt;action android:name="&lt;our package&gt;.&lt;our custom intent name 1&gt;"/&gt;
              &lt;action android:name="&lt;our package&gt;.&lt;our custom intent name 2&gt;"/&gt;
              &lt;action android:name="&lt;our package&gt;.&lt;our custom intent name 3&gt;"/&gt;
          &lt;/intent-filter&gt;
      &lt;/receiver&gt;
  </code></pre>
  
  <p>3) Looking at the source code of this specific CTS test (IntentTest.java) I understand it's failing because the ApplicationInfo of this apk contains an Intent which is not a "platform Intent", specifically "BROADCAST_COMPLETE". (<a href="https://github.com/leolin310148/ShortcutBadger/issues/274" rel="nofollow noreferrer">https://github.com/leolin310148/ShortcutBadger/issues/274</a>)</p>
  
  <p>4) The above made me think of Google's newly introduced "Background Limitations" and how they ban implicit Intent receivers from Android 8.0 and on. However, it is stated that BROADCAST_COMPLETE would be exempt from this ban. (<a href="https://developer.android.com/about/versions/oreo/background#broadcasts" rel="nofollow noreferrer">https://developer.android.com/about/versions/oreo/background#broadcasts</a>)</p>