[TIMOB-16981] Android: Recent change to take picture only on valid focus is causing usability issues
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2014-06-28T02:19:58.000+0000 |
Affected Version/s | Release 3.3.0 |
Fix Version/s | Release 3.3.0, Release 3.4.0 |
Components | Android |
Labels | n/a |
Reporter | Dan Peleg |
Assignee | Ping Wang |
Created | 2014-05-02T17:16:57.000+0000 |
Updated | 2014-07-01T17:06:40.000+0000 |
Description
Since [Workaround for issue # 61394](https://github.com/appcelerator/titanium_mobile/commit/0fd8a0e78bd0aac8f1fcb78a9d1a7e08622fb977#commitcomment-6195276) _(I couldn't find issue 61394)_
Picture looks 100% focused and my call to Ti.Media.takePicture(); failed silently.
Took me more than 30 minutes to understand the some how I received the "Unable to focus" message.
I think there are 2 options of solving this.
1. Always take picture even if focus didn't succeed and just log on focus failure
2. Add a property that sais "Throw on focus failure" so it will throw an error that we can catch on the JavaScript and show the user.
There was a recent change in Titanium SDK 3.3.0 to work around Google bug 61394 (http://code.google.com/p/android/issues/detail?id=61394). It changes the current SDK behavior as a picture is only taken when auto focus is successful. No picture is taken when auto focus is not successful but there is no notification to the user. We need a better way to communicate this behavior to developers so that they can update their applications accordingly. https://github.com/appcelerator/titanium_mobile/commit/0fd8a0e78bd0aac8f1fcb78a9d1a7e08622fb977#commitcomment-6195276
I can't reproduce this on Nexus 5 (4.4) using the test case in TIMOB-1510. I'm able to take pictures without any problems.
Hey Hieu, That only happens when auto focus fails. Try different lighting conditions or distance. Let me know if you are able to reproduce. Dan
The issue is reproducible. If the camera does not focus & we take a picture then we get the following logs in the studio console
. with no visual indication/error of the problem. There is no way to find out without looking at the debug logs why the picture was not taken. Environment: Appc Studio : 3.3.0.201406171619 Ti SDK : 3.3.0.v20140620194913 Mac OSX : 10.8.5 Alloy : 1.4.0-rc2 CLI - 3.3.0-rc2 Code Processor: 1.1.1 Nexus 5 - android 4.4.4
Probably be useful to add a simple toast message.
Toast added: https://github.com/appcelerator/titanium_mobile/pull/5865
3_3_X PR: https://github.com/appcelerator/titanium_mobile/pull/5871
Verified the fix. The pic is taken even if the camera is unable to focus successfully & we get in the logs "Unable to focus". Closing. Environment: Appc Studio : 3.3.0.201406271159 Ti SDK : 3.3.0.v20140627202512 Mac OSX : 10.8.5 Alloy : 1.4.0-rc2 CLI - 3.3.0-rc4 Code Processor: 1.1.1 Nexus 5 - android 4.4.4