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


Java Compatibility.isCompatible方法代碼示例

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


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

示例1: getInstance

import com.csipsimple.utils.Compatibility; //導入方法依賴的package包/類
public static CameraUtilsWrapper getInstance() {
    if (instance == null) {
        if (Compatibility.isCompatible(11)) {
            instance = new CameraUtils11();
        } else if (Compatibility.isCompatible(9)) {
            instance = new CameraUtils9();
        } else if (Compatibility.isCompatible(8)) {
            instance = new CameraUtils8();
        } else if (Compatibility.isCompatible(5)){
            instance = new CameraUtils5();
        }else {
            instance = new CameraUtils3();
        }
    }

    return instance;
}
 
開發者ID:treasure-lau,項目名稱:CSipSimple,代碼行數:18,代碼來源:CameraUtilsWrapper.java

示例2: getInstance

import com.csipsimple.utils.Compatibility; //導入方法依賴的package包/類
public static BluetoothWrapper getInstance(Context context) {
	if(instance == null) {
	    if(Compatibility.isCompatible(14)) {
	        instance = new BluetoothUtils14();
	    }else if(Compatibility.isCompatible(8)) {
               instance = new BluetoothUtils8();
		}else {
               instance = new BluetoothUtils3();
		}
	    if(instance != null) {
	        instance.setContext(context);
	    }
	}
	
	return instance;
}
 
開發者ID:treasure-lau,項目名稱:CSipSimple,代碼行數:17,代碼來源:BluetoothWrapper.java

示例3: getLibFileFromPackage

import com.csipsimple.utils.Compatibility; //導入方法依賴的package包/類
public static File getLibFileFromPackage(ApplicationInfo appInfo, String libName, boolean allowFallback) {
	Log.v(THIS_FILE, "Dir "+appInfo.dataDir);
	if(Compatibility.isCompatible(9)) {
		try {
			Field f = ApplicationInfo.class.getField("nativeLibraryDir");
			File nativeFile = new File((String) f.get(appInfo), libName);
			if(nativeFile.exists()) {
				Log.v(THIS_FILE, "Found native lib using clean way");
				return nativeFile;
			}
		} catch (Exception e) {
			Log.e(THIS_FILE, "Cant get field for native lib dir", e);
		}
	}
	if(allowFallback) {
		return new File(appInfo.dataDir, "lib" + File.separator + libName);
	}else {
		return null;
	}
}
 
開發者ID:treasure-lau,項目名稱:CSipSimple,代碼行數:21,代碼來源:NativeLibManager.java

示例4: InCallAnswerControls

import com.csipsimple.utils.Compatibility; //導入方法依賴的package包/類
public InCallAnswerControls(Context context, AttributeSet attrs, int style) {
    super(context, attrs, style);
    
    lockerWidgetType = LOCKER_GLOWPAD;
    setGravity(Gravity.CENTER_VERTICAL);
    if(!isInEditMode()) {
        int unlockerType = SipConfigManager.getPreferenceIntegerValue(context, SipConfigManager.UNLOCKER_TYPE, 0);
        if(unlockerType <= 0 || unlockerType > 3) {
            AccessibilityWrapper accessibilityManager = AccessibilityWrapper.getInstance();
            accessibilityManager.init(getContext());
            if(accessibilityManager.isEnabled()) {
                lockerWidgetType = LOCKER_BUTTON;
            }
            if (Compatibility.isTabletScreen(getContext())
                    && !Compatibility.isCompatible(Build.VERSION_CODES.ICE_CREAM_SANDWICH)) {
                lockerWidgetType = LOCKER_BUTTON;
            }
        }else {
            lockerWidgetType = unlockerType;
        }
        if(lockerWidgetType == LOCKER_GLOWPAD && !Compatibility.isCompatible(Build.VERSION_CODES.ICE_CREAM_SANDWICH)) {
            lockerWidgetType = LOCKER_SLIDINGTAB;
        }
    }
    
}
 
開發者ID:treasure-lau,項目名稱:CSipSimple,代碼行數:27,代碼來源:InCallAnswerControls.java

