Skip to content

Location stack still built on deprecated GoogleApiClient, blocking play-services-location upgrades #1570

@bmander

Description

@bmander

Summary

The location stack is still wired through GoogleApiClient, which Google deprecated in 2017 and has removed in current play-services-location majors. This hard-blocks upgrading Play Services dependencies past the currently pinned play-services-location:21.3.0.

Details

The codebase was half-migrated years ago: actual location calls already use FusedLocationProviderClient, but the old GoogleApiClient scaffolding around them was never removed:

  • util/LocationHelper.java builds and connects a GoogleApiClient solely so its onConnected() callback can request fused updates — the client itself is never used for any location API.
  • Application.getLocation2() gates the fused path on client.isConnected(), redundant with the GoogleApiAvailability check beside it.
  • ~10 Activities/Fragments (HomeActivity, search/region/trip-plan/report screens, map controllers, ObaRegionsTask, SurveyWebViewActivity) each carry an mGoogleApiClient field with connect/disconnect lifecycle boilerplate, purely to pass it into Application.getLastKnownLocation(ctx, client).

Specific bugs

  • The LocationHelper(Context, int) constructor (used by NavigationService for 1-second destination-alert updates) never initializes its LocationRequest
  • SurveyWebViewActivity crashes in onStop() with UninitializedPropertyAccessException on devices without Play Services.

Proposed fix

  • Remove GoogleApiClient entirely and use FusedLocationProviderClient directly (it needs no connection lifecycle), keeping the GoogleApiAvailability guards so devices without Play Services retain the LocationManager fallback.

  • Replace the deprecated LocationRequest.create()/setPriority()/setInterval()/setFastestInterval() chain with LocationRequest.Builder.

    Addressed by Migrate location stack off deprecated GoogleApiClient to FusedLocationProviderClient #1569.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions