diff options
author | alk3pInjection <webmaster@raspii.tech> | 2022-06-02 22:45:00 +0800 |
---|---|---|
committer | alk3pInjection <webmaster@raspii.tech> | 2022-06-02 22:45:00 +0800 |
commit | 25d4471d5c39da0bc5b512d3961b1e5fcb78bc68 (patch) | |
tree | 6f2dc1a54130278be2cc7f95b136f7f0c76adc60 | |
parent | f5b6f7ba72ac55770b59ca9e1ac41fd008517a35 (diff) | |
parent | a84b951bb7b1b736bdbcceabab0fb9fc3b8d3191 (diff) |
Merge tag 'LA.QSSI.12.0.r1-07600-qssi.0' into sugisawa-mr1
"LA.QSSI.12.0.r1-07600-qssi.0"
Change-Id: I96841331fe683b27f1f4b001da04d662179b1065
-rw-r--r-- | src/com/android/phone/settings/PhoneAccountSettingsFragment.java | 21 | ||||
-rw-r--r-- | src/com/android/services/telephony/TelephonyConnectionService.java | 17 |
2 files changed, 26 insertions, 12 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) { diff --git a/src/com/android/services/telephony/TelephonyConnectionService.java b/src/com/android/services/telephony/TelephonyConnectionService.java index a2beb7ddea..543e9340be 100644 --- a/src/com/android/services/telephony/TelephonyConnectionService.java +++ b/src/com/android/services/telephony/TelephonyConnectionService.java @@ -136,7 +136,7 @@ public class TelephonyConnectionService extends ConnectionService { } }; - private final BroadcastReceiver mTtyBroadcastReceiver = new BroadcastReceiver() { + private final BroadcastReceiver mBroadcastReceiver = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { String action = intent.getAction(); @@ -149,6 +149,14 @@ public class TelephonyConnectionService extends ConnectionService { if (isTtyNowEnabled != mIsTtyEnabled) { handleTtyModeChange(isTtyNowEnabled); } + } else if (ACTION_MSIM_VOICE_CAPABILITY_CHANGED.equals(action)) { + // Add extra to call if answering this incoming call would cause an in progress + // call on another subscription to be disconnected. + Connection ringingConnection = getRingingConnection(); + if (ringingConnection != null) { + maybeIndicateAnsweringWillDisconnect((TelephonyConnection)ringingConnection, + ringingConnection.getPhoneAccountHandle()); + } } } }; @@ -179,6 +187,8 @@ public class TelephonyConnectionService extends ConnectionService { @VisibleForTesting public Pair<WeakReference<TelephonyConnection>, Queue<Phone>> mEmergencyRetryCache; private DeviceState mDeviceState = new DeviceState(); + private final String ACTION_MSIM_VOICE_CAPABILITY_CHANGED = + "org.codeaurora.intent.action.MSIM_VOICE_CAPABILITY_CHANGED"; /** * Keeps track of the status of a SIM slot. @@ -605,13 +615,14 @@ public class TelephonyConnectionService extends ConnectionService { IntentFilter intentFilter = new IntentFilter( TelecomManager.ACTION_TTY_PREFERRED_MODE_CHANGED); - registerReceiver(mTtyBroadcastReceiver, intentFilter, + intentFilter.addAction(ACTION_MSIM_VOICE_CAPABILITY_CHANGED); + registerReceiver(mBroadcastReceiver, intentFilter, android.Manifest.permission.MODIFY_PHONE_STATE, null); } @Override public boolean onUnbind(Intent intent) { - unregisterReceiver(mTtyBroadcastReceiver); + unregisterReceiver(mBroadcastReceiver); return super.onUnbind(intent); } |