示例5: shouldWarnVpnIcs

import com.csipsimple.utils.Compatibility; //導入方法依賴的package包/類
public static boolean shouldWarnVpnIcs(PreferencesProviderWrapper prefs) {
    if(prefs.getPreferenceBooleanValue(getIgnoreKey(WARNING_VPN_ICS), false)) {
        return false;
    }
    if(Compatibility.isCompatible(14) && prefs.getPreferenceIntegerValue(SipConfigManager.NETWORK_ROUTES_POLLING) == 0) {
        // services/java/com/android/server/connectivity/Vpn.java
        String[] daemons = new String[] {"racoon", "mtpd"};
        for(String daemon : daemons) {
            String state = prefs.getSystemProp("init.svc." + daemon);
            if("running".equals(state)) {
                return true;
            }
        }
    }
    return false;
}
 
開發者ID:treasure-lau,項目名稱:CSipSimple,代碼行數:17,代碼來源:WarningUtils.java

示例6: getContactsByGroup

import com.csipsimple.utils.Compatibility; //導入方法依賴的package包/類
@Override
public Cursor getContactsByGroup(Context ctxt, String groupName) {

    if (TextUtils.isEmpty(groupName)) {
        return null;
    }

    String[] projection;
    if (Compatibility.isCompatible(11)) {
        projection = new String[] {
                Contacts._ID,
                Contacts.DISPLAY_NAME,
                Contacts.PHOTO_ID,
                Contacts.CONTACT_STATUS_ICON,
                Contacts.CONTACT_STATUS,
                Contacts.CONTACT_PRESENCE,
                Contacts.PHOTO_URI
        };
    } else {
        projection = new String[] {
                Contacts._ID,
                Contacts.DISPLAY_NAME,
                Contacts.PHOTO_ID,
                Contacts.CONTACT_STATUS,
                Contacts.CONTACT_PRESENCE
        };
    }

    Uri searchUri = Uri.withAppendedPath(Contacts.CONTENT_GROUP_URI, Uri.encode(groupName));
    
    
    Cursor c = null;
    try {
        c = ctxt.getContentResolver().query(searchUri, projection, null, null,
                Contacts.DISPLAY_NAME + " ASC");
    } catch(Exception e) {
        Log.e(THIS_FILE, "Error while retrieving group", e);
    }
    return c;
}
 
開發者ID:treasure-lau,項目名稱:CSipSimple,代碼行數:41,代碼來源:ContactsUtils5.java

示例7: getInstance

import com.csipsimple.utils.Compatibility; //導入方法依賴的package包/類
public static ContactsWrapper getInstance() {
    if (instance == null) {
        if (Compatibility.isCompatible(14)) {
            instance = new ContactsUtils14();
        } else if (Compatibility.isCompatible(5)) {
            instance = new ContactsUtils5();
        } else {
            instance = new ContactsUtils3();
        }
    }

    return instance;
}
 
開發者ID:treasure-lau,項目名稱:CSipSimple,代碼行數:14,代碼來源:ContactsWrapper.java

示例8: getInstance

import com.csipsimple.utils.Compatibility; //導入方法依賴的package包/類
public static BackupWrapper getInstance(Context context) {
	if(instance == null) {
	    if(Compatibility.isCompatible(8)) {
               instance = new BackupUtils8();
		}else {
               instance = new BackupUtils3();
		}
	    if(instance != null) {
	        instance.setContext(context);
	    }
	}
	
	return instance;
}
 
開發者ID:treasure-lau,項目名稱:CSipSimple,代碼行數:15,代碼來源:BackupWrapper.java

示例9: getInstance

import com.csipsimple.utils.Compatibility; //導入方法依賴的package包/類
public static AccessibilityWrapper getInstance() {
	if(instance == null) {
		if(Compatibility.isCompatible(4)) {
		    instance = new Accessibility4();
		}else {
		    instance = new Accessibility3();
		}
	}
	
	return instance;
}
 
開發者ID:treasure-lau,項目名稱:CSipSimple,代碼行數:12,代碼來源:AccessibilityWrapper.java

