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

Commit b376b3b5 authored by destradaa's avatar destradaa
Browse files

Fix inconsistent permission check in LocationManager.

Ensures there is a consistent permission check between the LocationManager APIs:
- getProviders(Criteria, boolean)
- getAllProviders()

Bug: 24776299
Test: ran LocationManagerTest#testGetProviders from CTS
Change-Id: Ia0d5a510a6cdb34df1f53bb0b3885aa295ba51ae
parent 9840ea9a
Loading
Loading
Loading
Loading
+1 −12
Original line number Diff line number Diff line
@@ -1542,18 +1542,7 @@ public class LocationManagerService extends ILocationManager.Stub {
     */
    @Override
    public List<String> getAllProviders() {
        ArrayList<String> out;
        synchronized (mLock) {
            out = new ArrayList<>(mProviders.size());
            for (LocationProviderInterface provider : mProviders) {
                String name = provider.getName();
                if (LocationManager.FUSED_PROVIDER.equals(name)) {
                    continue;
                }
                out.add(name);
            }
        }

        List<String> out = getProviders(null /*criteria*/, false /*enabledOnly*/);
        if (D) Log.d(TAG, "getAllProviders()=" + out);
        return out;
    }