android java中通过判断某个系统属性改代码

来源:互联网 发布:mac迅雷一直提示信任 编辑:程序博客网 时间:2024/05/21 09:30

示例是如果是eng的话,就不执行那段代码


+import android.os.SystemProperties;

 
 import com.android.contacts.common.R;
 import com.android.contacts.common.model.dataitem.DataKind;
@@ -419,7 +420,9 @@ public abstract class BaseAccountType extends AccountType {
     }
 
     protected DataKind addDataKindSipAddress(Context context) throws DefinitionException {
-        DataKind kind = addKind(new DataKind(SipAddress.CONTENT_ITEM_TYPE,
+          String gcf_version = SystemProperties.get("ro.build.type","");
+                               if (!"eng".equals(gcf_version)){
+               DataKind kind = addKind(new DataKind(SipAddress.CONTENT_ITEM_TYPE,


0 0