示例10: getInstance

import com.csipsimple.utils.Compatibility; //導入方法依賴的package包/類
public static AudioFocusWrapper getInstance() {
    if (instance == null) {
        if (Compatibility.isCompatible(17)) {
            instance = new AudioFocus17();
        } else if (Compatibility.isCompatible(8)) {
            instance = new AudioFocus8();
        } else {
            instance = new AudioFocus3();
        }
    }

    return instance;
}
 
開發者ID:treasure-lau,項目名稱:CSipSimple,代碼行數:14,代碼來源:AudioFocusWrapper.java

示例11: QuickContactBadge

import com.csipsimple.utils.Compatibility; //導入方法依賴的package包/類
public QuickContactBadge(Context context, AttributeSet attrs, int defStyle) {
    super(context, attrs, defStyle);

    String className = "com.csipsimple.widgets.contactbadge.ContactBadge";
    if (Compatibility.isCompatible(5)) {
        className += "5";
    } else {
        className += "3";
    }

    try {
        Class<? extends ContactBadgeContract> wrappedClass = Class.forName(className)
                .asSubclass(ContactBadgeContract.class);
        Constructor<? extends ContactBadgeContract> constructor = wrappedClass.getConstructor(
                Context.class, AttributeSet.class, int.class, QuickContactBadge.class);
        badge = constructor.newInstance(context, attrs, defStyle, this);
    } catch (Exception e) {
        Log.e(THIS_FILE, "Problem when trying to load for compat mode");
    }
    if (badge != null) {
        ImageView imageView = badge.getImageView();
        LayoutParams params = new LayoutParams(LayoutParams.MATCH_PARENT,
                LayoutParams.MATCH_PARENT);
        addView(imageView, params);
    }

    setDrawable();
}
 
開發者ID:treasure-lau,項目名稱:CSipSimple,代碼行數:29,代碼來源:QuickContactBadge.java

示例12: getInstance

import com.csipsimple.utils.Compatibility; //導入方法依賴的package包/類
public static ClipboardWrapper getInstance(Context context) {
    if(instance == null) {
        if(Compatibility.isCompatible(11)) {
            instance = new Clipboard11();
        }else {
            instance = new Clipboard1();
        }
        if(instance != null) {
            instance.setContext(context);
        }
    }
    
    return instance;
}
 
開發者ID:treasure-lau,項目名稱:CSipSimple,代碼行數:15,代碼來源:ClipboardWrapper.java

示例13: getInstance

import com.csipsimple.utils.Compatibility; //導入方法依賴的package包/類
public static VideoUtilsWrapper getInstance() {
    if (instance == null) {
        if (Compatibility.isCompatible(5)) {
            instance = new VideoUtils5();
        } else {
            instance = new VideoUtils3();
        }
    }

    return instance;
}
 
開發者ID:treasure-lau,項目名稱:CSipSimple,代碼行數:12,代碼來源:VideoUtilsWrapper.java

示例14: getInstance

import com.csipsimple.utils.Compatibility; //導入方法依賴的package包/類
public static AccountCreationWebviewHelper getInstance() {
    if(instance == null) {
        if(Compatibility.isCompatible(8)) {
            instance = new com.csipsimple.wizards.utils.AccountCreationWebviewHelper8();
        }else {
            instance = new com.csipsimple.wizards.utils.AccountCreationWebviewHelper3();
        }
    }
    
    return instance;
}
 
開發者ID:treasure-lau,項目名稱:CSipSimple,代碼行數:12,代碼來源:AccountCreationWebviewHelper.java

示例15: SipNotifications

import com.csipsimple.utils.Compatibility; //導入方法依賴的package包/類
public SipNotifications(Context aContext) {
	context = aContext;
	notificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);

	if (!isInit) {
		cancelAll();
		cancelCalls();
		isInit = true;
	}
	
	if( ! Compatibility.isCompatible(9) ) {
	    searchNotificationPrimaryText(aContext);
	}
}
 
開發者ID:treasure-lau,項目名稱:CSipSimple,代碼行數:15,代碼來源:SipNotifications.java


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