{ "id": "159258", "key": "TIMOB-23135", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "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": "19957", "description": "", "name": "Release 7.1.0", "archived": false, "released": true, "releaseDate": "2018-03-14" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2018-02-23T16:35:06.000+0000", "created": "2016-04-01T18:29:57.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "android" ], "versions": [ { "id": "17684", "name": "Release 5.2.1", "archived": false, "released": true, "releaseDate": "2016-03-25" } ], "issuelinks": [ { "id": "56188", "type": { "id": "10002", "name": "Duplicate", "inward": "is duplicated by", "outward": "duplicates" }, "inwardIssue": { "id": "170444", "key": "TIMOB-25558", "fields": { "summary": "Ti.Geolocation.locationServicesEnabled still returns false in Android.", "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": "Critical", "id": "1" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2018-03-06T22:34:06.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": "On an Android 6.0 device {{Ti.Geolocation.locationServicesEnabled}} will return {{false}} while it works fine. On an Android 4.4.4 emulator it returns {{true}} while it does not.\r\n\r\nMeanwhile [documentation|http://docs.appcelerator.com/platform/latest/#!/api/Titanium.Geolocation-property-locationServicesEnabled] says since Android 2.2 it will always return {{true}} because of the \"passive\" location provider but looking at the [source|http://docs.appcelerator.com/platform/latest/#!/api/Titanium.Geolocation-property-locationServicesEnabled] it filters that out.\r\n\r\n{code:js}\r\nvar win = Ti.UI.createWindow();\r\n\r\nvar btn = Ti.UI.createButton({\r\n title: 'Click Me'\r\n});\r\n\r\nbtn.addEventListener('click', function(e) {\r\n console.log('Ti.Geolocation.locationServicesEnabled ' + Ti.Geolocation.locationServicesEnabled);\r\n\r\n console.log('Ti.Geolocation.hasLocationPermissions() ' + Ti.Geolocation.hasLocationPermissions());\r\n\r\n if (Ti.Geolocation.hasLocationPermissions()) {\r\n getCurrentPosition();\r\n\r\n } else {\r\n Ti.Geolocation.requestLocationPermissions(null, getCurrentPosition);\r\n }\r\n});\r\n\r\nfunction getCurrentPosition() {\r\n Ti.Geolocation.getCurrentPosition(function(e) {\r\n console.log('Ti.Geolocation.getCurrentPosition() ' + JSON.stringify(e));\r\n });\r\n}\r\n\r\nwin.add(btn);\r\nwin.open();\r\n{code}\r\n\r\n*Android 6.1*\r\n\r\n{code}\r\n[INFO] Ti.Geolocation.locationServicesEnabled false\r\n[INFO] Ti.Geolocation.hasLocationPermissions() false\r\n[INFO] Ti.Geolocation.getCurrentPosition() {\"code\":0,\"provider\":{\"power\":1,\"name\":\"network\",\"accuracy\":2},\"coords\":{\"altitude\":0,\"speed\":0,\"longitude\":5.9043011,\"heading\":0,\"latitude\":52.9589968,\"timestamp\":1459535042207,\"altitudeAccuracy\":null,\"accuracy\":22.777000427246094},\"success\":true}\r\n{code}\r\n\r\n*Android 4.4.4*\r\n\r\n{code}\r\n[INFO] Ti.Geolocation.locationServicesEnabled true\r\n[INFO] Ti.Geolocation.hasLocationPermissions() true\r\n[ERROR] GeolocationModule: (KrollRuntimeThread) [3070,3070] Unable to get current position, location is null\r\n[INFO] Ti.Geolocation.getCurrentPosition() {\"error\":\"location is currently unavailable.\",\"success\":false,\"code\":6}\r\n{code}", "attachment": [], "flagged": false, "summary": "Android: \"locationServicesEnabled\" returns false when available on device", "creator": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "subtasks": [], "reporter": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "environment": "SDK 5.1.2.GA\r\nNexus 5 running Android 6.0.1", "closedSprints": [ { "id": 883, "state": "closed", "name": "2017 Sprint 09 SDK", "startDate": "2017-04-23T21:46:54.309Z", "endDate": "2017-05-07T21:46:00.000Z", "completeDate": "2017-05-08T00:25:44.276Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "414733", "author": { "name": "mchen", "key": "mchen", "displayName": "Maggie Chen", "active": true, "timeZone": "Asia/Singapore" }, "body": "PR https://github.com/appcelerator/titanium_mobile/pull/8903/", "updateAuthor": { "name": "mchen", "key": "mchen", "displayName": "Maggie Chen", "active": true, "timeZone": "Asia/Singapore" }, "created": "2017-03-22T13:21:38.000+0000", "updated": "2017-03-22T13:21:38.000+0000" }, { "id": "417449", "author": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "body": "FR passed.", "updateAuthor": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-04-14T22:26:47.000+0000", "updated": "2017-04-14T22:26:47.000+0000" }, { "id": "419341", "author": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Verified the fix.\r\n{{Ti.Geolocation.locationServicesEnabled}} returns {{true}} as expected.\r\n\r\nClosing.\r\n\r\nStudio Ver: 4.9.0.201704240654\r\nSDK Ver: 6.1.0.v20170508081747\r\nOS Ver: 10.12.3\r\nXcode Ver: Xcode 8.3.2\r\nAppc NPM: 4.2.9\r\nAppc CLI: 6.2.0\r\nTi CLI Ver: 5.0.12\r\nAlloy Ver: 1.9.11\r\nNode Ver: 6.10.1\r\nJava Ver: 1.8.0_101\r\nDevices: > google Nexus 6 --- Android 6.0.1\r\n > google Nexus 6P --- Android 7.1.1\r\n > Samsung galaxy S3 --- Android 4.4.2\r\n", "updateAuthor": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-05-08T21:54:58.000+0000", "updated": "2017-05-08T21:54:58.000+0000" }, { "id": "425055", "author": { "name": "adriano72", "key": "adriano72", "displayName": "Adriano Massi", "active": true, "timeZone": "Europe/Berlin" }, "body": "I still have this issue with 6.1.1.", "updateAuthor": { "name": "adriano72", "key": "adriano72", "displayName": "Adriano Massi", "active": true, "timeZone": "Europe/Berlin" }, "created": "2017-07-30T01:49:34.000+0000", "updated": "2017-07-30T01:49:34.000+0000" }, { "id": "425387", "author": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "body": "[~adriano72] Can you provide a little more detail about your particular case? We can look into it.\r\n", "updateAuthor": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-08-02T23:44:36.000+0000", "updated": "2017-08-02T23:44:36.000+0000" }, { "id": "431206", "author": { "name": "Suraj Datta", "key": "suraj datta", "displayName": "Suraj Datta", "active": true, "timeZone": "Indian/Mahe" }, "body": "Hello All,\r\n\r\nI'm still getting *false* with the use of Ti.Geolocation.locationServicesEnabled.\r\nTested this on Android device with os version 6 & 7.\r\nTurning Location services on or off returns same value.\r\n\r\nSteps i was performing to get location:\r\n1) checking for location permission using hasLocationPermissions() --- This works perfect\r\n2) Check whether location service is On/Off using Ti.Geolocation.locationServicesEnabled -- Returns false always.\r\n\r\nI'm using Titanium SDK: 6.3.0\r\n\r\nAny help would be appreciated.\r\nThanks.", "updateAuthor": { "name": "Suraj Datta", "key": "suraj datta", "displayName": "Suraj Datta", "active": true, "timeZone": "Indian/Mahe" }, "created": "2017-11-23T10:28:07.000+0000", "updated": "2017-11-23T10:28:07.000+0000" }, { "id": "431310", "author": { "name": "jceaser", "key": "jceaser", "displayName": "Joshua A. Ceaser", "active": true, "timeZone": "America/Los_Angeles" }, "body": "I'm having the same issue.", "updateAuthor": { "name": "jceaser", "key": "jceaser", "displayName": "Joshua A. Ceaser", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-11-27T19:13:14.000+0000", "updated": "2017-11-27T19:13:14.000+0000" }, { "id": "431311", "author": { "name": "jceaser", "key": "jceaser", "displayName": "Joshua A. Ceaser", "active": true, "timeZone": "America/Los_Angeles" }, "body": "I'm having the same issue, testing on Nexus 6 Android 7.1.1 and I'm able to reproduce this with SDK 6.3.0", "updateAuthor": { "name": "jceaser", "key": "jceaser", "displayName": "Joshua A. Ceaser", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-11-27T19:15:00.000+0000", "updated": "2017-11-27T19:15:00.000+0000" }, { "id": "431510", "author": { "name": "Suraj Datta", "key": "suraj datta", "displayName": "Suraj Datta", "active": true, "timeZone": "Indian/Mahe" }, "body": "Hi,\r\n\r\nDo we've any PR for this issue?", "updateAuthor": { "name": "Suraj Datta", "key": "suraj datta", "displayName": "Suraj Datta", "active": true, "timeZone": "Indian/Mahe" }, "created": "2017-11-30T05:54:53.000+0000", "updated": "2017-11-30T05:54:53.000+0000" }, { "id": "431520", "author": { "name": "mchen", "key": "mchen", "displayName": "Maggie Chen", "active": true, "timeZone": "Asia/Singapore" }, "body": "Hi all, I'm currently working on it. Sorry for the inconvenience, will update soon.", "updateAuthor": { "name": "mchen", "key": "mchen", "displayName": "Maggie Chen", "active": true, "timeZone": "Asia/Singapore" }, "created": "2017-11-30T11:38:03.000+0000", "updated": "2017-11-30T11:38:03.000+0000" }, { "id": "431522", "author": { "name": "mchen", "key": "mchen", "displayName": "Maggie Chen", "active": true, "timeZone": "Asia/Singapore" }, "body": "PR https://github.com/appcelerator/titanium_mobile/pull/9633", "updateAuthor": { "name": "mchen", "key": "mchen", "displayName": "Maggie Chen", "active": true, "timeZone": "Asia/Singapore" }, "created": "2017-11-30T12:26:34.000+0000", "updated": "2017-11-30T12:26:34.000+0000" }, { "id": "432069", "author": { "name": "mchen", "key": "mchen", "displayName": "Maggie Chen", "active": true, "timeZone": "Asia/Singapore" }, "body": "7_0_X PR https://github.com/appcelerator/titanium_mobile/pull/9682\r\n\r\n{color:red}[This PR has been closed.]{color}", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-12-13T03:47:22.000+0000", "updated": "2018-02-16T03:59:57.000+0000" }, { "id": "433255", "author": { "name": "jceaser", "key": "jceaser", "displayName": "Joshua A. Ceaser", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Can this be put in to the 7.0.2 release?", "updateAuthor": { "name": "jceaser", "key": "jceaser", "displayName": "Joshua A. Ceaser", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-01-17T16:07:27.000+0000", "updated": "2018-01-17T16:07:27.000+0000" }, { "id": "434554", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "PR (7.1.x): https://github.com/appcelerator/titanium_mobile/pull/9840", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-02-16T03:59:24.000+0000", "updated": "2018-02-16T03:59:24.000+0000" }, { "id": "434823", "author": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "body": "FR's passed.\r\nPR's merged.", "updateAuthor": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-02-23T16:34:59.000+0000", "updated": "2018-02-23T16:34:59.000+0000" }, { "id": "435271", "author": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Verified the fix in SDK 7.2.0.v20180305152636 & 7.1.0.v20180306061214.\r\n\r\nClosing.\r\n\r\nStudio Ver: 5.0.0.201712081732\r\nOS Ver: 10.13.2\r\nXcode Ver: Xcode 9.2\r\nAppc NPM: 4.2.12\r\nAppc CLI: 7.0.2\r\nDaemon Ver: 1.0.1\r\nTi CLI Ver: 5.0.14\r\nAlloy Ver: 1.11.0\r\nNode Ver: 8.9.1\r\nNPM Ver: 5.5.1\r\nJava Ver: 1.8.0_101\r\nDevices: ⇨ google Nexus 5 — Android 6.0.1\r\n⇨ google Nexus 6P — Android 8.0.0", "updateAuthor": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-03-06T22:34:01.000+0000", "updated": "2018-03-06T22:34:01.000+0000" } ], "maxResults": 16, "total": 16, "startAt": 0 } } }