breautek commented on code in PR #85:
URL:
https://github.com/apache/cordova-plugin-geolocation/pull/85#discussion_r1325968597
##########
src/android/Geolocation.java:
##########
@@ -102,6 +113,16 @@ public void requestPermissions(int requestCode)
PermissionHelper.requestPermissions(this, requestCode, permissions);
}
-
+ private boolean isGPSdisabled() {
+ boolean gps_enabled;
+ try {
+ gps_enabled =
mLocationManager.isProviderEnabled(LocationManager.GPS_PROVIDER);
Review Comment:
This PR will effectively enforce the GPS hardware requirement by requiring
GPS_PROVIDER to be enabled.
The GPS_PROVIDER is what provides the GPS updates via satellites, but this
isn't the only way to obtain GPS updates (however it is the most accurate once
the triangulation is fixed). Forcing GPS_PROVIDER however is an application
detail, not something that should be done at a framework/library level.
`GPS_PROVIDER` isn't an indication that location services is "off".
The proper way to check if location services is enabled is via:
https://developer.android.com/reference/androidx/core/location/LocationManagerCompat#isLocationEnabled(android.location.LocationManager)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]