Merge "Check provider exists and is enabled when request location" into pi-dev am: 4c958d0e6b
am: 566987a3be

Change-Id: If27d5bbe87613a6c977787b668429359616391c1
diff --git a/services/core/java/com/android/server/location/GnssLocationProvider.java b/services/core/java/com/android/server/location/GnssLocationProvider.java
index ec5182d..756d06b 100644
--- a/services/core/java/com/android/server/location/GnssLocationProvider.java
+++ b/services/core/java/com/android/server/location/GnssLocationProvider.java
@@ -1063,6 +1063,12 @@
             locationListener = mFusedLocationListener;
         }
 
+        if (!locationManager.isProviderEnabled(provider)) {
+            Log.w(TAG, "Unable to request location since " + provider
+                    + " provider does not exist or is not enabled.");
+            return;
+        }
+
         Log.i(TAG,
                 String.format(
                         "GNSS HAL Requesting location updates from %s provider for %d millis.",