Snap for 6639787 from 837bda1f2523ffaf664f58357c5cbe5955c45e1d to rvc-release

Change-Id: I58a957e0da461e3a30f1fa0a30531c37bab8475d
diff --git a/res/values-ca/strings.xml b/res/values-ca/strings.xml
index c7c8533..6c655c1 100644
--- a/res/values-ca/strings.xml
+++ b/res/values-ca/strings.xml
@@ -1734,7 +1734,7 @@
     <string name="location_sources_heading" msgid="6126965815860570524">"Fonts d\'ubicació"</string>
     <string name="about_settings" product="tablet" msgid="2888705054709289693">"Informació sobre la tauleta"</string>
     <string name="about_settings" product="default" msgid="4038626127378127613">"Informació del telèfon"</string>
-    <string name="about_settings" product="device" msgid="9012888717090302815">"Informació sobre el dispositiu"</string>
+    <string name="about_settings" product="device" msgid="9012888717090302815">"Informació del dispositiu"</string>
     <string name="about_settings" product="emulator" msgid="2516560858771320366">"Sobre el dispositiu emulat"</string>
     <string name="about_settings_summary" msgid="4831942939227432513">"Mostra informació legal, estat, versió de programari"</string>
     <string name="legal_information" msgid="7509900979811934843">"Informació legal"</string>
diff --git a/res/values/arrays.xml b/res/values/arrays.xml
index 11d8bcf..1ad3cc3 100644
--- a/res/values/arrays.xml
+++ b/res/values/arrays.xml
@@ -104,10 +104,10 @@
     <string-array name="dark_ui_scheduler_preference_titles">
         <!-- 0: None -->
         <item>@string/dark_ui_auto_mode_never</item>
-        <!-- 1: Auto -->
-        <item>@string/dark_ui_auto_mode_auto</item>
-        <!-- 2: Custom -->
+        <!-- 1: Custom -->
         <item>@string/dark_ui_auto_mode_custom</item>
+        <!-- 2: Auto -->
+        <item>@string/dark_ui_auto_mode_auto</item>
     </string-array>
 
     <!-- Security settings.  The delay after screen is turned off until device locks.
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 1dbc0a0..4acfde3 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -12117,11 +12117,11 @@
     <!-- Content description for the 5G limited VoLTE dialog. [CHAR LIMIT=NONE] -->
     <string name="volte_5G_limited_text">This also turns off your 5G connection.\nDuring a voice call, you can\u2019t use the internet and some apps may not work.</string>
     <!-- Footer to show current limitation of 5G on DSDS mode. [CHAR LIMIT=NONE] -->
-    <string name="no_5g_in_dsds_text" product="default">When using 2 SIMs, this phone will be limited to 4G. <annotation id="url">Learn more</annotation>.</string>
+    <string name="no_5g_in_dsds_text" product="default">When using 2 SIMs, this phone will be limited to 4G. <annotation id="url">Learn more</annotation></string>
     <!-- Footer to show current limitation of 5G on DSDS mode for tablets. [CHAR LIMIT=NONE] -->
-    <string name="no_5g_in_dsds_text" product="tablet">When using 2 SIMs, this tablet will be limited to 4G. <annotation id="url">Learn more</annotation>.</string>
+    <string name="no_5g_in_dsds_text" product="tablet">When using 2 SIMs, this tablet will be limited to 4G. <annotation id="url">Learn more</annotation></string>
     <!-- Footer to show current limitation of 5G on DSDS mode for general devices. [CHAR LIMIT=NONE] -->
-    <string name="no_5g_in_dsds_text" product="device">When using 2 SIMs, this device will be limited to 4G. <annotation id="url">Learn more</annotation>.</string>
+    <string name="no_5g_in_dsds_text" product="device">When using 2 SIMs, this device will be limited to 4G. <annotation id="url">Learn more</annotation></string>
     <!-- Help URI, 5G limitation in DSDS condition. [DO NOT TRANSLATE] -->
     <string name="help_uri_5g_dsds" translatable="false"></string>
 
