[TIMOB-7456] Android: Update TiLocationHelper.isValidProvider(String) since PASSIVE_PROVIDER is introduced
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2012-07-05T06:34:52.000+0000 |
Affected Version/s | Release 2.0.0 |
Fix Version/s | Sprint 2012-05, Release 2.0.0 |
Components | Android |
Labels | module_geolocation, qe-testadded |
Reporter | Ping Wang |
Assignee | Opie Cyrus |
Created | 2012-01-27T14:54:26.000+0000 |
Updated | 2012-07-05T15:23:09.000+0000 |
Description
A new location provider, PASSIVE_PROVIDER, is introduced since API 8 (2.2) (http://developer.android.com/reference/android/location/LocationManager.html#PASSIVE_PROVIDER). We should add a constant for this provider, and update the platform behavior, such as TiLocationHelper.isValidProvider(String). Need further investigation to see whether there are more methods to be updated.
Would it be possible to expose isValidProvider as public or provide some sort of public function to allow us to check individual providers? I'd love to be able to find out if GPS or Network are turned on/off, since Titanium.Geolocation.locationServicesEnabled always returns true because of the PASSIVE_PROVIDER.
Test app.js:
If you turn off GPS and network (airplane mode) in the device settings, this line should be true. Otherwise under with either of them on this value should be true.
Verified fixed with 2.0.0.v20120319003254 and Titanium Studio, build: 2.0.0.201203182248. Airplane mode plus turning off GPS and Wireless positioning returned "false".
Re-opening to edit label.