當前位置: 首頁>>代碼示例>>Java>>正文


Java Filter.rewritePhoneNumber方法代碼示例

本文整理匯總了Java中com.csipsimple.models.Filter.rewritePhoneNumber方法的典型用法代碼示例。如果您正苦於以下問題:Java Filter.rewritePhoneNumber方法的具體用法?Java Filter.rewritePhoneNumber怎麽用?Java Filter.rewritePhoneNumber使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.csipsimple.models.Filter的用法示例。


在下文中一共展示了Filter.rewritePhoneNumber方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: convertToString

import com.csipsimple.models.Filter; //導入方法依賴的package包/類
@Override
 public final CharSequence convertToString(Cursor cursor) {
 	CharSequence number = ContactsWrapper.getInstance().transformToSipUri(mContext, cursor);
     boolean isExternalPhone = ContactsWrapper.getInstance().isExternalPhoneNumber(mContext, cursor);
 	if(!TextUtils.isEmpty(number) && isExternalPhone) {
 	    String stripNbr = PhoneNumberUtils.stripSeparators(number.toString());
return Filter.rewritePhoneNumber(mContext, currentAccId, stripNbr);
 	}
 	return number;
 }
 
開發者ID:treasure-lau,項目名稱:CSipSimple,代碼行數:11,代碼來源:ContactsSearchAdapter.java

示例2: rewriteNumber

import com.csipsimple.models.Filter; //導入方法依賴的package包/類
private String rewriteNumber(String number) {
    SipProfile acc = accountChooserButton.getSelectedAccount();
    if (acc == null) {
        return number;
    }
    String numberRewrite = Filter.rewritePhoneNumber(getActivity(), acc.id, number);
    if(TextUtils.isEmpty(numberRewrite)) {
        return "";
    }
    ParsedSipContactInfos finalCallee = acc.formatCalleeNumber(numberRewrite);
    if(!TextUtils.isEmpty(finalCallee.displayName)) {
        return finalCallee.toString();
    }
    return finalCallee.getReadableSipUri();
}
 
開發者ID:treasure-lau,項目名稱:CSipSimple,代碼行數:16,代碼來源:DialerFragment.java

示例3: rewriteNumber

import com.csipsimple.models.Filter; //導入方法依賴的package包/類
/**
 * Rewrite a number for this calling entry
 * @param number The number to rewrite
 * @return Rewritten number.
 */
public String rewriteNumber(String number) {
    if(ignoreRewritting) {
        return number;
    }else {
        return Filter.rewritePhoneNumber(getContext(), account.id, number);
    }
}
 
開發者ID:treasure-lau,項目名稱:CSipSimple,代碼行數:13,代碼來源:AccountsLoader.java

示例4: applyNumbersToCSip

import com.csipsimple.models.Filter; //導入方法依賴的package包/類
private void applyNumbersToCSip(String groupName, int flag, String domain, long profileId) {
    Log.d(THIS_FILE, "Apply numbers to csip " + groupName + " > " + domain);
    ContactsWrapper cw = ContactsWrapper.getInstance();
    Cursor c = cw.getContactsByGroup(mContext, groupName);
    try {
        while (c.moveToNext()) {
            long contactId = c.getLong(c.getColumnIndex(Contacts._ID));
            List<Phone> phones = cw.getPhoneNumbers(mContext, contactId, flag);
            if(phones.size() > 0){
                String nbr = phones.get(0).getNumber();
                if(!nbr.contains("@")){
                    if(flag == ContactsWrapper.URI_NBR) {
                        // Apply rewriting rules
                        nbr = Filter.rewritePhoneNumber(mContext, profileId, nbr);
                    }
                    nbr += "@" + domain;
                }
                Log.d(THIS_FILE, "Apply number to " + contactId + " > " + nbr);
                cw.insertOrUpdateCSipUri(mContext, contactId, nbr);
            }
        }
    } catch (Exception e) {
        Log.e(THIS_FILE, "Error while looping on contacts", e);
    } finally {
        c.close();
    }
}
 
開發者ID:treasure-lau,項目名稱:CSipSimple,代碼行數:28,代碼來源:FavAdapter.java

示例5: onItemClick

import com.csipsimple.models.Filter; //導入方法依賴的package包/類
@Override
public void onItemClick(AdapterView<?> ad, View view, int position, long arg3) {
    String number = (String) view.getTag();
    SipProfile account = accountChooserButtonText.getSelectedAccount();
    String rewritten = Filter.rewritePhoneNumber(getContext(), account.id, number);
    setTextValue(rewritten);
    Log.d(THIS_FILE, "Clicked contact " + number);
}
 
開發者ID:treasure-lau,項目名稱:CSipSimple,代碼行數:9,代碼來源:EditSipUri.java


注:本文中的com.csipsimple.models.Filter.rewritePhoneNumber方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。