[TIMOB-17329] Android: Refactor Camera API to not use a temporary file
GitHub Issue | n/a |
---|---|
Type | Improvement |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2014-08-18T18:25:27.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 3.4.0 |
Components | Android |
Labels | module_media, qe-manualtest |
Reporter | Ingo Muschenetz |
Assignee | Ping Wang |
Created | 2014-07-15T04:19:25.000+0000 |
Updated | 2014-08-18T18:25:27.000+0000 |
Description
In Titanium, we use temporary files when we are dealing with data that can not be kept in memory to avoid OOM errors. One case is in the Ti.Media module when the user takes pictures and the savetoPhotoGallery is set to false.
The blob representing the response (
media
property for the payload to the success callback) will clearly indicate if the blob represents a file (Titanium.Blob.file will return a valid Titanium.Filesystem.File object). Users are free to delete the file once they have processed the data.
We should refactor the API to not rely on the temporary file.
Test case from TIMOB-1510
CR + FR ok. Merged
3_3_X PR: https://github.com/appcelerator/titanium_mobile/pull/5935
Verified the refactor. The pics does not get saved as a temp file in the sdcard when "save to gallery" is false. Closing. Environment: Appc Studio : 3.4.0.201408051600 Ti SDK : 3.4.0.v20140815142514 Mac OSX : 10.8.5 Alloy : 1.4.1 CLI - 3.3.0 Code Processor: 1.1.1 Nexus 5 - android 4.4.4