title: checking if FOREGROUND_SERVICE permission is granted allways returns false
body: <p>Having followed the migration notes and added the following line to the manifest :</p>
  <pre><code>&lt;uses-permission android:name=&quot;android.permission.FOREGROUND_SERVICE&quot;/&gt;
  </code></pre>
  <p>I could not figure out why I am getting a failing test case where the permission <code>android.permission.FOREGROUND_SERVICE</code> is not being granted (at least when it's being checked on run-time).</p>
  <p>Based on the <a href="https://developer.android.com/about/versions/pie/android-9.0-migration#tya" rel="nofollow noreferrer">docs</a>, which states that <code>android.permission.FOREGROUND_SERVICE</code>should be automatically granted by the system.</p>
  <blockquote>
  <p>apps wanting to use foreground services must now request the
  FOREGROUND_SERVICE permission first. This is a normal permission, so
  the system automatically grants it to the requesting app.</p>
  </blockquote>
  <p>Can somebody explain why my test case (which uses a variant of the the following code) is failing?</p>
  <pre><code>assertEquals(ActivityCompat.checkSelfPermission(activity, &quot;android.permission.FOREGROUND_SERVICE&quot;), PackageManager.PERMISSION_GRANTED);
  </code></pre>
  <p><strong>Yet!</strong> I am not having any <code>SecurityException</code> thrown. What am I missing?</p>