SUW: Remove hardcoded string references to LineageOS

* Use os_name string

Change-Id: I1d59482122d85e39aaa4cbf15ac9e43b8598251d
This commit is contained in:
Michael Bestas
2021-09-22 01:26:02 +03:00
parent 79ce7a4f62
commit 070a852f7d
4 changed files with 20 additions and 8 deletions

View File

@@ -43,6 +43,7 @@
android:layout_height="wrap_content">
<TextView
android:id="@+id/intro_restore_subtitle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/intro_restore_subtitle"

View File

@@ -65,11 +65,11 @@
<string name="accessibility_settings">Accessibility settings</string>
<string name="setup_services">LineageOS features</string>
<string name="services_explanation" product="tablet">These services work for you to extend the capabilities of your tablet. Data will be used in accordance with LineageOS\'s <xliff:g id="name" example="Privacy Policy">%s</xliff:g>.</string>
<string name="services_explanation" product="default">These services work for you to extend the capabilities of your phone. Data will be used in accordance with LineageOS\'s <xliff:g id="name" example="Privacy Policy">%s</xliff:g>.</string>
<string name="services_explanation" product="tablet">These services work for you to extend the capabilities of your tablet. Data will be used in accordance with <xliff:g id="name" example="LineageOS">%1$s</xliff:g>\'s <xliff:g id="name" example="Privacy Policy">%2$s</xliff:g>.</string>
<string name="services_explanation" product="default">These services work for you to extend the capabilities of your phone. Data will be used in accordance with <xliff:g id="name" example="LineageOS">%1$s</xliff:g>\'s <xliff:g id="name" example="Privacy Policy">%2$s</xliff:g>.</string>
<string name="services_privacy_policy">Privacy Policy</string>
<string name="services_help_improve_cm">Help improve <xliff:g id="name" example="LineageOS">%s</xliff:g></string>
<string name="services_metrics_label"><xliff:g id="name" example="Help improve LineageOS">%1$s</xliff:g> by automatically sending diagnostic and usage data to LineageOS. This information cant be used to identify you and lends a hand to teams working on things like battery life, app performance, and new <xliff:g id="name" example="LineageOS">%2$s</xliff:g> features.</string>
<string name="services_metrics_label"><xliff:g id="name" example="Help improve LineageOS">%1$s</xliff:g> by automatically sending diagnostic and usage data to <xliff:g id="name" example="LineageOS">%2$s</xliff:g>. This information cant be used to identify you and lends a hand to teams working on things like battery life, app performance, and new <xliff:g id="name" example="LineageOS">%3$s</xliff:g> features.</string>
<string name="services_os_nav_keys_label"><b>Use on screen navigation keys</b> instead of hardware keys.</string>
<!-- Biometric setup -->
@@ -95,8 +95,8 @@
<!-- Backup Restore -->
<string name="intro_restore_title">Restore apps and data</string>
<string name="intro_restore_subtitle" product="tablet">If you have a backup from your last LineageOS tablet, you can restore it here.</string>
<string name="intro_restore_subtitle" product="default">If you have a backup from your last LineageOS phone, you can restore it here.</string>
<string name="intro_restore_subtitle" product="tablet">If you have a backup from your last <xliff:g id="name" example="LineageOS">%s</xliff:g> tablet, you can restore it here.</string>
<string name="intro_restore_subtitle" product="default">If you have a backup from your last <xliff:g id="name" example="LineageOS">%s</xliff:g> phone, you can restore it here.</string>
<string name="intro_restore_button">Restore from backup</string>
<!-- Update Recovery -->

View File

@@ -72,8 +72,9 @@ public class LineageSettingsActivity extends BaseSetupWizardActivity {
super.onCreate(savedInstanceState);
mSetupWizardApp = (SetupWizardApp) getApplication();
setNextText(R.string.next);
String os_name = getString(R.string.os_name);
String privacy_policy = getString(R.string.services_privacy_policy);
String policySummary = getString(R.string.services_explanation, privacy_policy);
String policySummary = getString(R.string.services_explanation, os_name, privacy_policy);
SpannableString ss = new SpannableString(policySummary);
ClickableSpan clickableSpan = new ClickableSpan() {
@Override
@@ -100,9 +101,9 @@ public class LineageSettingsActivity extends BaseSetupWizardActivity {
View metricsRow = findViewById(R.id.metrics);
metricsRow.setOnClickListener(mMetricsClickListener);
String metricsHelpImproveLineage =
getString(R.string.services_help_improve_cm, getString(R.string.os_name));
getString(R.string.services_help_improve_cm, os_name);
String metricsSummary = getString(R.string.services_metrics_label,
metricsHelpImproveLineage, getString(R.string.os_name));
metricsHelpImproveLineage, os_name, os_name);
final SpannableStringBuilder metricsSpan = new SpannableStringBuilder(metricsSummary);
metricsSpan.setSpan(new android.text.style.StyleSpan(android.graphics.Typeface.BOLD),
0, metricsHelpImproveLineage.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);

View File

@@ -22,6 +22,8 @@ import static org.lineageos.setupwizard.SetupWizardApp.REQUEST_CODE_RESTORE;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.widget.TextView;
import com.google.android.setupcompat.util.WizardManagerHelper;
import static com.google.android.setupcompat.util.ResultCodes.RESULT_SKIP;
@@ -32,6 +34,14 @@ import org.lineageos.setupwizard.SubBaseActivity;
public class RestoreIntroActivity extends SubBaseActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
final TextView restoreSubtitle = (TextView) findViewById(R.id.intro_restore_subtitle);
restoreSubtitle.setText(getString(R.string.intro_restore_subtitle,
getString(R.string.os_name)));
}
@Override
protected void onStartSubactivity() {
setNextAllowed(true);