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

Commit c8bab82f authored by Nishith  Khanna's avatar Nishith Khanna
Browse files

Move our string modifications to e_strings.xml

parent 41b93115
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -60,7 +60,7 @@ public class UpdaterReceiver extends BroadcastReceiver {
        SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(context);
        String buildDate = StringGenerator.getDateLocalizedUTC(context,
                DateFormat.MEDIUM, preferences.getLong(Constants.PREF_INSTALL_NEW_TIMESTAMP, 0));
        String buildInfo = context.getString(R.string.list_build_version_date_e,
        String buildInfo = context.getString(R.string.e_list_build_version_date,
                BuildInfoUtils.getBuildVersion(), buildDate);

        Intent notificationIntent = new Intent(context, UpdatesActivity.class);
+1 −1
Original line number Diff line number Diff line
@@ -186,7 +186,7 @@ public class UpdatesActivity extends UpdatesListActivity implements UpdateImport
        }

        TextView headerTitle = findViewById(R.id.header_title);
        headerTitle.setText(getString(R.string.header_title_text_e,
        headerTitle.setText(getString(R.string.e_header_title_text,
                BuildInfoUtils.getDisplayVersion()));

        updateLastCheckedString();
+13 −13
Original line number Diff line number Diff line
@@ -250,7 +250,7 @@ public class UpdatesListAdapter extends RecyclerView.Adapter<UpdatesListAdapter.
        if (update == null) {
            // The update was deleted
            viewHolder.mAction.setEnabled(false);
            viewHolder.mAction.setText(Utils.isABDevice() ? R.string.action_update
            viewHolder.mAction.setText(Utils.isABDevice() ? R.string.e_action_update
                    : R.string.action_download);
            return;
        }
@@ -274,7 +274,7 @@ public class UpdatesListAdapter extends RecyclerView.Adapter<UpdatesListAdapter.

        String buildDate = StringGenerator.getDateLocalizedUTC(mActivity,
                DateFormat.LONG, update.getTimestamp());
        String buildVersion = mActivity.getString(R.string.list_build_version_e,
        String buildVersion = mActivity.getString(R.string.e_list_build_version,
                update.getDisplayVersion());

        if (!Build.VERSION.RELEASE.equals(update.getAndroidVersion())) {
@@ -345,10 +345,10 @@ public class UpdatesListAdapter extends RecyclerView.Adapter<UpdatesListAdapter.
            // Ignore if needed space is below 1 MB, like 0.25
            // We only show integer part to the user
            if (spaceNeeded >= 1) {
                String message = resources.getString(R.string.dialog_free_space_low_message_pct,
                String message = resources.getString(R.string.e_dialog_free_space_low_message_pct,
                        new DecimalFormat("# MB").format(spaceNeeded));
                return new AlertDialog.Builder(mActivity)
                        .setTitle(R.string.dialog_free_space_low_title)
                        .setTitle(R.string.e_dialog_free_space_low_title)
                        .setMessage(message)
                        .setPositiveButton(android.R.string.ok, null);
            }
@@ -373,7 +373,7 @@ public class UpdatesListAdapter extends RecyclerView.Adapter<UpdatesListAdapter.
                .setTitle(R.string.update_over_metered_network_title)
                .setMessage(R.string.update_over_metered_network_message)
                .setView(checkboxView)
                .setPositiveButton(Utils.isABDevice() ? R.string.action_update
                .setPositiveButton(Utils.isABDevice() ? R.string.e_action_update
                                : R.string.action_download,
                        (dialog, which) -> {
                            if (checkbox.isChecked()) {
@@ -393,7 +393,7 @@ public class UpdatesListAdapter extends RecyclerView.Adapter<UpdatesListAdapter.
        final View.OnClickListener clickListener;
        switch (action) {
            case DOWNLOAD:
                button.setText(Utils.isABDevice() ? R.string.action_update
                button.setText(Utils.isABDevice() ? R.string.e_action_update
                        : R.string.action_download);
                button.setEnabled(enabled);
                clickListener = enabled ? view -> {
@@ -543,36 +543,36 @@ public class UpdatesListAdapter extends RecyclerView.Adapter<UpdatesListAdapter.
                            mActivity, DateFormat.MEDIUM, update.getTimestamp());
            String buildInfoText =
                    mActivity.getString(
                            R.string.list_build_version_date, update.getVersion(), buildDate);
                            R.string.e_list_build_version_date, update.getVersion(), buildDate);

            if (Build.VERSION.RELEASE.equals(update.getAndroidVersion())) {
                title = R.string.apply_update_dialog_title;
                if (Utils.isABUpdate(update.getFile())) {
                    message =
                            mActivity.getString(
                                    R.string.apply_update_dialog_message_ab,
                                    R.string.e_apply_update_dialog_message_ab,
                                    buildInfoText,
                                    mActivity.getString(android.R.string.ok));
                } else {
                    message =
                            mActivity.getString(
                                    R.string.apply_update_dialog_message,
                                    R.string.e_apply_update_dialog_message,
                                    buildInfoText,
                                    mActivity.getString(android.R.string.ok));
                }
            } else {
                title = R.string.version_upgrade_dialog_title;
                title = R.string.e_version_upgrade_dialog_title;
                if (Utils.isABUpdate(update.getFile())) {
                    message =
                            mActivity.getString(
                                    R.string.version_upgrade_dialog_message_ab,
                                    R.string.e_version_upgrade_dialog_message_ab,
                                    buildInfoText,
                                    update.getAndroidVersion(),
                                    mActivity.getString(android.R.string.ok));
                } else {
                    message =
                            mActivity.getString(
                                    R.string.version_upgrade_dialog_message,
                                    R.string.e_version_upgrade_dialog_message,
                                    buildInfoText,
                                    update.getAndroidVersion(),
                                    mActivity.getString(android.R.string.ok));
@@ -614,7 +614,7 @@ public class UpdatesListAdapter extends RecyclerView.Adapter<UpdatesListAdapter.
        }
        new AlertDialog.Builder(mActivity)
                .setTitle(R.string.info_dialog_title)
                .setMessage(R.string.info_dialog_message_e)
                .setMessage(R.string.info_dialog_message)
                .setPositiveButton(R.string.info_dialog_ok, (dialog, which) -> preferences.edit()
                        .putBoolean(Constants.HAS_SEEN_INFO_DIALOG, true)
                        .apply())
+4 −4
Original line number Diff line number Diff line
@@ -389,7 +389,7 @@ public class UpdaterService extends Service {
                mNotificationBuilder.setStyle(null);
                mNotificationBuilder.setSmallIcon(R.drawable.ic_system_update);
                mNotificationBuilder.setProgress(0, 0, false);
                String text = getString(R.string.download_completed_notification_e);
                String text = getString(R.string.e_download_completed_notification);

                boolean hasRequiredSpace = Utils.availableFreeSpace() > (update.getFileSize() * 2);

@@ -400,7 +400,7 @@ public class UpdaterService extends Service {
                    if (!Utils.isBatteryLevelOk(this)) {
                        text = text + getString(R.string.dialog_battery_low_title);
                    } else if (!hasRequiredSpace) {
                        text = text + getString(R.string.dialog_free_space_low_title);
                        text = text + getString(R.string.e_dialog_free_space_low_title);
                    } else if (!Utils.canInstall(update)) {
                        text = text + getString(R.string.verification_failed_notification);
                    }
@@ -408,7 +408,7 @@ public class UpdaterService extends Service {
                    /* Add action to reboot and install for Non-A/B devices. */
                    mNotificationBuilder.mActions.clear();
                    mNotificationBuilder.addAction(R.drawable.ic_system_update,
                            getString(R.string.reboot_install),
                            getString(R.string.e_reboot_install),
                            getInstallationPendingIntent(update.getDownloadId()));
                }

@@ -578,7 +578,7 @@ public class UpdaterService extends Service {
    private void setNotificationTitle(UpdateInfo update) {
        String buildDate = StringGenerator.getDateLocalizedUTC(this,
                DateFormat.MEDIUM, update.getTimestamp());
        String buildInfo = getString(R.string.list_build_version_date_e,
        String buildInfo = getString(R.string.e_list_build_version_date,
                update.getVersion(), buildDate);
        mNotificationStyle.setBigContentTitle(buildInfo);
        mNotificationBuilder.setContentTitle(buildInfo);
+3 −3
Original line number Diff line number Diff line
@@ -245,11 +245,11 @@ public class Utils {
        String serverUrl = SystemProperties.get(Constants.PROP_UPDATER_URI);
        if (retrieveStatus(context) != null && retrieveStatus(context).equals("true")
                && isDevModeOn(context)) {
            serverUrl = context.getString(R.string.ota_staging_server_url);
            serverUrl = context.getString(R.string.e_ota_staging_server_url);
        }

        if (serverUrl.trim().isEmpty()) {
            serverUrl = context.getString(R.string.updater_server_url);
            serverUrl = context.getString(R.string.e_updater_server_url);
        }

        if (anonHash != null && !anonHash.isEmpty()) {
@@ -293,7 +293,7 @@ public class Utils {

    public static String getChangelogURL(Context context) {
        String buildVersion = SystemProperties.get(Constants.PROP_BUILD_VERSION);
        return context.getString(R.string.menu_changelog_url, buildVersion);
        return context.getString(R.string.e_menu_changelog_url, buildVersion);
    }

    public static void triggerUpdate(Context context, String downloadId) {
Loading