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