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

Commit 2e18875d authored by Tomasz Wasilczyk's avatar Tomasz Wasilczyk
Browse files

GNSS is supported only when location feature is present

Bug: 239938937
Test: flash and boot aosp_raven without location feature
Change-Id: I0f2cd99bce32dc514532d6c13942700ad57dc9e1
parent c563ee2e
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -16,7 +16,6 @@

package com.android.server.location;

import static android.Manifest.permission.ACCESS_FINE_LOCATION;
import static android.Manifest.permission.INTERACT_ACROSS_USERS;
import static android.Manifest.permission.WRITE_SECURE_SETTINGS;
import static android.app.compat.CompatChanges.isChangeEnabled;
@@ -430,7 +429,9 @@ public class LocationManagerService extends ILocationManager.Stub implements

        // initialize gnss last because it has no awareness of boot phases and blindly assumes that
        // all other location providers are loaded at initialization
        if (GnssNative.isSupported()) {
        boolean hasLocationFeature = mContext.getPackageManager().hasSystemFeature(
                PackageManager.FEATURE_LOCATION);
        if (hasLocationFeature && GnssNative.isSupported()) {
            GnssConfiguration gnssConfiguration = new GnssConfiguration(mContext);
            GnssNative gnssNative = GnssNative.create(mInjector, gnssConfiguration);
            mGnssManagerService = new GnssManagerService(mContext, mInjector, gnssNative);