本文整理匯總了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;
}
示例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();
}
示例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);
}
}
示例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();
}
}
示例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);
}