Request permission on PACKAGE_USAGE_STATS
<p>I want to check wheter the user have granted permission for my application to use <strong>PACKAGE_USAGE_STATS</strong>. What I am currently doing is this:</p>

<pre><code>// Control that the required permissions is instantiated!
if (ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED &amp;&amp; ContextCompat.checkSelfPermission(this, Manifest.permission.PACKAGE_USAGE_STATS) != PackageManager.PERMISSION_GRANTED) {
    ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.PACKAGE_USAGE_STATS}, MULTIPLE_PERMISSION_GRANTED);
}
</code></pre>

<p>I have implemented the requestPermissions as described in the Android Developer section and it is working just fine for <strong>ACCESS_FINE_LOCATION</strong>.</p>

<p>But when my application request permissions it only shows the <strong>ACCESS_FINE_LOCATION</strong> permission and not the <strong>PACKAGE_USAGE_STATS</strong> can anyone explain why? And if so, give a solution to how I could do it?</p>

<p>I want both permissions to show up in a dialog box like this:
<a href="https://i.stack.imgur.com/nhhPg.png" rel="noreferrer"><img src="https://i.stack.imgur.com/nhhPg.png" alt="enter image description here"></a></p>