You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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 pinnedplay-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:GoogleApiClientsolely so itsonConnected()callback can request fused updates — the client itself is never used for any location API.Application.getLocation2()gates the fused path onclient.isConnected(), redundant with theGoogleApiAvailabilitycheck beside it.HomeActivity, search/region/trip-plan/report screens, map controllers,ObaRegionsTask,SurveyWebViewActivity) each carry anmGoogleApiClientfield with connect/disconnect lifecycle boilerplate, purely to pass it intoApplication.getLastKnownLocation(ctx, client).Specific bugs
LocationHelper(Context, int)constructor (used byNavigationServicefor 1-second destination-alert updates) never initializes its LocationRequestSurveyWebViewActivitycrashes inonStop()withUninitializedPropertyAccessExceptionon devices without Play Services.Proposed fix
Remove
GoogleApiCliententirely and useFusedLocationProviderClientdirectly (it needs no connection lifecycle), keeping theGoogleApiAvailabilityguards so devices without Play Services retain theLocationManagerfallback.Replace the deprecated
LocationRequest.create()/setPriority()/setInterval()/setFastestInterval()chain withLocationRequest.Builder.Addressed by Migrate location stack off deprecated GoogleApiClient to FusedLocationProviderClient #1569.