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


Java ExtraPlugins类代码示例

本文整理汇总了Java中com.csipsimple.utils.ExtraPlugins的典型用法代码示例。如果您正苦于以下问题:Java ExtraPlugins类的具体用法?Java ExtraPlugins怎么用?Java ExtraPlugins使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ExtraPlugins类属于com.csipsimple.utils包,在下文中一共展示了ExtraPlugins类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onReceive

import com.csipsimple.utils.ExtraPlugins; //导入依赖的package包/类
@Override
public void onReceive(Context context, Intent intent) {

    PreferencesProviderWrapper prefWrapper = new PreferencesProviderWrapper(context);
    String intentAction = intent.getAction();

    //
    // ACTION_DATA_STATE_CHANGED
    // Data state change is used to detect changes in the mobile
    // network such as a switch of network type (GPRS, EDGE, 3G)
    // which are not detected by the Connectivity changed broadcast.
    //
    //
    // ACTION_CONNECTIVITY_CHANGED
    // Connectivity change is used to detect changes in the overall
    // data network status as well as a switch between wifi and mobile
    // networks.
    //
    if (/*intentAction.equals(ACTION_DATA_STATE_CHANGED) ||*/
            intentAction.equals(ConnectivityManager.CONNECTIVITY_ACTION) ||
            intentAction.equals(Intent.ACTION_BOOT_COMPLETED)) {
        
        if (prefWrapper.isValidConnectionForIncoming()
                &&
                !prefWrapper
                        .getPreferenceBooleanValue(PreferencesProviderWrapper.HAS_BEEN_QUIT)) {
            Log.d(THIS_FILE, "Try to start service if not already started");
            Intent sip_service_intent = new Intent(context, SipService.class);
            context.startService(sip_service_intent);
        }

    } else if (intentAction.equals(SipManager.INTENT_SIP_ACCOUNT_ACTIVATE)) {
        context.enforceCallingOrSelfPermission(SipManager.PERMISSION_CONFIGURE_SIP, null);

        long accId;
        accId = intent.getLongExtra(SipProfile.FIELD_ID, SipProfile.INVALID_ID);

        if (accId == SipProfile.INVALID_ID) {
            // allow remote side to send us integers.
            // previous call will warn, but that's fine, no worries
            accId = intent.getIntExtra(SipProfile.FIELD_ID, (int) SipProfile.INVALID_ID);
        }

        if (accId != SipProfile.INVALID_ID) {
            boolean active = intent.getBooleanExtra(SipProfile.FIELD_ACTIVE, true);
            ContentValues cv = new ContentValues();
            cv.put(SipProfile.FIELD_ACTIVE, active);
            int done = context.getContentResolver().update(
                    ContentUris.withAppendedId(SipProfile.ACCOUNT_ID_URI_BASE, accId), cv,
                    null, null);
            if (done > 0) {
                if (prefWrapper.isValidConnectionForIncoming()) {
                    Intent sipServiceIntent = new Intent(context, SipService.class);
                    context.startService(sipServiceIntent);
                }
            }
        }
    } else if (Intent.ACTION_PACKAGE_ADDED.equalsIgnoreCase(intentAction) ||
            Intent.ACTION_PACKAGE_REMOVED.equalsIgnoreCase(intentAction)) {
        CallHandlerPlugin.clearAvailableCallHandlers();
        RewriterPlugin.clearAvailableRewriters();
        ExtraPlugins.clearDynPlugins();
        PhoneCapabilityTester.deinit();
    } else if (APPLY_NIGHTLY_UPLOAD.equals(intentAction)) {
        NightlyUpdater nu = new NightlyUpdater(context);
        nu.applyUpdate(intent);
    }
}
 
开发者ID:treasure-lau,项目名称:CSipSimple,代码行数:69,代码来源:DeviceStateReceiver.java

示例2: buildCallUiIntent

import com.csipsimple.utils.ExtraPlugins; //导入依赖的package包/类
public static Intent buildCallUiIntent(Context ctxt, SipCallSession callInfo) {
    // Resolve the package to handle call.
    if(UI_CALL_PACKAGE == null) {
        UI_CALL_PACKAGE = ctxt.getPackageName();
        try {
            Map<String, DynActivityPlugin> callsUis = ExtraPlugins.getDynActivityPlugins(ctxt, SipManager.ACTION_SIP_CALL_UI);
            String preferredPackage  = SipConfigManager.getPreferenceStringValue(ctxt, SipConfigManager.CALL_UI_PACKAGE, UI_CALL_PACKAGE);
            String packageName = null;
            boolean foundPref = false;
            for(String activity : callsUis.keySet()) {
                packageName = activity.split("/")[0];
                if(preferredPackage.equalsIgnoreCase(packageName)) {
                    UI_CALL_PACKAGE = packageName;
                    foundPref = true;
                    break;
                }
            }
            if(!foundPref && !TextUtils.isEmpty(packageName)) {
                UI_CALL_PACKAGE = packageName;
            }
        }catch(Exception e) {
            Log.e(THIS_FILE, "Error while resolving package", e);
        }
    }
    SipCallSession toSendInfo = new SipCallSession(callInfo);
    Intent intent = new Intent(SipManager.ACTION_SIP_CALL_UI);
    intent.putExtra(SipManager.EXTRA_CALL_INFO, toSendInfo);
    intent.setPackage(UI_CALL_PACKAGE);
    intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_SINGLE_TOP);
    return intent;
}
 
开发者ID:treasure-lau,项目名称:CSipSimple,代码行数:32,代码来源:SipService.java

示例3: InCallCard

import com.csipsimple.utils.ExtraPlugins; //导入依赖的package包/类
public InCallCard(Context context, AttributeSet attrs) {
    super(context, attrs);
    LayoutInflater inflater = LayoutInflater.from(context);
    inflater.inflate(R.layout.in_call_card, this, true);

    prefs = new PreferencesProviderWrapper(context);
    canVideo = prefs.getPreferenceBooleanValue(SipConfigManager.USE_VIDEO);
    initControllerView();
    
    incallPlugins = ExtraPlugins.getDynActivityPlugins(context, SipManager.ACTION_INCALL_PLUGIN);
}
 
开发者ID:treasure-lau,项目名称:CSipSimple,代码行数:12,代码来源:InCallCard.java


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