diff --git a/src/com/android/settings/network/telephony/NrDisabledInDsdsFooterPreferenceController.java b/src/com/android/settings/network/telephony/NrDisabledInDsdsFooterPreferenceController.java
index 4077e91..3911fb8 100644
--- a/src/com/android/settings/network/telephony/NrDisabledInDsdsFooterPreferenceController.java
+++ b/src/com/android/settings/network/telephony/NrDisabledInDsdsFooterPreferenceController.java
@@ -69,7 +69,7 @@
         if (linkInfo.isActionable()) {
             return AnnotationSpan.linkify(mContext.getText(R.string.no_5g_in_dsds_text), linkInfo);
         } else {
-            return mContext.getText(R.string.no_5g_in_dsds_text);
+            return AnnotationSpan.textWithoutLink(mContext.getText(R.string.no_5g_in_dsds_text));
         }
     }
 
diff --git a/src/com/android/settings/utils/AnnotationSpan.java b/src/com/android/settings/utils/AnnotationSpan.java
index 1b8179d..98256a0 100644
--- a/src/com/android/settings/utils/AnnotationSpan.java
+++ b/src/com/android/settings/utils/AnnotationSpan.java
@@ -27,6 +27,9 @@
 import android.util.Log;
 import android.view.View;
 
+import java.util.Arrays;
+import java.util.Comparator;
+
 /**
  * This class is used to add {@link View.OnClickListener} for the text been wrapped by
  * annotation.
@@ -76,6 +79,23 @@
     }
 
     /**
+     * get the text part without having text for link part
+     */
+    public static CharSequence textWithoutLink(CharSequence encodedText) {
+        SpannableString msg = new SpannableString(encodedText);
+        Annotation[] spans = msg.getSpans(0, msg.length(), Annotation.class);
+        if (spans == null) {
+            return encodedText;
+        }
+        Arrays.sort(spans, Comparator.comparingInt(span -> -msg.getSpanStart(span)));
+        StringBuilder msgWithoutLink = new StringBuilder(msg.toString());
+        for (Annotation span : spans) {
+            msgWithoutLink.delete(msg.getSpanStart(span), msg.getSpanEnd(span));
+        }
+        return msgWithoutLink.toString();
+    }
+
+    /**
      * Data class to store the annotation and the click action
      */
     public static class LinkInfo {
diff --git a/src/com/android/settings/wifi/details2/WifiDetailPreferenceController2.java b/src/com/android/settings/wifi/details2/WifiDetailPreferenceController2.java
index a884576..5c48dfd 100644
--- a/src/com/android/settings/wifi/details2/WifiDetailPreferenceController2.java
+++ b/src/com/android/settings/wifi/details2/WifiDetailPreferenceController2.java
@@ -631,21 +631,23 @@
     }
 
     private void refreshMacAddress() {
-        String macAddress = mWifiEntry.getMacAddress();
-        if (macAddress == null) {
+        final String macAddress = mWifiEntry.getMacAddress();
+        if (TextUtils.isEmpty(macAddress)) {
             mMacAddressPref.setVisible(false);
             return;
         }
 
         mMacAddressPref.setVisible(true);
+
+        mMacAddressPref.setTitle((mWifiEntry.getPrivacy() == WifiEntry.PRIVACY_RANDOMIZED_MAC)
+                ? R.string.wifi_advanced_randomized_mac_address_title
+                : R.string.wifi_advanced_device_mac_address_title);
+
         if (macAddress.equals(WifiInfo.DEFAULT_MAC_ADDRESS)) {
             mMacAddressPref.setSummary(R.string.device_info_not_available);
         } else {
             mMacAddressPref.setSummary(macAddress);
         }
-
-        // MAC Address Pref Title
-        refreshMacTitle();
     }
 
     private void updatePreference(Preference pref, String detailText) {
@@ -930,24 +932,6 @@
         }
     }
 
-    private void refreshMacTitle() {
-        if (!mWifiEntry.isSaved()) {
-            return;
-        }
-
-        // For saved Passpoint network, framework doesn't have the field to keep the MAC choice
-        // persistently, so Passpoint network will always use the default value so far, which is
-        // randomized MAC address, so don't need to modify title.
-        if (mWifiEntry.isSubscription()) {
-            return;
-        }
-
-        mMacAddressPref.setTitle(
-                (mWifiEntry.getPrivacy() == WifiEntry.PRIVACY_RANDOMIZED_MAC)
-                        ? R.string.wifi_advanced_randomized_mac_address_title
-                        : R.string.wifi_advanced_device_mac_address_title);
-    }
-
     /**
      * Indicates the state of the WifiEntry has changed and clients may retrieve updates through
      * the WifiEntry getter methods.