插双卡时紧急号码选择的sub

TelephonyConnectionService.java
getPhoneForAccount-》getFirstPhoneForEmergencyCall

private Phone getPhoneForAccount(PhoneAccountHandle accountHandle, boolean isEmergency) {
975 Phone chosenPhone = null;
976 if (isEmergency) {
977 return PhoneFactory.getPhone(PhoneUtils.getPhoneIdForECall());
978 }
979
980 int subId = PhoneUtils.getSubIdForPhoneAccountHandle(accountHandle);
981 if (subId != SubscriptionManager.INVALID_SUBSCRIPTION_ID) {
982 int phoneId = SubscriptionController.getInstance().getPhoneId(subId);
983 chosenPhone = PhoneFactory.getPhone(phoneId);
984 }
985 // If this is an emergency call and the phone we originally planned to make this call
986 // with is not in service or was invalid, try to find one that is in service, using the
987 // default as a last chance backup.
988 if (isEmergency && (chosenPhone == null || ServiceState.STATE_IN_SERVICE != chosenPhone
989 .getServiceState().getState())) {
990 Log.d(this, "getPhoneForAccount: phone for phone acct handle %s is out of service "
991 + “or invalid for emergency call.”, accountHandle);
992 chosenPhone = getFirstPhoneForEmergencyCall();
993 Log.d(this, "getPhoneForAccount: using subId: " +
994 (chosenPhone == null ? “null” : chosenPhone.getSubId()));
995 }
996 return chosenPhone;
997 }

猜你喜欢

转载自blog.csdn.net/dreamfly130/article/details/88821065