当前位置: 首页>>代码示例>>Java>>正文


Java SipProfile.getProfileFromDbId方法代码示例

本文整理汇总了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);
}
 
开发者ID:treasure-lau,项目名称:CSipSimple,代码行数:24,代码来源:PresenceStatusSpinner.java

示例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();
}
 
开发者ID:treasure-lau,项目名称:CSipSimple,代码行数:17,代码来源:SipNotifications.java

示例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);
}
 
开发者ID:treasure-lau,项目名称:CSipSimple,代码行数:5,代码来源:SipService.java

示例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;
        }
    }
 
开发者ID:treasure-lau,项目名称:CSipSimple,代码行数:52,代码来源:InCallCard.java


注:本文中的com.csipsimple.api.SipProfile.getProfileFromDbId方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。