{ "id": "175375", "key": "TIMOB-28049", "fields": { "issuetype": { "id": "7", "description": "gh.issue.story.desc", "name": "Story", "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": "10000", "description": "", "name": "Done" }, "resolutiondate": "2020-09-19T06:09:32.000+0000", "created": "2020-07-25T01:20:26.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", "location", "permission" ], "versions": [], "issuelinks": [ { "id": "58707", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "175512", "key": "TIMOB-28114", "fields": { "summary": "TiAPI: Geolocation Parity", "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": "High", "id": "2" }, "issuetype": { "id": "6", "description": "gh.issue.epic.desc", "name": "Epic", "subtask": false } } } } ], "assignee": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2020-11-03T15:22:08.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\nSupposedly, Android 11 will no longer show a permission request dialog for the {{ACCESS_BACKGROUND_LOCATION}} permission. We need to confirm this.\r\nhttps://developer.android.com/preview/privacy/location#background-location-permission-dialog-changes\r\n\r\nIf true, then the only way to enable permission is to go to the app's \"Location Permissions\" activity under system settings. This very well maybe true because according to Google's developer blog below, they will be removing apps using this permission from Google Play unless they provide a valid reason and pass Google's review process.\r\nhttps://android-developers.googleblog.com/2020/02/safer-location-access.html\r\n\r\n*Note 1:*\r\nWe might be able to reach the app's \"Location Permission\" activity under system settings via the following intent action.\r\n{{ACTION_LOCATION_SOURCE_SETTINGS}}\r\n\r\n*Note 2:*\r\nWe may need to expose Android's [shouldShowRequestPermissionRationale ()|https://developer.android.com/reference/android/app/Activity.html#shouldShowRequestPermissionRationale(java.lang.String)] API. Normally, this method would return {{true}} if the end-user tapped on \"Disallow\" in the permission request dialog. On Android 11, this might always return {{true}} for the {{ACCESS_BACKGROUND_LOCATION}} where you would have to tell the end-user how to enable it under system settings.\r\n", "attachment": [ { "id": "67527", "filename": "Android11-AllLocationPermissions.png", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-09-05T03:35:01.000+0000", "size": 171003, "mimeType": "image/png" }, { "id": "67526", "filename": "Android11-BackgroundLocationPermission.png", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-09-05T03:35:01.000+0000", "size": 166667, "mimeType": "image/png" }, { "id": "67534", "filename": "GeolocationGpsService.js", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-09-11T00:32:13.000+0000", "size": 419, "mimeType": "application/x-javascript" }, { "id": "67535", "filename": "GeolocationGpsTest.js", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-09-11T00:32:14.000+0000", "size": 5482, "mimeType": "application/x-javascript" }, { "id": "67536", "filename": "tiapp.xml", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-09-11T00:32:14.000+0000", "size": 1083, "mimeType": "text/xml" } ], "flagged": false, "summary": "Android: Investigate \"ACCESS_BACKGROUND_LOCATION\" handling on Android 11", "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, "closedSprints": [ { "id": 1205, "state": "closed", "name": "2020 Sprint 18", "startDate": "2020-08-31T15:45:10.220Z", "endDate": "2020-09-11T15:45:00.000Z", "completeDate": "2020-09-11T19:56:20.674Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "456746", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Here are my test results...\r\n\r\nIf you call {{requestPermission()}} for {{ACCESS_BACKGROUND_LOCATION}} and the app has *+NOT+* been granted {{ACCESS_COARSE_LOCATION}} or {{ACCESS_FINE_LOCATION}} permission, then a dialog will *+NOT+* appear and the method will report the permission as denied. This behavior exists on Android 10 as well. So, this is not an Android 11 breaking-change.\r\n\r\nIf the app was granted the {{ACCESS_COARSE_LOCATION}} or {{ACCESS_FINE_LOCATION}} permission first and then you call {{requestPermission()}} for {{ACCESS_BACKGROUND_LOCATION}}, then a dialog will appear as shown below. What's different in Android 11 is the end-user must tap on the \"*Allow in setting*\" link to enable location access in the background. This is the major Android 11 change, but it doesn't require anyone to change their native or JS code to support this. Google merely added more steps to the UI to enable it on their end.\r\n !Android11-BackgroundLocationPermission.png|thumbnail! \r\n\r\n*Side Note:*\r\nA better solution for Android 10 and 11 would be to request for all 3 location permissions at once like the below. If you do, then a dialog will always appear... unless the end-user denied it several times already.\r\n{code:javascript}\r\nvar permissions = [\r\n\t\"android.permission.ACCESS_COARSE_LOCATION\",\r\n\t\"android.permission.ACCESS_FINE_LOCATION\",\r\n];\r\nif (Ti.Platform.Android.API_LEVEL >= 29) {\r\n\tpermissions.push(\"android.permission.ACCESS_BACKGROUND_LOCATION\");\r\n}\r\nTi.Android.requestPermissions(permissions, function(e) {\r\n\talert(\"Has Location Permissions: \" + e.success);\r\n});\r\n{code}\r\n !Android11-AllLocationPermissions.png|thumbnail! \r\n\r\nWe should update our \"Background Location Service Example\" in our docs (link below) to request {{ACCESS_BACKGROUND_LOCATION}} as shown above.\r\nhttps://docs.appcelerator.com/platform/latest/#!/api/Titanium.Android.Service\r\n\r\n*Final Notes:*\r\nWe do not need to use a {{ACTION_LOCATION_SOURCE_SETTINGS}} intent to enable {{ACCESS_BACKGROUND_LOCATION}}. The \"Allow in settings\" link in the permission request dialog will take the end-user to that screen for us.\r\n\r\nWe don't need to add a {{shouldShowRequestPermissionRationale()}} method. It's actually not helpful in this case.\r\n", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-09-05T04:02:53.000+0000", "updated": "2020-09-05T04:02:53.000+0000" }, { "id": "456831", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "The current plan is to improve the Ti.Geolocation parity between Android and iOS, while also improving our APIs to make it easier to access the GPS in the background on both platform. This will be handled by the epic [TIMOB-28114].\r\n\r\n\\\\\r\nFor now, the attached files below is an example of how to access GPS data in the background on both Android and iOS. This correctly works on Android 11 and older OS versions as well as iOS 14 and older iOS versions.\r\n* [^tiapp.xml] \r\n* [^GeolocationGpsTest.js] \r\n* [^GeolocationGpsService.js] ", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-09-10T20:28:00.000+0000", "updated": "2020-09-11T00:35:42.000+0000" }, { "id": "456952", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "The release version of Android 11 has completely changed behavior. It no longer displays a \"Show in settings\" link option as shown in the dialog screenshots above.\r\n\r\nMore importantly, you can no longer ask for {{\"ACCESS_BACKGROUND_LOCATION\"}} and {{\"ACCESS_FINE_LOCATION\"}} in the same request anymore or else it will fail if you don't have any location permission at all. This is a breaking-change in the release version of Android 11. You now must request {{\"ACCESS_FINE_LOCATION\"}} first and then {{\"ACCESS_BACKGROUND_LOCATION\"}} second.\r\n\r\nNote that our docs currently suggest devs to do this already.\r\nhttps://docs.appcelerator.com/platform/latest/#!/api/Titanium.Android.Service\r\n", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-09-19T06:09:07.000+0000", "updated": "2020-09-19T06:09:07.000+0000" }, { "id": "457419", "author": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket as investigation is complete. If this is a mistake feel free to reopen. ", "updateAuthor": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-11-03T15:22:02.000+0000", "updated": "2020-11-03T15:22:02.000+0000" } ], "maxResults": 4, "total": 4, "startAt": 0 } } }