Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a2223baf authored by David Christie's avatar David Christie Committed by Android Git Automerger
Browse files

am 8810a0c3: am 69b9eff1: Merge "Update Quick Settings to use new consolidated...

am 8810a0c3: am 69b9eff1: Merge "Update Quick Settings to use new consolidated master location method. This is an effort to consolidate the logic of what the "master location switch" means.  Quick settings will no longeer explicitly enable/disable gps and network prov

* commit '8810a0c3':
  Update Quick Settings to use new consolidated master location method. This is an effort to consolidate the logic of what the "master location switch" means.  Quick settings will no longeer explicitly enable/disable gps and network providers.
parents c45bf8f7 8810a0c3
Loading
Loading
Loading
Loading
+4 −11
Original line number Diff line number Diff line
@@ -126,12 +126,9 @@ public class LocationController extends BroadcastReceiver {
            return;
        }
        final ContentResolver cr = mContext.getContentResolver();
        Settings.Secure.setLocationProviderEnabled(
                cr, LocationManager.GPS_PROVIDER, enabled);
        // When enabling the NETWORK_PROVIDER, a user consent dialog will pop up, and the
        // setting won't actually be enabled until the user accepts the agreement.
        Settings.Secure.setLocationProviderEnabled(
                cr, LocationManager.NETWORK_PROVIDER, enabled);
        // When enabling location, a user consent dialog will pop up, and the
        // setting won't be fully enabled until the user accepts the agreement.
        Settings.Secure.setLocationMasterSwitchEnabled(cr, enabled);
    }

    /**
@@ -139,11 +136,7 @@ public class LocationController extends BroadcastReceiver {
     */
    public boolean isLocationEnabled() {
        ContentResolver contentResolver = mContext.getContentResolver();
        boolean isGpsEnabled = Settings.Secure.isLocationProviderEnabled(
                contentResolver, LocationManager.GPS_PROVIDER);
        boolean isNetworkEnabled = Settings.Secure.isLocationProviderEnabled(
                contentResolver, LocationManager.NETWORK_PROVIDER);
       return isGpsEnabled || isNetworkEnabled;
        return Settings.Secure.isLocationMasterSwitchEnabled(contentResolver);
    }

    /**