diff options
author | Alvin Dey <quic_alvidey@quicinc.com> | 2022-03-31 23:50:30 +0530 |
---|---|---|
committer | Alvin Dey <quic_alvidey@quicinc.com> | 2022-04-06 15:42:36 +0530 |
commit | e5ebcd9bacfb20a7c033df4107101b215c98cfac (patch) | |
tree | 75e5ee0adf99f924bff5d2aa4efb3fc1148d0204 | |
parent | 59a4c013191396967d9ac817509d92682310215d (diff) |
Fix for duplicate Vibrating button in single sim
- Issue is in PhoneAccountSettingsFragement we are not
setting preference based on number of sim, however in CallFeaturesSetting
we only add this for single sim case
- Fix is to remove it from this fragment in case of single sim
Change-Id: Iecb5ea6300d20c53bb23802459cf1f982b524d95
CRs-Fixed: 3150756
-rw-r--r-- | src/com/android/phone/settings/PhoneAccountSettingsFragment.java | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/src/com/android/phone/settings/PhoneAccountSettingsFragment.java b/src/com/android/phone/settings/PhoneAccountSettingsFragment.java index 39500e048e..64b219f204 100644 --- a/src/com/android/phone/settings/PhoneAccountSettingsFragment.java +++ b/src/com/android/phone/settings/PhoneAccountSettingsFragment.java @@ -382,6 +382,7 @@ public class PhoneAccountSettingsFragment extends PreferenceFragment } else { mAccountList.removePreference(mAllCallingAccounts); mMakeAndReceiveCallsCategory.removePreference(mDefaultOutgoingAccount); + mMakeAndReceiveCallsCategoryPresent = false; } if (isXdivertAvailable) { @@ -490,15 +491,17 @@ public class PhoneAccountSettingsFragment extends PreferenceFragment getPreferenceScreen().findPreference(SMART_FORWARDING_CONFIGURATION_PREF_KEY)); } - SwitchPreference vibratingButton = (SwitchPreference) - mMakeAndReceiveCallsCategory.findPreference(BUTTON_VIBRATING_KEY); - if (vibratingButton != null) { - mMakeAndReceiveCallsCategoryPresent = true; - final int vibrating = Settings.Global.getInt( - getActivity().getContentResolver(), - Settings.Global.VIBRATING_FOR_OUTGOING_CALL_ACCEPTED, 1); - vibratingButton.setChecked(vibrating != 0); - vibratingButton.setOnPreferenceChangeListener(this); + if (mButtonVibratingForMoCallAccepted != null) { + if (mTelephonyManager.isMultiSimEnabled()) { + mMakeAndReceiveCallsCategoryPresent = true; + final int vibrating = Settings.Global.getInt( + getActivity().getContentResolver(), + Settings.Global.VIBRATING_FOR_OUTGOING_CALL_ACCEPTED, 1); + mButtonVibratingForMoCallAccepted.setChecked(vibrating != 0); + mButtonVibratingForMoCallAccepted.setOnPreferenceChangeListener(this); + } else { + mMakeAndReceiveCallsCategory.removePreference(mButtonVibratingForMoCallAccepted); + } } if (!mMakeAndReceiveCallsCategoryPresent) { |