Project: titanium
Issue TIMOB-19422: Android M: App crashes if using camera in device due to permissions
The problem is, the app doesn't prompt the user for permissions, and even if the permissions are set, the app crashes. h4. Steps to reproduce: 1. Use the sample app 2. ti build 3. it will show an error 4. Go to settings permissions, set the app permission such that storage = YES, camera = NO 5. App will crash *Note* if both permissions are set to YES MANUALLY like (4.), the app works. {code} Titanium.Media.showCamera({	success:function(event) {	// called when media returned from the camera	Ti.API.debug('Our type was: '+event.mediaType);	if(event.mediaType == Ti.Media.MEDIA_TYPE_PHOTO) {	var imageView = Ti.UI.createImageView({	width:win.width,	height:win.height,	image:event.media	});	win.add(imageView);	} else {	alert("got the wrong type back ="+event.mediaType);	}	},	cancel:function() {	// called when user cancels taking a picture	},	error:function(error) {	// called when there's an error	var a = Titanium.UI.createAlertDialog({title:'Camera'});	a.setMessage(JSON.stringify(error));	a.show();	},	saveToPhotoGallery:true }); {code}
Story points: 13