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

Commit 39b7eccc authored by Automerger Merge Worker's avatar Automerger Merge Worker
Browse files

Allow settingIgnored for DBH request if inEmergency am: 97e162d6 am: 8a1c944d am: 808ba9a7

Change-Id: Ife575824fafd2674b3c1114847d08cc42d0f848f
parents ec3f866b 808ba9a7
Loading
Loading
Loading
Loading
+6 −3
Original line number Original line Diff line number Diff line
@@ -80,7 +80,7 @@ class GnssConfiguration {


    // Represents an HAL interface version. Instances of this class are created in the JNI layer
    // Represents an HAL interface version. Instances of this class are created in the JNI layer
    // and returned through native methods.
    // and returned through native methods.
    private static class HalInterfaceVersion {
    static class HalInterfaceVersion {
        final int mMajor;
        final int mMajor;
        final int mMinor;
        final int mMinor;


@@ -206,6 +206,10 @@ class GnssConfiguration {
        native_set_satellite_blacklist(constellations, svids);
        native_set_satellite_blacklist(constellations, svids);
    }
    }


    HalInterfaceVersion getHalInterfaceVersion() {
        return native_get_gnss_configuration_version();
    }

    interface SetCarrierProperty {
    interface SetCarrierProperty {
        boolean set(int value);
        boolean set(int value);
    }
    }
@@ -232,8 +236,7 @@ class GnssConfiguration {


        logConfigurations();
        logConfigurations();


        final HalInterfaceVersion gnssConfigurationIfaceVersion =
        final HalInterfaceVersion gnssConfigurationIfaceVersion = getHalInterfaceVersion();
                native_get_gnss_configuration_version();
        if (gnssConfigurationIfaceVersion != null) {
        if (gnssConfigurationIfaceVersion != null) {
            // Set to a range checked value.
            // Set to a range checked value.
            if (isConfigEsExtensionSecSupported(gnssConfigurationIfaceVersion)
            if (isConfigEsExtensionSecSupported(gnssConfigurationIfaceVersion)
+9 −4
Original line number Original line Diff line number Diff line
@@ -807,11 +807,16 @@ public class GnssLocationProvider extends AbstractLocationProvider implements


        locationRequest.setProvider(provider);
        locationRequest.setProvider(provider);


        // Ignore location settings if in emergency mode.
        // Ignore location settings if in emergency mode. This is only allowed for
        if (isUserEmergency && mNIHandler.getInEmergency()) {
        // isUserEmergency request (introduced in HAL v2.0), or DBH request in HAL v1.1.
        if (mNIHandler.getInEmergency()) {
            GnssConfiguration.HalInterfaceVersion halVersion =
                    mGnssConfiguration.getHalInterfaceVersion();
            if (isUserEmergency || (halVersion.mMajor < 2 && !independentFromGnss)) {
                locationRequest.setLocationSettingsIgnored(true);
                locationRequest.setLocationSettingsIgnored(true);
                durationMillis *= EMERGENCY_LOCATION_UPDATE_DURATION_MULTIPLIER;
                durationMillis *= EMERGENCY_LOCATION_UPDATE_DURATION_MULTIPLIER;
            }
            }
        }


        Log.i(TAG,
        Log.i(TAG,
                String.format(
                String.format(