title: android ContextCompat.checkSelfPermission always returns PERMISSION_GRANTED
body: <p>In my android application (<em>minSdkVersio</em>n 15), i have to create directory and write files into it. In my AppManifest i am using :</p>
  <blockquote>
  <p><code>&lt;uses-permission android:name=&quot;android.permission.WRITE_EXTERNAL_STORAGE&quot; /&gt;</code></p>
  <p><code>&lt;uses-permission android:name=&quot;android.permission.READ_EXTERNAL_STORAGE&quot; /&gt;</code></p>
  </blockquote>
  <p>Before creating directory or file, i am checking if permission is allowed or deny, as</p>
  <pre><code>   boolean isAllow = ContextCompat.checkSelfPermission(this, android.Manifest.permission.WRITE_EXTERNAL_STORAGE) == PackageManager.PERMISSION_GRANTED;
  </code></pre>
  <p>But it is always returning <em>true</em> or <em>PERMISSION_GRANTED</em>, even when someone set deny permission from <em>Settings -&gt; Apps -&gt; Permissions</em></p>
  <p><a href="https://i.stack.imgur.com/D282b.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/D282b.png" alt="Deny Permission" /></a></p>
  <p>Why <code>checkSelfPermission</code> is always returning PERMISSION_GRANTED ? Is there any way to check if permission is denied ?</p>
  <p>To invoke permission i have used :</p>
  <pre><code>  ActivityCompat.requestPermissions(MainActivity.this, new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE}, 1);
  </code></pre>
  <p>But its not showing permission Dialogue??</p>