[TIMOB-27742] Android: Minor camera focus issues
| GitHub Issue | n/a |
|---|---|
| Type | Bug |
| Priority | Medium |
| Status | Closed |
| Resolution | Fixed |
| Resolution Date | 2020-04-09T14:29:16.000+0000 |
| Affected Version/s | n/a |
| Fix Version/s | Release 9.0.1 |
| Components | Android |
| Labels | n/a |
| Reporter | Gary Mathews |
| Assignee | Gary Mathews |
| Created | 2020-01-28T18:51:38.000+0000 |
| Updated | 2020-06-18T11:46:39.000+0000 |
Description
- Camera should not crash with
E/TiExceptionHandler: (main) [55,37938] autoFocus failed
- Camera should continue to auto focus after taking a picture
*TEST CASE*
const overlay = Ti.UI.createView({});
const takePicture = Ti.UI.createButton({ title: 'Take Picture' });
takePicture.addEventListener('click', _ => {
Ti.Media.takePicture();
});
overlay.add(takePicture);
Ti.Media.requestCameraPermissions(e => {
if (e.success) {
Ti.Media.showCamera({
success: e => {
if (e.success) {
console.log('Taken picture successfully!');
} else {
console.error(JSON.stringify(e, null, 2));
}
},
saveToPhotoGallery: true,
autohide: false,
overlay: overlay,
mediaTypes: [ Ti.Media.MEDIA_TYPE_PHOTO ]
});
}
});
master: https://github.com/appcelerator/titanium_mobile/pull/11454
9_0_X: https://github.com/appcelerator/titanium_mobile/pull/11562
*Closing ticket.* Fix verified in SDK version 9.1.0.v20200406120646. and 9.0.1.v20200408050151. Tested using:
Test and other information can be found at: master: https://github.com/appcelerator/titanium_mobile/pull/11454 9_0_X: https://github.com/appcelerator/titanium_mobile/pull/11562const overlay = Ti.UI.createView({}); const takePicture = Ti.UI.createButton({ title: 'Take Picture' }); takePicture.addEventListener('click', _ => { Ti.Media.takePicture(); }); overlay.add(takePicture); function showCamera(e) { Ti.Media.showCamera({ success: e => { if (e.success) { console.log('Taken picture successfully!'); } else { console.error(JSON.stringify(e, null, 2)); } }, saveToPhotoGallery: true, autohide: false, overlay: overlay, mediaTypes: [ Ti.Media.MEDIA_TYPE_PHOTO ] }); } if (Ti.Media.hasCameraPermissions()) { showCamera(); } else { Ti.Media.requestCameraPermissions(e => { if (e.success) { showCamera(); } }); }