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