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

Commit 350746f1 authored by Danny Baumann's avatar Danny Baumann
Browse files

Fix LTO availability check.

Change-Id: Ifb8ab65584df2f8b638b6e178e134b5e3a61cfce
parent 1680241c
Loading
Loading
Loading
Loading
+11 −2
Original line number Diff line number Diff line
@@ -140,7 +140,7 @@ public class LocationSettings extends LocationSettingsBase
        mGpsDownloadDataWifiOnly =
                (CheckBoxPreference) root.findPreference(KEY_GPS_DOWNLOAD_DATA_WIFI_ONLY);
        if (mGpsDownloadDataWifiOnly != null) {
            if (!LongTermOrbits.isSupported() || !checkGpsDownloadWiFiOnly(getActivity())) {
            if (!isLtoSupported() || !checkGpsDownloadWiFiOnly(getActivity())) {
                root.removePreference(mGpsDownloadDataWifiOnly);
                mGpsDownloadDataWifiOnly = null;
            } else {
@@ -326,7 +326,7 @@ public class LocationSettings extends LocationSettingsBase
     * @param ctx A valid context
     */
    public static void restore(final Context context) {
        if (LongTermOrbits.isSupported() && isLocationModeEnabled(context)) {
        if (isLtoSupported() && isLocationModeEnabled(context)) {
            // Check and adjust the value for Gps download data on wifi only
            checkGpsDownloadWiFiOnly(context);

@@ -340,4 +340,13 @@ public class LocationSettings extends LocationSettingsBase
            am.set(AlarmManager.RTC, nextLtoDownload, pi);
        }
    }

    private static boolean isLtoSupported() {
        try {
            return LongTermOrbits.isSupported();
        } catch (NoClassDefFoundError e) {
            // Hardware abstraction framework isn't installed
            return false;
        }
    }
}