OSDN Git Service

Prevent startNavigating() call when GPS is off
authorDante Russo <drusso@codeaurora.org>
Mon, 20 Jun 2016 18:11:59 +0000 (11:11 -0700)
committerAarthi Thiruvengadam <athiru@google.com>
Tue, 21 Jun 2016 16:21:57 +0000 (09:21 -0700)
When system comes back from idle state,
GnssLocationProvider invokes startNavigating()
even when GPS is turned off in settings.

Bug: 29512509
Change-Id: Ifcc6a06d698f65f868d18244f7166663ab57f57e
CRs-Fixed: 1022372

services/core/java/com/android/server/location/GnssLocationProvider.java

index 6b916be..2fc14ec 100644 (file)
@@ -1192,7 +1192,7 @@ public class GnssLocationProvider implements LocationProviderInterface {
         }
 
         if (DEBUG) Log.d(TAG, "setRequest " + mProviderRequest);
-        if (mProviderRequest.reportLocation && !mDisableGps) {
+        if (mProviderRequest.reportLocation && !mDisableGps && isEnabled()) {
             // update client uids
             updateClientUids(mWorkSource);