本文整理汇总了Java中com.csipsimple.api.SipProfile.getProfileFromDbId方法的典型用法代码示例。如果您正苦于以下问题:Java SipProfile.getProfileFromDbId方法的具体用法?Java SipProfile.getProfileFromDbId怎么用?Java SipProfile.getProfileFromDbId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.csipsimple.api.SipProfile
的用法示例。
在下文中一共展示了SipProfile.getProfileFromDbId方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: updateRegistration
import com.csipsimple.api.SipProfile; //导入方法依赖的package包/类
/**
* Update user interface when registration of account has changed
* This include change selected account if we are in canChangeIfValid mode
*/
private void updateRegistration() {
if(profileId < 0) {
return;
}
SipProfile acc = SipProfile.getProfileFromDbId(getContext(), profileId, ACC_PROJECTION);
isValid = false;
hasPresenceRegistration = false;
if(acc != null) {
AccountStatusDisplay accountStatusDisplay = AccountListUtils
.getAccountDisplay(getContext(), acc.id);
if(accountStatusDisplay.availableForCalls) {
isValid = true;
}
hasPresenceRegistration = (acc.publish_enabled == 1);
}
setEnabled(isValid);
setVisibility(hasPresenceRegistration ? View.VISIBLE : View.GONE);
}
示例2: formatNotificationTitle
import com.csipsimple.api.SipProfile; //导入方法依赖的package包/类
/**
* Format the notification title for a call info
* @param title
* @param callInfo
* @return
*/
private String formatNotificationTitle(int title, long accId) {
StringBuilder notifTitle = new StringBuilder(context.getText(title));
SipProfile acc = SipProfile.getProfileFromDbId(context, accId,
new String[] {SipProfile.FIELD_DISPLAY_NAME});
if ((acc != null) && !TextUtils.isEmpty(acc.display_name)) {
notifTitle.append(" - ");
notifTitle.append(acc.display_name);
}
return notifTitle.toString();
}
示例3: getAccount
import com.csipsimple.api.SipProfile; //导入方法依赖的package包/类
public SipProfile getAccount(long accountId) {
// TODO : create cache at this point to not requery each time as far as it's a service query
return SipProfile.getProfileFromDbId(this, accountId, DBProvider.ACCOUNT_FULL_PROJECTION);
}
示例4: updateRemoteName
import com.csipsimple.api.SipProfile; //导入方法依赖的package包/类
private void updateRemoteName() {
final String aRemoteUri = callInfo.getRemoteContact();
// If not already set with the same value, just ignore it
if (aRemoteUri != null && !aRemoteUri.equalsIgnoreCase(cachedRemoteUri)) {
cachedRemoteUri = aRemoteUri;
ParsedSipContactInfos uriInfos = SipUri.parseSipContact(cachedRemoteUri);
String text = SipUri.getDisplayedSimpleContact(aRemoteUri);
StringBuffer statusTextBuffer = new StringBuffer();
remoteName.setText(text);
if (callInfo.getAccId() != SipProfile.INVALID_ID) {
SipProfile acc = SipProfile.getProfileFromDbId(getContext(), callInfo.getAccId(),
new String[] {
SipProfile.FIELD_ID, SipProfile.FIELD_DISPLAY_NAME
});
if (acc != null && acc.display_name != null) {
statusTextBuffer.append("SIP/" + acc.display_name + " : ");
}
} else {
statusTextBuffer.append("SIP : ");
}
statusTextBuffer.append(uriInfos.userName);
remoteSipAddress.setText(statusTextBuffer.toString());
Thread t = new Thread() {
public void run() {
// Looks like a phone number so search the contact throw
// contacts
CallerInfo callerInfo = CallerInfo.getCallerInfoFromSipUri(getContext(),
cachedRemoteUri);
if (callerInfo != null && callerInfo.contactExists) {
LoadCallerInfoMessage lci = new LoadCallerInfoMessage(InCallCard.this, callerInfo);
userHandler.sendMessage(userHandler.obtainMessage(LOAD_CALLER_INFO,
lci));
}
};
};
t.start();
}
// Useless to process that
if (cachedInvState == callInfo.getCallState() &&
cachedMediaState == callInfo.getMediaStatus()) {
return;
}
}