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

Commit c87acfba authored by Sooraj S's avatar Sooraj S 👽
Browse files

Fix android upgrade String

parent eec990a1
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -113,9 +113,9 @@
    <string name="apply_update_dialog_message_ab">You are about to upgrade to <xliff:g id="update_name">%1$s</xliff:g>.\n\nIf you press <xliff:g id="ok">%2$s</xliff:g>, the device will begin installing in the background.\n\nOnce completed, you will be prompted to reboot.</string>

    <string name="apply_upgrade_dialog_title">Upgrade to /e/OS based on Android 10</string>
    <string name="apply_upgrade_dialog_message">You are about to upgrade your phone to a more recent version of /e/OS that is derived from Android 10. It will update your device's firmware to a more recent version. This upgrade will give you access to system updates and security patches for at least 3 more years.\n\nConsequently, this update will be longer than usual as it updates more components. Your device may reboot multiple times, and will encrypt your data if they are not already.</string>
    <string name="apply_upgrade_dialog_message_ab">You are about to upgrade your phone to a more recent version of /e/OS that is derived from Android 10. It will update your device's firmware to a more recent version. This upgrade will give you access to system updates and security patches for at least 3 more years.\n\nConsequently, this update will be longer than usual as it updates more components. Your device may reboot multiple times, and will encrypt your data if they are not already.</string>

    <string name="apply_upgrade_dialog_message">You are about to upgrade your phone to a more recent version of /e/OS that is derived from Android 10. It will update your device\'s firmware to a more recent version. This upgrade will give you access to system updates and security patches for at least 3 more years.\n\nConsequently, this update will be longer than usual as it updates more components. Your device may reboot multiple times, and will encrypt your data if they are not already.</string>
<!--     <string name="apply_upgrade_dialog_message_ab">You are about to upgrade your phone to a more recent version of /e/OS that is derived from Android 10. It will update your device/'s firmware to a more recent version. This upgrade will give you access to system updates and security patches for at least 3 more years.\n\nConsequently, this update will be longer than usual as it updates more components. Your device may reboot multiple times, and will encrypt your data if they are not already.</string>
 -->
    <string name="cancel_installation_dialog_message">Cancel the installation?</string>

    <string name="label_download_url">Download URL</string>
+17 −38
Original line number Diff line number Diff line
@@ -81,18 +81,20 @@ public class Utils {
    }

    public static boolean isVersionUpgrade(UpdateBaseInfo update) {
        if (update.getUpgradeSupported()) {
            Log.d(TAG, " is_upgrade_supported :" + update.getUpgradeSupported());
            Log.d(TAG, " Check for newer Android version ");

            if (!update.getReleaseVersion().equals(SystemProperties.get(Constants.PROP_BUILD_RELEASE_VERSION))) {
            // Update upgrade = new Update();
                Log.d(TAG, update.getName() + " android_version :" + update.getReleaseVersion());
                Version deviceAndroidVersion = new Version(SystemProperties.get(Constants.PROP_BUILD_RELEASE_VERSION));
                Version updateAndroidVersion = new Version(update.getReleaseVersion());
                if (updateAndroidVersion.compareTo(deviceAndroidVersion)==1){
                    Log.d(TAG, " newer Android version is available");
                // upgrade.setUpgrade(true);
                    return true;
                }
                Log.d(TAG, " Same or old Android version ");
            // upgrade.setUpgrade(false);
            }
        }
        return false;
    }
@@ -111,11 +113,7 @@ public class Utils {
        update.setDisplayVersion(object.getString("display_version"));
        update.setReleaseVersion(object.getString("android_version"));
        update.setUpgradeSupported(object.getBoolean("is_upgrade_supported"));
        if(isVersionUpgrade(update))
            update.setUpgrade(true);
        else
            update.setUpgrade(false);

        update.setUpgrade(isVersionUpgrade(update));
        return update;
    }
    
@@ -129,27 +127,8 @@ public class Utils {
            Log.d(TAG, update.getName() + " has type " + update.getType());
            return false;
        }
        if (update.getUpgradeSupported()) {
            Log.d(TAG, " is_upgrade_supported :" + update.getUpgradeSupported());
            Log.d(TAG, " Check for newer Android version ");

            // if (!update.getReleaseVersion().equals(SystemProperties.get(Constants.PROP_BUILD_RELEASE_VERSION))) {
            //     // Update upgrade = new Update();
            //     Log.d(TAG, update.getName() + " android_version :" + update.getReleaseVersion());
            //     Version deviceAndroidVersion = new Version(SystemProperties.get(Constants.PROP_BUILD_RELEASE_VERSION));
            //     Version updateAndroidVersion = new Version(update.getReleaseVersion());
            //     if (updateAndroidVersion.compareTo(deviceAndroidVersion)==1){
            //         Log.d(TAG, " newer Android version is available");
            //         // upgrade.setUpgrade(true);
            //         return true;
            //     }
            //     Log.d(TAG, " Same or old Android version ");
            //     // upgrade.setUpgrade(false);
            // }

            if(isVersionUpgrade(update))
        if(update.getUpgrade())
            return true;
        }

        return true;
    }