Example usage for android.location LocationManager clearTestProviderLocation

List of usage examples for android.location LocationManager clearTestProviderLocation

Introduction

In this page you can find the example usage for android.location LocationManager clearTestProviderLocation.

Prototype

public void clearTestProviderLocation(String provider) 

Source Link

Document

Removes any mock location associated with the given provider.

Usage

From source file:org.cowboycoders.cyclisimo.turbo.TurboService.java

private void disableLocationProvider(String provider) {
    LocationManager locationManager = (LocationManager) getApplicationContext()
            .getSystemService(Context.LOCATION_SERVICE);
    if (locationManager.isProviderEnabled(provider)) {
        try {//  w w w  .  j av  a2 s. c  om
            // is this the same as the below? probably
            locationManager.setTestProviderEnabled(provider, false);
            locationManager.clearTestProviderEnabled(provider);
            locationManager.clearTestProviderLocation(provider);
            locationManager.clearTestProviderStatus(provider);
            locationManager.removeTestProvider(provider);
        } catch (SecurityException e) {
            // ignore 
        }
    }
}