Hi all, I've been doing some testing with Android M Preview 3 and with Android API 23 to investigate the behavior I'm seeing with permissions. I tested older sdk levels with M Preview 3, API 23 with Preview 3, and API 23 with Lollipop. * If anyone has different results, let me know.
On master, the target sdk level is currently set to 22. Running mobilespec at this target level on the 3rd Preview, all the automatic plugin tests passes. For manual tests, there are also no regressions, however, when testing the camera, I get prompted for permission. This is a bit odd because older sdk running on the Preview should use the old permission model, which is granting permission at install time, not runtime as stated in the Android documentation. Another odd behavior is if I accept this permission for mobilespec, I never have to accept again, even if another app is accessing the camera. I tested this with another cordova app I made that calls the camera plugin. The last odd behavior I noticed is when you accept for camera, the camera app itself opens, so when you take a picture, you don't return to mobilespec. You just stay in the camera app. This only happens right after accepting. When you go back to mobilespec manually and use the camera again, the expected behavior of the camera resumes and your picture shows up in the yellow box of mobilespec. The above behaviors also happen with older sdk levels. Now manually setting the target sdk level to 23, all permissions are off by default, I don't get prompted for any permissions either when trying to run manual plugin tests. Of course having no permissions on, certain plugin tests will fail. Turning them all on manually, everything passes. Documentation of the new permission model says that we'll need to add some code to check for permissions and request them. *On your apps that target the M Preview release or higher, make sure to check for and request permissions at runtime. To determine if your app has been granted a permission, call the newcheckSelfPermission() method. To request a permission, call the new requestPermissions() method. Even if your app is not targeting the M Preview release, you should test your app under the new permissions model.* The cordova permissions we'll need to handle are : - contacts - location - microphone - phone - storage Lastly testing Lollipop and older with API 23 looks fine. *TL;DR * Using M Preview with API 22 and older should be using the old permission model. All tests are passing except some strange behavior with the manual camera test which prompts for permission at runtime. Using M Preview with API 23 should use the new permission model where apps should request permission at runtime. Our cordova plugins will need to be updated to handle this. Using Lollipop and older with API 23 should use the old permission model. I didn't see any problems here. Regards, Karen
