{ "id": "109503", "key": "TIMOB-15930", "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": [], "resolution": null, "resolutiondate": null, "created": "2013-02-11T17:37:53.000+0000", "priority": null, "labels": [ "android", "geolocation" ], "versions": [], "issuelinks": [], "assignee": null, "updated": "2018-02-28T20:04:00.000+0000", "status": { "description": "This issue was once resolved, but the resolution was deemed incorrect. From here issues are either marked assigned or resolved.", "name": "Reopened", "id": "4", "statusCategory": { "id": 2, "key": "new", "colorName": "blue-gray", "name": "To Do" } }, "components": [ { "id": "10202", "name": "Android", "description": "Android Platform" } ], "description": "If the registered providers are turned off in settings , a stale location is returned and the Rules dont handle it even if it is very old.\r\nFor eg. If I have registered for GPS and Network only , and both are turned off on phone , last known location is returned which can be very old and \r\n maxAge set in rules doesn't block it. Also this cached location has provider set as the original provider (i.e. gps or network) which actually should \r\nbe passive.\r\nEDIT Feb 13 2013:\r\n{code}\r\nTitanium.Geolocation.Android.manualMode = true;\r\n\t\r\n\t\r\n\tvar providerGps = Ti.Geolocation.Android.createLocationProvider(\r\n\t\t\t\t{\r\n \t\t\t\t name: Ti.Geolocation.PROVIDER_GPS,\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\r\n\tvar providerNetwork = Ti.Geolocation.Android.createLocationProvider(\r\n\t\t\t\t{\r\n \t\t\t\t name: Ti.Geolocation.PROVIDER_NETWORK,\t\r\n\t\t\t\t});\r\n\t//add the providers\r\n\tTi.Geolocation.Android.addLocationProvider(providerGps);\r\n\tTi.Geolocation.Android.addLocationProvider(providerNetwork);\r\n\t\r\n\tvar maxAgeMili = 1 * 60 * 1000; // 1 minute\r\n\tvar minAgeMili = 1 * 1000;\t\t//1 second\r\n\t\r\n\tvar gpsRule = Ti.Geolocation.Android.createLocationRule(\r\n\t\t\t\t\t\t{\r\n \t\t\t\t\t\t provider: Ti.Geolocation.PROVIDER_GPS,\r\n \t\t\t\t\t\t accuracy: 50,\r\n \t\t\t\t\t\t maxAge: maxAgeMili,\r\n \t\t\t\t\t\t minAge: minAgeMili\r\n\t\t\t\t\t\t});\r\n\tvar networkRule = Ti.Geolocation.Android.createLocationRule(\r\n\t\t\t\t\t\t{\r\n \t\t\t\t\t\t provider: Ti.Geolocation.PROVIDER_NETWORK,\r\n \t\t\t\t\t\t accuracy: 50,\r\n \t\t\t\t\t\t maxAge: maxAgeMili,\r\n \t\t\t\t\t\t minAge: minAgeMili\r\n\t\t\t\t\t\t});\r\n\tTi.Geolocation.Android.addLocationRule(gpsRule);\r\n\tTi.Geolocation.Android.addLocationRule(networkRule);\r\nTitanium.Geolocation.addEventListener('location',function(e){\r\n //Process location\r\n});\r\n{code}\r\nNow while testing the above code on android device (using Samsung Galaxy ACE) , if both the location providers are turned off (i.e. GPS and network) in settings , we receive a stale location . That location should have been filtered by rules but in this case does not happen.\r\nAlso the provider set in the received location is 'gps' or 'network' which should now be 'passive'.", "attachment": [], "flagged": false, "summary": "Getting stale location if providers turned off , irrespective of LocationRule", "creator": { "name": "abhinavv", "key": "abhinavv", "displayName": "Abhinav Tyagi", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "abhinavv", "key": "abhinavv", "displayName": "Abhinav Tyagi", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "android", "comment": { "comments": [ { "id": "238218", "author": { "name": "clathrop", "key": "clathrop", "displayName": "Carter Lathrop", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Can you please provide a test case that shows this bug, unable to reproduce without more information.\r\n\r\nThank you", "updateAuthor": { "name": "clathrop", "key": "clathrop", "displayName": "Carter Lathrop", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-02-12T21:08:33.000+0000", "updated": "2013-02-12T21:08:33.000+0000" }, { "id": "238324", "author": { "name": "abhinavv", "key": "abhinavv", "displayName": "Abhinav Tyagi", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Edited the description. Please let me know if further information is needed.", "updateAuthor": { "name": "abhinavv", "key": "abhinavv", "displayName": "Abhinav Tyagi", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-02-13T11:20:17.000+0000", "updated": "2013-02-13T11:20:17.000+0000" } ], "maxResults": 4, "total": 4, "startAt": 0 } } }