Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e66c493b authored by Brad Ebinger's avatar Brad Ebinger Committed by android-build-merger
Browse files

Make addExistingConnection MSIM aware

am: 92d32918

Change-Id: Ia69971e089e60a9e908024e883c7e268c650ae97
parents f911c83c 92d32918
Loading
Loading
Loading
Loading
+12 −3
Original line number Diff line number Diff line
@@ -823,9 +823,18 @@ public class ConnectionServiceWrapper extends ServiceBinder implements
                    }
                    // Allow the Sim call manager account as well, even if its disabled.
                    if (phoneAccountHandle == null && callingPhoneAccountHandle != null) {
                        if (callingPhoneAccountHandle.equals(
                                mPhoneAccountRegistrar.getSimCallManager(userHandle))) {
                            phoneAccountHandle = callingPhoneAccountHandle;
                        // Search all SIM PhoneAccounts to see if there is a SIM call manager
                        // associated with any of them and verify that the calling handle matches.
                        for (PhoneAccountHandle handle :
                                mPhoneAccountRegistrar.getSimPhoneAccounts(userHandle)) {
                            int subId = mPhoneAccountRegistrar.getSubscriptionIdForPhoneAccount(
                                    handle);
                            PhoneAccountHandle connectionMgrHandle =
                                    mPhoneAccountRegistrar.getSimCallManager(subId, userHandle);
                            if (callingPhoneAccountHandle.equals(connectionMgrHandle)) {
                                phoneAccountHandle = connectionMgrHandle;
                                break;
                            }
                        }
                    }
                    if (phoneAccountHandle != null) {