{ "id": "175385", "key": "TIMOB-28059", "fields": { "issuetype": { "id": "4", "description": "An improvement or enhancement to an existing feature or task.", "name": "Improvement", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [ { "id": "21052", "description": "", "name": "Release 9.3.0", "archived": false, "released": true, "releaseDate": "2020-12-14" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2020-10-22T22:19:42.000+0000", "created": "2020-07-30T04:52:40.000+0000", "epic": { "id": 175371, "key": "TIMOB-28045", "name": "Android 11: Implement Support", "summary": "Android 11: Implement Support", "color": { "key": "color_3" }, "done": false }, "priority": { "name": "High", "id": "2" }, "labels": [ "android", "camera", "media", "photo", "storage", "video" ], "versions": [], "issuelinks": [ { "id": "58795", "type": { "id": "10000", "name": "Blocks", "inward": "is blocked by", "outward": "blocks" }, "outwardIssue": { "id": "175384", "key": "TIMOB-28058", "fields": { "summary": "Android: Change Ti.Filesystem \"temp\" APIs to use app's cache folder", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "priority": { "name": "High", "id": "2" }, "issuetype": { "id": "4", "description": "An improvement or enhancement to an existing feature or task.", "name": "Improvement", "subtask": false } } } }, { "id": "58819", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "175630", "key": "TIMOB-28183", "fields": { "summary": "Android: Add Ti.Media.requestPhotoGalleryPermissions() support", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "priority": { "name": "Medium", "id": "3" }, "issuetype": { "id": "4", "description": "An improvement or enhancement to an existing feature or task.", "name": "Improvement", "subtask": false } } } } ], "assignee": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2020-10-22T22:19:42.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "10202", "name": "Android", "description": "Android Platform" } ], "description": "*Summary:*\r\nThe following APIs can write to file outside of the app's sandbox on external storage and need to be changed for Android 11.\r\n* {{Ti.Media.showCamera()}}\r\n* {{Ti.Media.saveToPhotoGallery()}}\r\n\r\n*To-Do:*\r\nRemove usage of the following Java APIs for Android 10 and above...\r\n* [Environment.getExternalStorageDirectory()|https://developer.android.com/reference/android/os/Environment#getExternalStorageDirectory()]\r\n* [Environment.getExternalStoragePublicDirectory()|https://developer.android.com/reference/android/os/Environment#getExternalStoragePublicDirectory(java.lang.String)]\r\n\r\nWhen using an external camera app, it would be better to let it save the photo to its default location and then use a Java {{ContentResolver}} to access the photo's {{InputStream}}.\r\nhttps://developer.android.com/training/camera/photobasics\r\n\r\nFor saving a photo to the gallery...\r\n* Use [ContentResolver.openOutputStream()|https://developer.android.com/reference/android/content/ContentResolver#openOutputStream(android.net.Uri)] on Android 10.\r\n* Use [MediaStore.createWriteRequest()|https://developer.android.com/reference/android/provider/MediaStore#createWriteRequest(android.content.ContentResolver,%20java.util.Collection)] on Android 11.\r\n", "attachment": [ { "id": "67576", "filename": "CameraPhotoExternalTest.js", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-10-01T21:28:49.000+0000", "size": 984, "mimeType": "application/x-javascript" }, { "id": "67580", "filename": "CameraPhotoInternalTest.js", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-10-01T22:08:02.000+0000", "size": 1465, "mimeType": "application/x-javascript" }, { "id": "67578", "filename": "CameraVideoExternalTest.js", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-10-01T21:28:49.000+0000", "size": 1095, "mimeType": "application/x-javascript" }, { "id": "67581", "filename": "CameraVideoInternalTest.js", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-10-01T22:08:02.000+0000", "size": 1841, "mimeType": "application/x-javascript" }, { "id": "67598", "filename": "ImageToGalleryTest.js", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-10-10T04:36:37.000+0000", "size": 870, "mimeType": "application/x-javascript" }, { "id": "67596", "filename": "Screenshot_1602166786.png", "author": { "name": "ssaddique", "key": "ssaddique", "displayName": "Sohail Saddique", "active": true, "timeZone": "Europe/London" }, "created": "2020-10-08T14:23:40.000+0000", "size": 67687, "mimeType": "image/png" } ], "flagged": false, "summary": "Android: Modify Ti.Media APIs to use scoped storage", "creator": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "457107", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "PR (master): https://github.com/appcelerator/titanium_mobile/pull/12143", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-10-01T07:40:41.000+0000", "updated": "2020-10-01T07:40:41.000+0000" }, { "id": "457202", "author": { "name": "ssaddique", "key": "ssaddique", "displayName": "Sohail Saddique", "active": true, "timeZone": "Europe/London" }, "body": "[~jquick] I carried out some extensive testing of this PR and can confirm the fixes are mostly okay.\r\n\r\nHowever, on this particular section of this PR, saved images/screenshots to the photo gallery are not seen unless restarting the emulator (Android 4.4 - 9.0). No restart is required for Android 10/11.\r\n\r\nThis message appears for Android versions < 10. But the screenshot is actually present in the gallery if the emulator is restarted.\r\n\r\n !Screenshot_1602166786.png|thumbnail! ", "updateAuthor": { "name": "ssaddique", "key": "ssaddique", "displayName": "Sohail Saddique", "active": true, "timeZone": "Europe/London" }, "created": "2020-10-08T09:58:05.000+0000", "updated": "2020-10-08T14:34:18.000+0000" }, { "id": "457222", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "[~ssaddique], you're right.\r\n\r\nOn Android 6 to Android 9, it will fail to save to the gallery if the app was not granted {{WRITE_EXTERNAL_STORAGE}} permission. This permission is only not needed on Android 10 and higher.\r\n\r\nOn Android 4.4, there is a bug on Google's end (link below) where it will fail if you've never saved a photo/video on the device before. It's happening because the photo directory doesn't exist. I can only reproduce it by formatting external storage (aka: the SD card). I can fix this issue in Titanium by creating the directory tree if missing.\r\nhttps://issuetracker.google.com/issues/37002888\r\n\r\nI'll try to get this PR fixed by your Monday. Thanks!", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-10-09T02:08:43.000+0000", "updated": "2020-10-09T02:08:43.000+0000" }, { "id": "457234", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "[~ssaddique], the PR has been updated. Can you re-run all of the tests on the PR please? I've also updated the attached [^ImageToGalleryTest.js] script to use the {{Ti.Media.requestPhotoGalleryPermissions()}} method on Android, which was newly added to that PR and covers ticket [TIMOB-28183].", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-10-10T04:39:43.000+0000", "updated": "2020-10-10T04:39:43.000+0000" }, { "id": "457242", "author": { "name": "ssaddique", "key": "ssaddique", "displayName": "Sohail Saddique", "active": true, "timeZone": "Europe/London" }, "body": "Fixes look good. FR passed and PR merged.", "updateAuthor": { "name": "ssaddique", "key": "ssaddique", "displayName": "Sohail Saddique", "active": true, "timeZone": "Europe/London" }, "created": "2020-10-13T13:30:04.000+0000", "updated": "2020-10-13T13:30:04.000+0000" }, { "id": "457313", "author": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Verified the fix with SDK 9.3.0.v20201022111908.\r\nClosing.", "updateAuthor": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-10-22T22:19:35.000+0000", "updated": "2020-10-22T22:19:35.000+0000" } ], "maxResults": 6, "total": 6, "startAt": 0 } } }