{ "id": "174677", "key": "TIMOB-27741", "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": "20949", "name": "Release 9.0.1", "archived": false, "released": true, "releaseDate": "2020-04-16" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2020-04-10T21:47:33.000+0000", "created": "2020-01-28T17:57:55.000+0000", "priority": { "name": "Low", "id": "4" }, "labels": [], "versions": [], "issuelinks": [ { "id": "58434", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "175160", "key": "TIMOB-27968", "fields": { "summary": "Ti.Media Test Suite: Titanium.Media TIMOB-27741 Android Only", "status": { "description": "The issue is open and ready for the assignee to start work on it.", "name": "Open", "id": "1", "statusCategory": { "id": 2, "key": "new", "colorName": "blue-gray", "name": "To Do" } }, "priority": { "name": "None", "id": "6" }, "issuetype": { "id": "10100", "description": "This Issue Type is used to create Zephyr Test within Jira.", "name": "Test", "subtask": false } } } } ], "assignee": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2020-06-18T12:16:18.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": "Allow {{requestPermissions}} to succeed when when permissions have already been granted. This prevents the need for calling {{hasPermissions}} and simplified code.\r\n\r\n*EXAMPLE*\r\n{code:js}\r\nconst overlay = Ti.UI.createView({});\r\nconst takePicture = Ti.UI.createButton({ title: 'Take Picture' });\r\n\r\ntakePicture.addEventListener('click', _ => {\r\n Ti.Media.takePicture();\r\n});\r\noverlay.add(takePicture);\r\n\r\n// Should not need to call 'hasCameraPermissions', 'requestCameraPermissions' should succeed.\r\nTi.Media.requestCameraPermissions(e => {\r\n if (e.success) {\r\n Ti.Media.showCamera({\r\n success: e => {\r\n if (e.success) {\r\n console.log('Taken picture successfully!');\r\n } else {\r\n console.error(JSON.stringify(e, null, 2));\r\n }\r\n },\r\n saveToPhotoGallery: true,\r\n autohide: false,\r\n overlay: overlay,\r\n mediaTypes: [ Ti.Media.MEDIA_TYPE_PHOTO ]\r\n });\r\n }\r\n});\r\n{code}", "attachment": [], "flagged": false, "summary": "Android: Allow requestPermissions to succeed if already granted", "creator": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "closedSprints": [ { "id": 1180, "state": "closed", "name": "2020 Sprint 4", "startDate": "2020-02-17T09:48:41.834Z", "endDate": "2020-02-28T09:48:00.000Z", "completeDate": "2020-02-28T17:07:21.344Z", "originBoardId": 114 }, { "id": 1181, "state": "closed", "name": "2020 Sprint 5", "startDate": "2020-03-02T18:45:02.513Z", "endDate": "2020-03-13T18:45:00.000Z", "completeDate": "2020-03-13T16:42:04.632Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "454417", "author": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "body": "master: https://github.com/appcelerator/titanium_mobile/pull/11496", "updateAuthor": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-02-25T00:17:45.000+0000", "updated": "2020-02-25T00:17:45.000+0000" }, { "id": "454811", "author": { "name": "ssaddique", "key": "ssaddique", "displayName": "Sohail Saddique", "active": true, "timeZone": "Europe/London" }, "body": "*FR: Pass*\r\n\r\n*Test Environment*\r\nSDK Ver: 8.3.1.GA & 9.0.0.GA & 9.1.0(this PR)\r\nOS Ver: 10.14.6\r\nAppc NPM: 5.0.0\r\nAppc CLI: 8.0.0\r\nDaemon Ver: 3.2.0\r\nTi CLI Ver: 5.2.2\r\nNode Ver: 10.17.0\r\nJava Ver: 1.8.0_162\r\nDevices: ⇨ Google Pixel 3a (Android 10)\r\nEmulators: Android 9 (API 28) and Android 10 (API 29)\r\n\r\n*Notes*\r\n* Permissions: WRITE_CALENDAR and WRITE_CONTACTS are required for Ti.Calendar and Ti.Contacts to execute correctly.\r\n* I also get these unnecessary warnings in the console as soon as the requests appear on-device (first-time launch):\r\n\r\n{code}\r\n[WARN] Calendar: (main) Calendar permissions are missing\r\n[WARN] TiCommonContactsApi: (main) Contact permissions are missing\r\n{code}\r\n\r\nApart from these notes, the test case passes successfully with this PR.", "updateAuthor": { "name": "ssaddique", "key": "ssaddique", "displayName": "Sohail Saddique", "active": true, "timeZone": "Europe/London" }, "created": "2020-03-23T14:34:41.000+0000", "updated": "2020-03-23T14:36:45.000+0000" }, { "id": "454845", "author": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "body": "9_0_X: https://github.com/appcelerator/titanium_mobile/pull/11563", "updateAuthor": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-03-24T21:42:15.000+0000", "updated": "2020-03-24T21:42:15.000+0000" }, { "id": "454929", "author": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Reopening so 9_0_X back port can be tested. ", "updateAuthor": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-04-01T13:03:38.000+0000", "updated": "2020-04-01T13:03:38.000+0000" }, { "id": "455044", "author": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "body": "FR Passed, Waiting on Jenkins build", "updateAuthor": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-04-09T12:47:07.000+0000", "updated": "2020-04-09T12:47:07.000+0000" }, { "id": "455047", "author": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "body": "merged to master and 9_0_X", "updateAuthor": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "created": "2020-04-09T13:55:30.000+0000", "updated": "2020-04-09T13:55:30.000+0000" }, { "id": "455087", "author": { "name": "ssekhri", "key": "ssekhri", "displayName": "Satyam Sekhri", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Verified on:\r\nMac OS: 10.15.4\r\nSDK: 9.0.1.v20200409100807, 9.1.0.v20200409073825\r\nAppc CLI: 8.0.0\r\nJDK: 11.0.4\r\nNode: 10.17.0\r\nStudio: 6.0.0.202003132109\r\nDevice: Nexus4(v5.1.1) device, Pixel3(v10.0) emulator, ", "updateAuthor": { "name": "ssekhri", "key": "ssekhri", "displayName": "Satyam Sekhri", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-04-10T21:47:33.000+0000", "updated": "2020-04-10T21:47:33.000+0000" } ], "maxResults": 8, "total": 8, "startAt": 0 } } }