//35.找到了吧,最初的构造数据是number //35.回到最初的起点 final Intent intent = new CallIntentBuilder(number).setCallInitiationType(LogState.INITIATION_DIALPAD).build();
IntentUtil.CallIntentBuilder
publicCallIntentBuilder(String number) {this(CallUtil.getCallUri(number)); } publicCallIntentBuilder(Uri uri) {mUri = uri; } public CallIntentBuilder setCallInitiationType(int initiationType) {mCallInitiationType = initiationType;returnthis; }public Intent build() {return getCallIntent(mUri,mPhoneAccountHandle,mIsVideoCall ? VideoProfile.STATE_BIDIRECTIONAL : VideoProfile.STATE_AUDIO_ONLY,mCallInitiationType); }/*** Create a call intent that can be used to place a call.* 构建intent,uri目标号码,* @param uri Address to place the call to.* @param accountHandle {@link PhoneAccountHandle} to place the call with.此处为空* @param videoState Initial video state of the call.好像是是否是video ?audio only* 初始化电话的类型,应该是有系统phone拨号和其他调用拨号之类的区分* @param callIntiationType The UI affordance the call was initiated by.* @return Call intent with provided extras and data.*/ publicstatic Intent getCallIntent(Uri uri, PhoneAccountHandle accountHandle, int videoState, int callIntiationType) {//String CALL_ACTION = Intent.ACTION_CALL;final Intent intent = new Intent(CALL_ACTION, uri);intent.putExtra(TelecomManager.EXTRA_START_CALL_WITH_VIDEO_STATE, videoState);final Bundle b = new Bundle();b.putInt(EXTRA_CALL_INITIATION_TYPE, callIntiationType);intent.putExtra(TelecomManager.EXTRA_OUTGOING_CALL_EXTRAS, b);if (accountHandle != null) {intent.putExtra(TelecomManager.EXTRA_PHONE_ACCOUNT_HANDLE, accountHandle);}return intent; }
public static boolean isUriNumber(String number) {// Note we allow either "@"or"%40" to indicate a URI, incase// the passed-in string is URI-escaped. (Neither "@" nor "%40"// will ever be found in a legal PSTN number.)return number != null && (number.contains("@") || number.contains("%40")); }