urbanairship-core/src/main/java/com/urbanairship/location/LocationService.java
private void onLocationUpdate(UAirship airship, @NonNull Intent intent) {
        // Fused location sometimes has an "Unmarshalling unknown type" runtime exception on 4.4.2 devices
        Location location;
        try {
            // If a provider is enabled or disabled notify the adapters so they can update providers.
            if (intent.hasExtra(LocationManager.KEY_PROVIDER_ENABLED)) {
                Logger.debug("LocationService - One of the location providers was enabled or disabled.");
                airship.getLocationManager().onSystemLocationProvidersChanged();
                return;
            }

            location = (Location) (intent.hasExtra(LocationManager.KEY_LOCATION_CHANGED) ?
                        intent.getParcelableExtra(LocationManager.KEY_LOCATION_CHANGED) :
                        intent.getParcelableExtra("com.google.android.location.LOCATION"));
        } catch (Exception e) {
            Logger.error("Unable to extract location.", e);
            return;
        }

        if (location != null) {
            airship.getLocationManager().onLocationUpdate(location);
        }
    }
/**
     * Called when an intent is received with action ACTION_LOCATION_UPDATE.
     *
     * @param intent The received intent.
     */
Called when an intent is received with action ACTION_LOCATION_UPDATE.
@param intent The received intent.
Called when an intent is received with action ACTION_LOCATION_UPDATE . @param intent The received intent .
private void onLocationUpdate(UAirship airship, @NonNull Intent intent) {
        Location location;
        try {
            if (intent.hasExtra(LocationManager.KEY_PROVIDER_ENABLED)) {
                Logger.debug("LocationService - One of the location providers was enabled or disabled.");
                airship.getLocationManager().onSystemLocationProvidersChanged();
                return;
            }
            location = (Location) (intent.hasExtra(LocationManager.KEY_LOCATION_CHANGED) ?
                        intent.getParcelableExtra(LocationManager.KEY_LOCATION_CHANGED) :
                        intent.getParcelableExtra("com.google.android.location.LOCATION"));
        } catch (Exception e) {
            Logger.error("Unable to extract location.", e);
            return;
        }
        if (location != null) {
            airship.getLocationManager().onLocationUpdate(location);
        }
    }
private void onLocationUpdate ( UAirship airship , @ NonNull Intent intent ) { Location location ; try { if ( intent . hasExtra ( LocationManager . KEY_PROVIDER_ENABLED ) ) { Logger . debug ( "LocationService - One of the location providers was enabled or disabled." ) ; airship . getLocationManager ( ) . onSystemLocationProvidersChanged ( ) ; return ; } location = ( Location ) ( intent . hasExtra ( LocationManager . KEY_LOCATION_CHANGED ) ? intent . getParcelableExtra ( LocationManager . KEY_LOCATION_CHANGED ) : intent . getParcelableExtra ( "com.google.android.location.LOCATION" ) ) ; } catch ( Exception e ) { Logger . error ( "Unable to extract location." , e ) ; return ; } if ( location != null ) { airship . getLocationManager ( ) . onLocationUpdate ( location ) ; } }
Called when an intent is received with action ACTION_LOCATION_UPDATE.
Called when an intent is received with action ACTION_LOCATION_UPDATE .
// Fused location sometimes has an "Unmarshalling unknown type" runtime exception on 4.4.2 devices // If a provider is enabled or disabled notify the adapters so they can update providers.