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

Commit 2ccf9518 authored by David's avatar David
Browse files

Fix issue where location_hardware_provider is delivered through the passive provider

-Causes CTS failure and churn in 3p aps.
Bug: 306942683
Test: atest LocationManagerServiceTest, atest LocationProviderManagerTest

Change-Id: Iaaa237524f5ec229b4a4b69bef63b0de4a42a013
parent 77589ba0
Loading
Loading
Loading
Loading
+3 −2
Original line number Original line Diff line number Diff line
@@ -467,13 +467,14 @@ public class LocationManagerService extends ILocationManager.Stub implements
                // If we have a GNSS provider override, add the hardware provider as a standalone
                // If we have a GNSS provider override, add the hardware provider as a standalone
                // option for use by apps with the correct permission. Note the GNSS HAL can only
                // option for use by apps with the correct permission. Note the GNSS HAL can only
                // support a single client, so mGnssManagerService.getGnssLocationProvider() can
                // support a single client, so mGnssManagerService.getGnssLocationProvider() can
                // only be installed with a single provider.
                // only be installed with a single provider. Locations from this provider won't
                // be reported through the passive provider.
                LocationProviderManager gnssHardwareManager =
                LocationProviderManager gnssHardwareManager =
                        new LocationProviderManager(
                        new LocationProviderManager(
                                mContext,
                                mContext,
                                mInjector,
                                mInjector,
                                GPS_HARDWARE_PROVIDER,
                                GPS_HARDWARE_PROVIDER,
                                mPassiveManager,
                                /*passiveManager=*/ null,
                                Collections.singletonList(Manifest.permission.LOCATION_HARDWARE));
                                Collections.singletonList(Manifest.permission.LOCATION_HARDWARE));
                addLocationProviderManager(
                addLocationProviderManager(
                        gnssHardwareManager, mGnssManagerService.getGnssLocationProvider());
                        gnssHardwareManager, mGnssManagerService.getGnssLocationProvider());