Merge "Fix infinite loop of launching Call accounts on multi-sim device"
diff --git a/src/com/android/phone/CallFeaturesSetting.java b/src/com/android/phone/CallFeaturesSetting.java
index c1bbf2d..92af129 100644
--- a/src/com/android/phone/CallFeaturesSetting.java
+++ b/src/com/android/phone/CallFeaturesSetting.java
@@ -236,6 +236,17 @@
         TelephonyManager telephonyManager = getSystemService(TelephonyManager.class)
                 .createForSubscriptionId(mPhone.getSubId());
 
+        // Note: The PhoneAccountSettingsActivity accessible via the
+        // android.telecom.action.CHANGE_PHONE_ACCOUNTS intent is accessible directly from
+        // the AOSP Dialer settings page on multi-sim devices.
+        // Where a device does NOT make the PhoneAccountSettingsActivity directly accessible from
+        // its Dialer app, this check must be modified in the device's AOSP branch to ensure that
+        // the PhoneAccountSettingsActivity is always accessible.
+        if (telephonyManager.isMultiSimEnabled()) {
+            Preference phoneAccountSettingsPreference = findPreference(PHONE_ACCOUNT_SETTINGS_KEY);
+            getPreferenceScreen().removePreference(phoneAccountSettingsPreference);
+        }
+
         PreferenceScreen prefSet = getPreferenceScreen();
         mVoicemailSettingsScreen =
                 (PreferenceScreen) findPreference(VOICEMAIL_SETTING_SCREEN_PREF_KEY);