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


Java LinphoneAddress.getDisplayName方法代碼示例

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


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

示例1: extractADisplayName

import org.linphone.core.LinphoneAddress; //導入方法依賴的package包/類
public static String extractADisplayName(Resources r, LinphoneAddress address) {
	if (address == null) return r.getString(R.string.unknown_incoming_call_name);

	final String displayName = address.getDisplayName();
	if (displayName!=null) {
		return displayName;
	} else  if (address.getUserName() != null){
		return address.getUserName();
	} else {
		String rms = address.toString();
		if (rms != null && rms.length() > 1)
			return rms;

		return r.getString(R.string.unknown_incoming_call_name);
	}
}
 
開發者ID:treasure-lau,項目名稱:Linphone4Android,代碼行數:17,代碼來源:LinphoneManager.java

示例2: getAccountDisplayName

import org.linphone.core.LinphoneAddress; //導入方法依賴的package包/類
public String getAccountDisplayName(int n) {
	LinphoneAddress addr = getProxyConfig(n).getAddress();
	if(addr != null) {
		return addr.getDisplayName();
	}
	return null;
}
 
開發者ID:treasure-lau,項目名稱:Linphone4Android,代碼行數:8,代碼來源:LinphonePreferences.java

示例3: getAddressDisplayName

import org.linphone.core.LinphoneAddress; //導入方法依賴的package包/類
public static String getAddressDisplayName(LinphoneAddress address){
	if(address.getDisplayName() != null) {
		return address.getDisplayName();
	} else {
		if(address.getUserName() != null){
			return address.getUserName();
		} else {
			return address.asStringUriOnly();
		}
	}
}
 
開發者ID:treasure-lau,項目名稱:Linphone4Android,代碼行數:12,代碼來源:LinphoneUtils.java

示例4: setIncallIcon

import org.linphone.core.LinphoneAddress; //導入方法依賴的package包/類
private synchronized void setIncallIcon(IncallIconState state) {
	if (state == mCurrentIncallIconState) return;
	mCurrentIncallIconState = state;

	int notificationTextId = 0;
	int inconId = 0;
	
	switch (state) {
	case IDLE:
		mNM.cancel(INCALL_NOTIF_ID);
		return;
	case INCALL:
		inconId = R.drawable.topbar_call_notification;
		notificationTextId = R.string.incall_notif_active;
		break;
	case PAUSE:
		inconId = R.drawable.topbar_call_notification;
		notificationTextId = R.string.incall_notif_paused;
		break;
	case VIDEO:
		inconId = R.drawable.topbar_videocall_notification;
		notificationTextId = R.string.incall_notif_video;
		break;	
	default:
		throw new IllegalArgumentException("Unknown state " + state);
	}
	
	if (LinphoneManager.getLc().getCallsNb() == 0) {
		return;
	}
	
	LinphoneCall call = LinphoneManager.getLc().getCalls()[0];
	String userName = call.getRemoteAddress().getUserName();
	String domain = call.getRemoteAddress().getDomain();
	String displayName = call.getRemoteAddress().getDisplayName();
	LinphoneAddress address = LinphoneCoreFactory.instance().createLinphoneAddress(userName,domain,null);
	address.setDisplayName(displayName);

	LinphoneContact contact = ContactsManager.getInstance().findContactFromAddress(address);
	Uri pictureUri = contact != null ? contact.getPhotoUri() : null;
	Bitmap bm = null;
	try {
		bm = MediaStore.Images.Media.getBitmap(getContentResolver(), pictureUri);
	} catch (Exception e) {
		bm = BitmapFactory.decodeResource(getResources(), R.drawable.avatar);
	}
	String name = address.getDisplayName() == null ? address.getUserName() : address.getDisplayName();
	mIncallNotif = Compatibility.createInCallNotification(getApplicationContext(), mNotificationTitle, getString(notificationTextId), inconId, bm, name, mNotifContentIntent);

	notifyWrapper(INCALL_NOTIF_ID, mIncallNotif);
}
 
開發者ID:treasure-lau,項目名稱:Linphone4Android,代碼行數:52,代碼來源:LinphoneService.java


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