MO 呼叫

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/lf12345678910/article/details/54426000

frameworks/opt/telephony/../SIMRecords.java

    private void setSpnFromConfig(String carrier) {
        if (mSpnOverride.containsCarrier(carrier)) {
            log("setSpnFromConfig");
            setServiceProviderName(mSpnOverride.getSpn(carrier));
            mTelephonyManager.setSimOperatorNameForPhone(
                    mParentApp.getPhoneId(), getServiceProviderName());
        }
    }

packages/services/Telecomm/.../UserCallActivity.java

onCreate(

            new UserCallIntentProcessor(this, userHandle).processIntent(getIntent(),
                    getCallingPackage(), true /* hasCallAppOp*/);

)

packages/services/Telecomm/.../UserCallIntentProcessor.java

processIntent(  )

processOutgoingCallIntent()

sendBroadcastToReceiver( PrimaryCallReceiver.class )

packages/services/Telecomm/.../PrimaryCallReceiver.java

onReceive(

getTelecomSystem().getCallIntentProcessor().processIntent(intent);

)

packages/services/Telecomm/src/com/android/server/telecom/CallIntentProcessor.java

processIntent()

processOutgoingCallIntent(

        // Send to CallsManager to ensure the InCallUI gets kicked off before the broadcast returns
        Call call = callsManager
                .startOutgoingCall(handle, phoneAccountHandle, clientExtras, initiatingUser);

)

packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java  //接口,提供给应用的

 //Kicks off the first steps to creating an outgoing call so that InCallUI can launch.

startOutgoingCall( 

constructPossiblePhoneAccounts(List<PhoneAccountHandle> allAccounts =mPhoneAccountRegistrar.getCallCapablePhoneAccounts(scheme, false, user);)

call.setTargetPhoneAccount(phoneAccountHandle);

)
 

packages/app/ContactsCommon

TelecomManagerCompat.java

getPhoneAccount( telecomManager.getPhoneAccount(accountHandle); )

packages/services/telephony

TelecomAccountRegistry.java

setupAccounts( mAccounts.add(new AccountEntry() )

AccountEntry(Phone phone, boolean isEmergency, boolean isDummy) {
            mPhone = phone;
            mAccount = registerPstnPhoneAccount(isEmergency, isDummy);

}

registerPstnPhoneAccount(

 SubscriptionInfo record = mSubscriptionManager.getActiveSubscriptionInfo(subId);
 subDisplayName = record.getDisplayName();

 PhoneAccount account = PhoneAccount.builder(phoneAccountHandle, label)
                    .setAddress(Uri.fromParts(PhoneAccount.SCHEME_TEL, line1Number, null))
                    .setSubscriptionAddress(
                            Uri.fromParts(PhoneAccount.SCHEME_TEL, subNumber, null))
                    .setCapabilities(capabilities)
                    .setIcon(icon)
                    .setHighlightColor(color)
                    .setShortDescription(description)
                    .setSupportedUriSchemes(Arrays.asList(
                            PhoneAccount.SCHEME_TEL, PhoneAccount.SCHEME_VOICEMAIL))
                    .setExtras(instantLetteringExtras)
                    .build();

 // Register with Telecom and put into the account entry.
 mTelecomManager.registerPhoneAccount(account);

)

packages/servers/telecom

TelecomServiceImpl.java

registerPhoneAccount( mPhoneAccountRegistrar.registerPhoneAccount(account); )

getPhoneAccount(return mPhoneAccountRegistrar.getPhoneAccount(accountHandle, callingUserHandle,)

packages/servers/telecom

PhoneAccountRegistrar.java

registerPhoneAccount( addOrReplacePhoneAccount(account); )

addOrReplacePhoneAccount(

  mState.accounts.add(account);

  write(); ///data/user_de/0/com.android.server.telecom/files/phone-account-registrar-state.xml

)

getCallCapablePhoneAccounts(getPhoneAccounts())

getPhoneAccounts(for (PhoneAccount m : mState.accounts))

frameworks/base/telephony

SubscriptionManager.java

getActiveSubscriptionInfo( subInfo = iSub.getActiveSubscriptionInfo(subId, mContext.getOpPackageName()); )

frameworks/opt/telephony

SubscriptionController.java

getActiveSubscriptionInfo( getActiveSubscriptionInfoList() )

getSubInfo(SubscriptionManager.SIM_SLOT_INDEX + ">=0", null);

getSubInfo(

SubscriptionInfo subInfo = getSubInfoRecord(cursor);

)

getSubInfoRecord(

  String carrierName = cursor.getString(cursor.getColumnIndexOrThrow(SubscriptionManager.CARRIER_NAME));

return new SubscriptionInfo(id, iccId, simSlotIndex, displayName, carrierName,
                nameSource, iconTint, number, dataRoaming, iconBitmap, mcc, mnc, countryIso,
                simProvisioningStatus);

)

Android运营商名称显示之PLMN与SPN

PhoneAccount account = getAccountForCall(call);

PhoneAccountHandle accountHandle = call.getAccountHandle();

return TelecomManagerCompat.getPhoneAccount(
                InCallPresenter.getInstance().getTelecomManager(),
                accountHandle);

account.getLabel().toString();

SubscriptionManager.getActiveSubscriptionInfo();

SubscriptionInfo.getDisplayName();

猜你喜欢

转载自blog.csdn.net/lf12345678910/article/details/54426000
今日推荐