title: Android NDK C++ camera2 API: ACameraManager_getCameraIdList return 0 cameras
body: <p>I'm trying to create C++ Android native camera wrapper using the NDK camera2 API (from abi level 24). I created some snippet code using an example I found and compile it for target API level 24 and run it on Android 7.1 phone:</p>
  
  <pre><code>ACameraManager *cameraManager = ACameraManager_create();
  VB(cameraManager!=nullptr, "Could not create CameraManager.");
  camera_status = ACameraManager_getCameraIdList(cameraManager, &amp;m_camera_id_list);
  
  if (camera_status != ACAMERA_OK) {
  
      LOGE("Failed to get camera id list (reason: %d)\n", camera_status);
      return ERR_CAMERAAPI_UNKNOWN_ERROR;
  }
  
  if (m_camera_id_list-&gt;numCameras &lt; 1) {
      LOGE("No camera device detected.\n");
      return ERR_CAMERAAPI_UNKNOWN_ERROR;
  }
  </code></pre>
  
  <p>When I run this naive code on Xiaomi mi4c Android 7.1 phone I get an empty camera list.</p>
  
  <p>I also tried to run on the same phone a snippet created with Java camera2 API that does the same thing:</p>
  
  <pre><code>import android.hardware.camera2.CameraDevice; 
  Activity activity = getActivity();
  CameraManager manager = (CameraManager) activity.getSystemService(Context.CAMERA_SERVICE);
  
  String[] cameraIds = manager.getCameraIdList()
  manager.openCamera(cameraIds[0], mStateCallback, mBackgroundHandler);
  </code></pre>
  
  <p>This time I see in the logical that it actually finds two cameras and print their resolutions.</p>
  
  <p>My manifest of course contains these lines:</p>
  
  <pre><code>&lt;uses-sdk android:minSdkVersion="24" /&gt;
  &lt;uses-feature android:name="android.hardware.camera2" android:required="true" /&gt;
  &lt;uses-feature android:name="android.hardware.sensor.gyroscope" android:required="false" /&gt;
  &lt;uses-permission android:name="android.permission.CAMERA"/&gt;
  </code></pre>
  
  <p>And I approve the permissions requests.</p>
  
  <p>Does anyone knows why it finds the phone cameras when using the Java camera2 API but does not find them when using the NDK camera2 API?</p>