title: Android - Camera permissions denied without prompting
body: <p>I was running into issues with the manual process behind requesting permissions (just kept falling into the 'denied' code), so I switched over to using Dexter to simplify.  I implemented the following code in onCreate(), and I did a fresh install of the app:</p>
  
  <pre><code>Dexter.withActivity(this)
              .withPermission(Manifest.permission.CAMERA)
              .withListener(new PermissionListener() {
                  @Override public void onPermissionGranted(PermissionGrantedResponse response) {
                      Log.d(TAG, "GRANTED!");
                      initCamera();
                  }
                  @Override public void onPermissionDenied(PermissionDeniedResponse response) {
                      Log.d(TAG, "DENIED!");
                  }
                  @Override public void onPermissionRationaleShouldBeShown(PermissionRequest permission, PermissionToken token) {
                      Log.d(TAG, "PERMISSION RATIONAL SHOULD BE SHOWN!");
  
                  }
              }).check();
  </code></pre>
  
  <p>It immediately falls into the "DENIED!" log, and it never even prompts me.  I tried this particular code to attempt multiple permissions (which is ultimately what I need to do):</p>
  
  <pre><code>Dexter.withActivity(activity)
              .withPermissions(Manifest.permission.CAMERA,
                      Manifest.permission.RECORD_AUDIO,
                      Manifest.permission.READ_EXTERNAL_STORAGE,
                      Manifest.permission.WRITE_EXTERNAL_STORAGE)
              .withListener(new MultiplePermissionsListener() {
                  @Override
                  public void onPermissionsChecked(MultiplePermissionsReport report) {
                      Log.d(TAG, "Accepted: " + report.getGrantedPermissionResponses().size() + " | Denied: " + report.getDeniedPermissionResponses().get(0).getPermissionName());
                  }
  
                  @Override
                  public void onPermissionRationaleShouldBeShown(List&lt;PermissionRequest&gt; permissions, PermissionToken token) {
                      Log.d(TAG, "continuing permissions request..");
  
                      token.continuePermissionRequest();
                  }
              })
              .check();
  </code></pre>
  
  <p>It prompts for permissions to Record Audio, then it asks about Access to photos/media/files on the device (it never asks about Camera).  Then once that's done, it prints the log: "Accepted 3 | Denied: android.permission.CAMERA".  It denies it without even prompting me again.</p>
  
  <p>My Manifest is set properly to have CAMERA in the proper place (outside of the 'application' tag).  See below for reference:</p>
  
  <pre><code>&lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="com.my.app"&gt;
  
  &lt;uses-feature
      android:name="android.hardware.camera"
      android:required="true" /&gt;
  
  &lt;permission
      android:name="${applicationId}.permission.C2D_MESSAGE"
      android:protectionLevel="signature" /&gt;
  
  &lt;uses-permission android:name="android.permission.CAMERA" /&gt;
  &lt;uses-permission android:name="android.permission.RECORD_AUDIO" /&gt;
  &lt;uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /&gt;
  &lt;uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /&gt;
  etc..
  </code></pre>
  
  <p>Odd thing is that when I go into Settings > Applications > MyApp, the Camera option is not even displayed in there.</p>
  
  <p>I don't think it's an issue with Dexter, since it's doing basically the same thing when I set it up manually (and I confirmed that it's definitely setup properly in that case after looking at a few top S.O. posts).</p>
  
  <p>Any thoughts on what the issue could be here?  FYI - I'm using a Galaxy S6, OS 6.0.2.  The other users experiencing this seem to be other devices with 6.0+ OS.  Thanks in advance!</p>
  
  <p>EDIT:
  Testing various devices, it works on some and does not work on some:</p>
  
  <ul>
  <li>Moto X (OS 5.0) - Broken</li>
  <li>Nexus 5 (OS 7.0) - Works</li>
  <li>Samsung S6 (OS 6.0.1) - Broken</li>
  <li>Broken Moto X (OS 6.0) - Works</li>
  </ul>
  
  <p>Doesn't seem to be a solid pattern.. Definitely strange.  I also started a brand new project and ran the same code - worked fine and allowed access to my camera.  So it doesn't appear to be fully device-specific..</p>