package sto.android.app;

import android.content.Context;
import android.os.Build;


/**
 * 各供应商代码 由申通统一在此整合
 * @author Don
 *
 *网风       NLS-MT60；  以及 WF60
 */
public class StoTongJNI  {

	private static StoJNI jni;
	private static String pdaBrand;

	public static final String Kaicom  		= "kaicom";
	public static final String Urovo 		= "urovo";
	public static final String RongXin 		= "rongxin";
	public static final String WangFeng 	= "wangfeng";
	public static final String ZhiLianTianDi 	= "zhiliantiandi";


	StoTongJNI(){

	}




	public static StoJNI getIns(Context context){
		if (KaicomH702JNI.isH702()) {
			System.out.println("####brand:Kaicom new");
			jni = KaicomH702JNI.getInstance(context);
		} else if(getmPdaBrand().equals(StoTongJNI.Kaicom)){
			System.out.println("####brand:Kaicom");
			jni= KaicomJNI.getInstance(context);
		}else if (getmPdaBrand().equals(StoTongJNI.Urovo)){
			System.out.println("####brand:Urovo");
			jni= UboxunJNI.getInstance(context);//扫描ok
		}else if (getmPdaBrand().equals(StoTongJNI.RongXin)){
			System.out.println("####brand:RongXin");
			jni= RongXinJNI.getInstance(context); //扫描ok 差idata
		}else if (getmPdaBrand().equals(StoTongJNI.WangFeng)){
			System.out.println("####brand:WangFeng");
			jni= WangFengJNI.getInstance(context);
		}else if (getmPdaBrand().equals(StoTongJNI.ZhiLianTianDi)) {
			System.out.println("####ZhiLianTianDi");
			jni = ZltdJNI.getInstance(context);
		}else{
			System.out.println("####brand:Kaicom else");
			//jni= KaicomJNI.getInstance(context);
		}


        return jni;
	}

	public static String getmPdaBrand(){

		String  brand,model;

		brand = new Build().BRAND;
		model = new Build().MODEL;
		System.out.println("####brand:"+brand +"-model:"+model);
		/*
		if(brand == null){
			brand = "null";
		}

		if(model == null){
			model = "0";
		}*/

		//凯立
		if (brand.equals("kaicom")
				|| model.equals("420")
				|| model.equals("WDT420")
				|| model.equals("520")
				|| model.equals("521")
				|| model.equals("520S")
				|| model.equals("585")
				|| model.equals("585P")
				|| model.equals("K7")
				|| model.equals("570") //added by xlf@kaicom.cn 2017/8/23
				|| model.equals("K2")//added by xlf@kaicom.cn 2017/6/21
			    || model.equals("560")//added by xlf@kaicom.cn 2018/1/2
				|| model.equals("571")
				||model.equals("W571")
				|| model.equals("K211")
				|| model.equals("K9")){//added by xlf@kaicom.cn 2018/4/20
			System.out.println("####kkk brand:-model:kaicom");
			return "kaicom";
		}
		//优博讯
		else if(model.equals("SQ41")
				|| model.equals("SQ42")
				|| model.equals("i6160S")
				|| model.equals("msm8610")){
			System.out.println("####brand:-model:urovo");
			//msm8610 不合规矩
			return "urovo";
		}

		//荣信
		else if(model.equals("C40")){
			System.out.println("####brand:-model:rongxin");
			return "rongxin";
		}

		//网风
		else if(model.equals("NLS-MT60")
				||model.equals("WF60")){
			System.out.println("####brand:-model:wangfeng");
			return "wangfeng";
		}
		//智联天地
		else if(brand.equals("alps")||model.equals("simphone")) {
			System.out.println("####brand:-model:zltd");
			return "zhiliantiandi";
		}

		System.out.println("####brand:-model:kaicom else");
		System.out.println("####该巴枪未适配");
		return "";
	}



}
