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

Commit 4f26eacc authored by laufersteppenwolf's avatar laufersteppenwolf Committed by Gerrit Code Review
Browse files

Fix GPS for old GPS HALs

Some old GPS HALs like the one on the Optimus 4x HD are broken without this
and can also cause bootloops (like on the 4x HD).
To enable this just add the following to your config.xml overlay:

<bool name="config_legacyGpsHAL">true</bool>

Change-Id: I80215f9a98a39b193159fb31686a57f83ae990a2
parent 9d87f94c
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -2044,6 +2044,9 @@
        <item>SUPL_MODE=1</item>
    </string-array>

    <!-- Enable support for legacy GPS HALs -->
    <bool name="config_legacyGpsHAL">false</bool>

    <!-- If there is no preload VM number in the sim card, carriers such as
         Verizon require to load a default vm number from the configurantion.
         Define config_default_vm_number for this purpose. And there are two
+1 −0
Original line number Diff line number Diff line
@@ -347,6 +347,7 @@
  <java-symbol type="bool" name="config_restricted_merge" />

  <java-symbol type="integer" name="config_wifi_framework_current_network_boost" />
  <java-symbol type="bool" name="config_legacyGpsHAL" />

  <java-symbol type="integer" name="config_bluetooth_max_advertisers" />
  <java-symbol type="integer" name="config_bluetooth_max_scan_filters" />
+9 −1
Original line number Diff line number Diff line
@@ -397,6 +397,9 @@ public class GpsLocationProvider implements LocationProviderInterface {

    private String mDefaultApn;

    // true for old GPS HALs
    private boolean mLegacyGpsHAL = false;

    // Wakelocks
    private final static String WAKELOCK_KEY = "GpsLocationProvider";
    private final PowerManager.WakeLock mWakeLock;
@@ -752,6 +755,10 @@ public class GpsLocationProvider implements LocationProviderInterface {
        mBatteryStats = IBatteryStats.Stub.asInterface(ServiceManager.getService(
                BatteryStats.SERVICE_NAME));

        // Check if we have a legacy GPS HAL
        mLegacyGpsHAL = mContext.getResources().getBoolean(
                com.android.internal.R.bool.config_legacyGpsHAL);

        mLastKnownMccMnc = getKnownMccMnc(mContext);

        // Load GPS configuration.
@@ -1127,7 +1134,8 @@ public class GpsLocationProvider implements LocationProviderInterface {
        }
        if (mSuplServerHost != null
                && mSuplServerPort > TCP_MIN_PORT
                && mSuplServerPort <= TCP_MAX_PORT) {
                && mSuplServerPort <= TCP_MAX_PORT
                && !mLegacyGpsHAL) {
            native_set_agps_server(AGPS_TYPE_SUPL, mSuplServerHost, mSuplServerPort);
        }
    }