Cordova Android app and user permissions

Viewed 2945

I have an Android Cordova app and I'm using GPS, check the network state, read/write on the Documents folder and taking camera pictures. Here my permissions on the manifest XML file:

<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-feature android:name="android.hardware.location.gps" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

The manifest file is auto generated by the Cordova framework. For some reason I don't see camera permissions. Permissions are not asked at installation time anymore (that's since Android 6) but instead they should be asked before usage. I correctly get the GPS access permission popup but not the read/write Documents folder permission. I also never get the camera permission albeit I'm able to use it without ever being asked for permission. Same story for the Network status permissions (never being asked).

I find Android permissions scheme extremely confusing, under application manager my app has got Location and Storage as expected, Camera and Network status are missing though.

To recap, inside the app, on the actual code, I'm using at least once those devices

  • GPS fine grained
  • GPS coarse (probably the Wifi SSID triangulation trick)
  • Write on Documents
  • Read on Documents
  • Read network status (Offline / Wifi / 3G etc..)
  • Take picture from the camera

Cordova framework wrote this manifest file:

  • android.permission.ACCESS_COARSE_LOCATION
  • android.permission.ACCESS_FINE_LOCATION
  • android.hardware.location.gps (why is it not a .permission?)
  • android.permission.ACCESS_NETWORK_STATE
  • android.permission.WRITE_EXTERNAL_STORAGE

On application manager I get those options:

  • Location
  • Storage

So basically I get three different sets of permissions :-(

1 Answers
Related