public class CellInfoUtil {
- public static void dialSilent(Context context,String dialnumber){
+ public static void dialSilent(Context context, String dialnumber) {
// Single.just(null).observeOn(AndroidSchedulers.mainThread()).subscribe(new Action1<Object>() {
// public void call(Object param1Object) {
//
// }
// }
// });
- Single.just(null).observeOn(AndroidSchedulers.mainThread()).subscribe(new Action1<Object>() {
- public void call(Object param1Object) {
+ Single.just(null).observeOn(AndroidSchedulers.mainThread()).subscribe(new Action1<Object>() {
+ public void call(Object param1Object) {
- PhoneFactory.makeDefaultPhones(context);
+ PhoneFactory.makeDefaultPhones(context);
- Phone p = PhoneFactory.getDefaultPhone();
+ Phone p = PhoneFactory.getDefaultPhone();
- SprdCallManager cm = (SprdCallManager)SprdCallManager.getInstance();
+ SprdCallManager cm = (SprdCallManager) SprdCallManager.getInstance();
- cm.registerPhone(p);
+ cm.registerPhone(p);
- Phone phone = cm.getDefaultPhone();
+ Phone phone = cm.getDefaultPhone();
+ try {
+ phone.dial(dialnumber);
+ } catch (Exception e) {
+ ICLogger.PrintExceptionStackTrace(e);
+ ICLogger.e(e.getMessage(), e);
+ }
+ }
+ });
+
+ }
+
+ public static int getSignal(TelephonyManager tm, Runtime runtime) {
+
+ if (tm == null)
+ return 5;
try {
- phone.dial(dialnumber);
+ CellLocation celllocation = tm.getCellLocation();
+ if (celllocation == null) {
+ ICLogger.i("cellLocation = null");
+ return 1;
+ } else {
+ if (celllocation instanceof GsmCellLocation) {
+ for (CellInfo cinfo : tm.getAllCellInfo()) {
+ if (cinfo instanceof CellInfoGsm) {
+ CellSignalStrengthGsm cigsm = ((CellInfoGsm) cinfo).getCellSignalStrength();
+ ICLogger.i("gsm signal dbm =" + cigsm.getDbm() + ",level=" + cigsm.getLevel());
+ runtime.setSignalInfo("gsm signal dbm =" + cigsm.getDbm() + ",level=" + cigsm.getLevel());
+ return cigsm.getDbm();
+ } else if (cinfo instanceof CellInfoLte) {
+ CellSignalStrengthLte cigsm = ((CellInfoLte) cinfo).getCellSignalStrength();
+ //ICLogger.i("lte signal dbm =" + cigsm.getDbm() + ",level=" + cigsm.getLevel());
+ runtime.setSignalInfo("lte signal dbm =" + cigsm.getDbm() + ",level=" + cigsm.getLevel());
+ return cigsm.getDbm();
+ } else if (cinfo instanceof CellInfoWcdma) {
+ CellSignalStrengthWcdma cicdma = ((CellInfoWcdma) cinfo).getCellSignalStrength();
+ // ICLogger.i("wcdma signal dbm =" + cicdma.getDbm() + ",level=" + cicdma.getLevel());
+ runtime.setSignalInfo("wcdma signal dbm =" + cicdma.getDbm() + ",level=" + cicdma.getLevel());
+ return cicdma.getDbm();
+ }
+ }
+ return 2;
+ } else if (celllocation instanceof CdmaCellLocation) {
+ for (CellInfo cinfo : tm.getAllCellInfo()) {
+ if (cinfo instanceof CellInfoCdma) {
+ CellSignalStrengthCdma cicdma = ((CellInfoCdma) cinfo).getCellSignalStrength();
+ ICLogger.i("cdma signal dbm =" + cicdma.getDbm() + ",level=" + cicdma.getLevel());
+ runtime.setSignalInfo("cdma signal dbm =" + cicdma.getDbm() + ",level=" + cicdma.getLevel());
+ return cicdma.getDbm();
+ }
+ }
+ return 3;
+ }
+ return 4;
+ }
} catch (Exception e) {
- ICLogger.PrintExceptionStackTrace(e);
- ICLogger.e(e.getMessage(),e);
+ ICLogger.e(e.getMessage());
+ ICLogger.PrintExceptionStackTrace(e);
+ return 6;
}
- }
- });
-
- }
- public static int getSignal(TelephonyManager tm , Runtime runtime){
-
- if(tm==null)
- return 5;
- try {
- CellLocation celllocation = tm.getCellLocation();
- if (celllocation == null) {
- ICLogger.i("cellLocation = null");
- return 1;
- } else {
- if (celllocation instanceof GsmCellLocation) {
- for (CellInfo cinfo : tm.getAllCellInfo()) {
- if (cinfo instanceof CellInfoGsm) {
- CellSignalStrengthGsm cigsm = ((CellInfoGsm) cinfo).getCellSignalStrength();
- ICLogger.i("gsm signal dbm =" + cigsm.getDbm() + ",level=" + cigsm.getLevel());
- runtime.setSignalInfo("gsm signal dbm =" + cigsm.getDbm() + ",level=" + cigsm.getLevel());
- return cigsm.getDbm();
- } else if (cinfo instanceof CellInfoLte) {
- CellSignalStrengthLte cigsm = ((CellInfoLte) cinfo).getCellSignalStrength();
- //ICLogger.i("lte signal dbm =" + cigsm.getDbm() + ",level=" + cigsm.getLevel());
- runtime.setSignalInfo("lte signal dbm =" + cigsm.getDbm() + ",level=" + cigsm.getLevel());
- return cigsm.getDbm();
- } else if (cinfo instanceof CellInfoWcdma) {
- CellSignalStrengthWcdma cicdma = ((CellInfoWcdma) cinfo).getCellSignalStrength();
- // ICLogger.i("wcdma signal dbm =" + cicdma.getDbm() + ",level=" + cicdma.getLevel());
- runtime.setSignalInfo("wcdma signal dbm =" + cicdma.getDbm() + ",level=" + cicdma.getLevel());
- return cicdma.getDbm();
- }
- }
- return 2;
- } else if (celllocation instanceof CdmaCellLocation) {
- for (CellInfo cinfo : tm.getAllCellInfo()) {
- if (cinfo instanceof CellInfoCdma) {
- CellSignalStrengthCdma cicdma = ((CellInfoCdma) cinfo).getCellSignalStrength();
- ICLogger.i("cdma signal dbm =" + cicdma.getDbm() + ",level=" + cicdma.getLevel());
- runtime.setSignalInfo("cdma signal dbm =" + cicdma.getDbm() + ",level=" + cicdma.getLevel());
- return cicdma.getDbm();
+ }
+
+ public static String getCellInfo(TelephonyManager telephonyManager, Runtime runtime) {
+ ICLogger.i("LBS 延时获取基站信息");
+ /***
+ * MCC,Mobile Country Code,移动国家代码(中国的为460)。
+ * MNC,Mobile Network Code,移动网络号码(中国移动为0,中国联通为1,中国电信为2)。
+ * LAC,Location Area Code,位置区域码。
+ * CID,Cell Identity,基站编号。
+ * BSSS,Base station signal strength,基站信号强度。
+ */
+ int maxstationCount = 0;
+ String mccmnc;
+ if (Build.VERSION.SDK_INT > 23) {
+ mccmnc = telephonyManager.getSimOperator();
+ if (mccmnc == null) {
+ ICLogger.i("LBS operator == null");
+ return null;
}
- }
- return 3;
+
+ mccmnc = mccmnc.substring(0, 5);
+ } else {
+ mccmnc = telephonyManager.getNetworkOperator();
}
- return 4;
- }
- }catch (Exception e){
- ICLogger.e(e.getMessage());
- ICLogger.PrintExceptionStackTrace(e);
- return 6;
- }
- }
- public static String getCellInfo(TelephonyManager telephonyManager, Runtime runtime) {
- ICLogger.i("LBS 延时获取基站信息");
- /***
- * MCC,Mobile Country Code,移动国家代码(中国的为460)。
- * MNC,Mobile Network Code,移动网络号码(中国移动为0,中国联通为1,中国电信为2)。
- * LAC,Location Area Code,位置区域码。
- * CID,Cell Identity,基站编号。
- * BSSS,Base station signal strength,基站信号强度。
- */
- int maxstationCount = 0;
- String mccmnc;
- if (Build.VERSION.SDK_INT > 23) {
- mccmnc = telephonyManager.getSimOperator();
- if (mccmnc == null) {
- ICLogger.i("LBS operator == null");
- return null;
- }
-
- mccmnc = mccmnc.substring(0, 5);
- } else {
- mccmnc = telephonyManager.getNetworkOperator();
- }
- if(mccmnc==null|| (mccmnc!=null && mccmnc.trim().isEmpty()))
- {
- ICLogger.i("LBS retry get MCCMNC");
- telephonyManager=((TelephonyManager) runtime.getContextProxy().context.getSystemService(Context.TELEPHONY_SERVICE));
- Util.mSleep(5000);
- mccmnc=telephonyManager.getSimOperator();
- }
- ICLogger.i("LBS mccmnc "+mccmnc);
- runtime.setmccmnc(mccmnc);
-
- if (mccmnc != null && mccmnc.length() > 3) {
-
- //==========清除Runtime中lbs数据,暂时没有使用此lbs数据
- runtime.getLocationInstance().clearLBSdata();
- runtime.setLBSMultiStationData("");
- runtime.setFZDLBSMultiStationData("");
- runtime.setGatorLBSMultiStationData("");
-
- //如果没插卡,后面数据会获取不到,以上数据也就为空了
- CellLocation celllocation = telephonyManager.getCellLocation();
- if (celllocation == null) {
- ICLogger.i("LBS cellLocation = null");
- return null;
- } else {
- StringBuilder gsmSb = new StringBuilder(mccmnc);
- gsmSb.insert(3, ",");
-
- StringBuilder cdmaSB = new StringBuilder();
- runtime.setMccAndMnc(gsmSb.toString());
- int mcc=0;
- int mnc=0;
- try {
- mcc = Integer.parseInt(runtime.getLocationInstance().getMCC());
- mnc = Integer.parseInt(runtime.getLocationInstance().getMNC());
- }catch (Exception e){
- ICLogger.e(e.getMessage(),e);
+ if (mccmnc == null || (mccmnc != null && mccmnc.trim().isEmpty())) {
+ ICLogger.i("LBS retry get MCCMNC");
+ telephonyManager = ((TelephonyManager) runtime.getContextProxy().context.getSystemService(Context.TELEPHONY_SERVICE));
+ Util.mSleep(5000);
+ mccmnc = telephonyManager.getSimOperator();
}
- if (celllocation instanceof GsmCellLocation) {
- GsmCellLocation gsmCell = (GsmCellLocation)celllocation;
- runtime.setCdmaInfo(null);
- //AP01 Single GSM Station
- gsmSb.append(",");
- gsmSb.append(gsmCell.getLac());
- gsmSb.append(",");
- gsmSb.append(gsmCell.getCid());
- gsmSb.append(",");
- gsmSb.append(150-Math.abs(getSignal(telephonyManager,runtime)));
- runtime.setCellinfo(gsmSb.toString());
- runtime.getLocationInstance().setCID(gsmCell.getCid());
- runtime.getLocationInstance().setLAC(gsmCell.getLac());
- runtime.getLocationInstance().setRxlevel(150-Math.abs(getSignal(telephonyManager,runtime)));
- ICLogger.i("LBS GsmCellLocation "+ gsmSb.toString());
- if (Config.LOG_TOFILE) ICLogger.logToFile("LBS", gsmSb.toString());
-
- //===添加gsm station到Runtime全局变量
- runtime.getLocationInstance().append_gsmstation(gsmCell.getLac()+","+gsmCell.getCid(),150-Math.abs(getSignal(telephonyManager,runtime)));
-
- List neighboringCell_list = telephonyManager.getNeighboringCellInfo();
- //AP02 Multi GSM Station
- StringBuilder gsmSbMulti = new StringBuilder(); //头
- StringBuilder gsmSbMulti_data = new StringBuilder(); //内容
-
- StringBuilder gsmSbMultiFZD = new StringBuilder();//头
- StringBuilder gsmSbMultiFZD_data = new StringBuilder();//内容
-
- StringBuilder gsmSbMultiGator = new StringBuilder(); //头
- StringBuilder gsmSbMultiGator_data = new StringBuilder(); //内容
-
- int size=1;
- if (neighboringCell_list != null && !neighboringCell_list.isEmpty()) {
- sortByRssi(neighboringCell_list);
-
- Iterator cell = neighboringCell_list.iterator();
-
-
- while(cell.hasNext()) {
- NeighboringCellInfo mNeighboringCellInfo = (NeighboringCellInfo)cell.next();
- if (mNeighboringCellInfo.getLac() == -1) {
- break;
+ ICLogger.i("LBS mccmnc " + mccmnc);
+ runtime.setmccmnc(mccmnc);
+
+ if (mccmnc != null && mccmnc.length() > 3) {
+
+ //==========清除Runtime中lbs数据,暂时没有使用此lbs数据
+ runtime.getLocationInstance().clearLBSdata();
+ runtime.setLBSMultiStationData("");
+ runtime.setFZDLBSMultiStationData("");
+ runtime.setGatorLBSMultiStationData("");
+
+ //如果没插卡,后面数据会获取不到,以上数据也就为空了
+ CellLocation celllocation = telephonyManager.getCellLocation();
+ if (celllocation == null) {
+ ICLogger.i("LBS cellLocation = null");
+ return null;
+ } else {
+ StringBuilder gsmSb = new StringBuilder(mccmnc);
+ gsmSb.insert(3, ",");
+
+ StringBuilder cdmaSB = new StringBuilder();
+ runtime.setMccAndMnc(gsmSb.toString());
+ int mcc = 0;
+ int mnc = 0;
+ try {
+ mcc = Integer.parseInt(runtime.getLocationInstance().getMCC());
+ mnc = Integer.parseInt(runtime.getLocationInstance().getMNC());
+ } catch (Exception e) {
+ ICLogger.e(e.getMessage(), e);
}
- gsmSbMulti_data.append(",");
- gsmSbMulti_data.append(mNeighboringCellInfo.getLac());
- gsmSbMulti_data.append("|");
- gsmSbMulti_data.append(mNeighboringCellInfo.getCid());
- gsmSbMulti_data.append("|");
- gsmSbMulti_data.append( 150-Math.abs(mNeighboringCellInfo.getRssi()));
-
- gsmSbMultiFZD_data.append(",");
- gsmSbMultiFZD_data.append(mNeighboringCellInfo.getLac());
- gsmSbMultiFZD_data.append(",");
- gsmSbMultiFZD_data.append(mNeighboringCellInfo.getCid());
- gsmSbMultiFZD_data.append(",");
- gsmSbMultiFZD_data.append( 150-Math.abs(mNeighboringCellInfo.getRssi()));
+ if (celllocation instanceof GsmCellLocation) {
+ GsmCellLocation gsmCell = (GsmCellLocation) celllocation;
+ runtime.setCdmaInfo(null);
+ //AP01 Single GSM Station
+ gsmSb.append(",");
+ gsmSb.append(gsmCell.getLac());
+ gsmSb.append(",");
+ gsmSb.append(gsmCell.getCid());
+ gsmSb.append(",");
+ gsmSb.append(150 - Math.abs(getSignal(telephonyManager, runtime)));
+ runtime.setCellinfo(gsmSb.toString());
+ runtime.getLocationInstance().setCID(gsmCell.getCid());
+ runtime.getLocationInstance().setLAC(gsmCell.getLac());
+ runtime.getLocationInstance().setRxlevel(150 - Math.abs(getSignal(telephonyManager, runtime)));
+ ICLogger.i("LBS GsmCellLocation " + gsmSb.toString());
+ if (Config.LOG_TOFILE) ICLogger.logToFile("LBS", gsmSb.toString());
+
+ //===添加gsm station到Runtime全局变量
+ runtime.getLocationInstance().append_gsmstation(gsmCell.getLac() + "," + gsmCell.getCid(), 150 - Math.abs(getSignal(telephonyManager, runtime)));
+
+ List neighboringCell_list = telephonyManager.getNeighboringCellInfo();
+ //AP02 Multi GSM Station
+ StringBuilder gsmSbMulti = new StringBuilder(); //头
+ StringBuilder gsmSbMulti_data = new StringBuilder(); //内容
+
+ StringBuilder gsmSbMultiFZD = new StringBuilder();//头
+ StringBuilder gsmSbMultiFZD_data = new StringBuilder();//内容
+
+ StringBuilder gsmSbMultiGator = new StringBuilder(); //头
+ StringBuilder gsmSbMultiGator_data = new StringBuilder(); //内容
+
+ StringBuilder gsmSbMultiANAN = new StringBuilder();//头
+ StringBuilder gsmSbMultiANAN_data = new StringBuilder();//内容
+
+ int size = 1;
+ if (neighboringCell_list != null && !neighboringCell_list.isEmpty()) {
+ sortByRssi(neighboringCell_list);
+
+ Iterator cell = neighboringCell_list.iterator();
+
+
+ while (cell.hasNext()) {
+ NeighboringCellInfo mNeighboringCellInfo = (NeighboringCellInfo) cell.next();
+ if (mNeighboringCellInfo.getLac() == -1) {
+ break;
+ }
+ gsmSbMulti_data.append(",");
+ gsmSbMulti_data.append(mNeighboringCellInfo.getLac());
+ gsmSbMulti_data.append("|");
+ gsmSbMulti_data.append(mNeighboringCellInfo.getCid());
+ gsmSbMulti_data.append("|");
+ gsmSbMulti_data.append(150 - Math.abs(mNeighboringCellInfo.getRssi()));
+
+ gsmSbMultiFZD_data.append(",");
+ gsmSbMultiFZD_data.append(mNeighboringCellInfo.getLac());
+ gsmSbMultiFZD_data.append(",");
+ gsmSbMultiFZD_data.append(mNeighboringCellInfo.getCid());
+ gsmSbMultiFZD_data.append(",");
+ gsmSbMultiFZD_data.append(150 - Math.abs(mNeighboringCellInfo.getRssi()));
+
+ gsmSbMultiANAN_data.append(",");
+ gsmSbMultiANAN_data.append(mNeighboringCellInfo.getLac());
+ gsmSbMultiANAN_data.append(",");
+ gsmSbMultiANAN_data.append(mNeighboringCellInfo.getCid());
+ gsmSbMultiANAN_data.append(",");
+ gsmSbMultiANAN_data.append(150 - Math.abs(mNeighboringCellInfo.getRssi()));
// Gator MCC(%03d)+MNC(%03d)+LACID(%04X)+CELLID(%07X)+RX LEVEL(%02X)
- gsmSbMultiGator_data.append(",");
- gsmSbMultiGator_data.append(String.format("%1$03d",mcc));
- gsmSbMultiGator_data.append(String.format("%1$03d",mnc));
- gsmSbMultiGator_data.append(String.format("%1$04X",mNeighboringCellInfo.getLac()));
- gsmSbMultiGator_data.append(String.format("%1$07X",mNeighboringCellInfo.getCid()));
- gsmSbMultiGator_data.append(String.format("%1$02X",150-Math.abs(mNeighboringCellInfo.getRssi())));
- //添加gsm station到Runtime全局变量
- runtime.getLocationInstance().append_gsmstation(mNeighboringCellInfo.getLac()+","+mNeighboringCellInfo.getCid(),150-Math.abs(mNeighboringCellInfo.getRssi()));
-
- maxstationCount ++;
- if (maxstationCount == 5) {
+ gsmSbMultiGator_data.append(",");
+ gsmSbMultiGator_data.append(String.format("%1$03d", mcc));
+ gsmSbMultiGator_data.append(String.format("%1$03d", mnc));
+ gsmSbMultiGator_data.append(String.format("%1$04X", mNeighboringCellInfo.getLac()));
+ gsmSbMultiGator_data.append(String.format("%1$07X", mNeighboringCellInfo.getCid()));
+ gsmSbMultiGator_data.append(String.format("%1$02X", 150 - Math.abs(mNeighboringCellInfo.getRssi())));
+ //添加gsm station到Runtime全局变量
+ runtime.getLocationInstance().append_gsmstation(mNeighboringCellInfo.getLac() + "," + mNeighboringCellInfo.getCid(), 150 - Math.abs(mNeighboringCellInfo.getRssi()));
+
+ maxstationCount++;
+ if (maxstationCount == 5) {
// break;
- }
- }
- size += maxstationCount;
- }
+ }
+ }
+ size += maxstationCount;
+ }
+
+ StringBuilder mmcmnc1 = new StringBuilder(mccmnc);
+ mmcmnc1.insert(3, ",");
+ gsmSbMulti.append(size);
+ gsmSbMulti.append(",");
+ gsmSbMulti.append(mmcmnc1);
+ gsmSbMulti.append(",");
+ gsmSbMulti.append(gsmCell.getLac());
+ gsmSbMulti.append("|");
+ gsmSbMulti.append(gsmCell.getCid());
+ gsmSbMulti.append("|");
+ gsmSbMulti.append(150 - Math.abs(getSignal(telephonyManager, runtime)));
+ gsmSbMulti.append(gsmSbMulti_data.toString());
+
+
+ gsmSbMultiFZD.append(size);
+ gsmSbMultiFZD.append(",");
+ gsmSbMultiFZD.append(1);
+ gsmSbMultiFZD.append(",");
+ gsmSbMultiFZD.append(mmcmnc1);
+ gsmSbMultiFZD.append(",");
+ gsmSbMultiFZD.append(gsmCell.getLac());
+ gsmSbMultiFZD.append(",");
+ gsmSbMultiFZD.append(gsmCell.getCid());
+ gsmSbMultiFZD.append(",");
+ gsmSbMultiFZD.append(150 - Math.abs(getSignal(telephonyManager, runtime)));
+ gsmSbMultiFZD.append(gsmSbMultiFZD_data.toString());
+
+ gsmSbMultiANAN.append(size);
+ gsmSbMultiANAN.append(",");
+ gsmSbMultiANAN.append(mmcmnc1);
+ gsmSbMultiANAN.append(",");
+ gsmSbMultiANAN.append(gsmCell.getLac());
+ gsmSbMultiANAN.append(",");
+ gsmSbMultiANAN.append(gsmCell.getCid());
+ gsmSbMultiANAN.append(",");
+ gsmSbMultiANAN.append(150 - Math.abs(getSignal(telephonyManager, runtime)));
+ gsmSbMultiANAN.append(gsmSbMultiANAN_data.toString());
+
+ gsmSbMultiGator.append(size);
+ gsmSbMultiGator.append(",");
+ gsmSbMultiGator.append(String.format("%1$03d", mcc))
+ .append(String.format("%1$03d", mnc))
+ .append(String.format("%1$04X", gsmCell.getLac()))
+ .append(String.format("%1$07X", gsmCell.getCid()))
+ .append(String.format("%1$02X", 150 - Math.abs(getSignal(telephonyManager, runtime))));
+ gsmSbMultiGator.append(gsmSbMultiGator_data.toString());
+
+ ICLogger.i("LBS GsmCellLocation MultiStation " + gsmSbMulti.toString());
+ ICLogger.i("FZD LBS GsmCellLocation MultiStation " + gsmSbMultiFZD.toString());
+ if (Config.LOG_TOFILE)
+ ICLogger.logToFile("LBS", "LBS GsmCellLocation MultiStation " + gsmSbMulti.toString());
+ if (Config.LOG_TOFILE)
+ ICLogger.logToFile("LBS", "FZD LBS GsmCellLocation MultiStation " + gsmSbMultiFZD.toString());
+ if (Config.LOG_TOFILE)
+ ICLogger.logToFile("LBS", "Gator LBS GsmCellLocation MultiStation " + gsmSbMultiGator.toString());
+
+ runtime.setLBSMultiStationData(gsmSbMulti.toString());
+ runtime.setFZDLBSMultiStationData(gsmSbMultiFZD.toString());
+ runtime.setGatorLBSMultiStationData(gsmSbMultiGator.toString());
+ runtime.setAnAnLBSStationData(gsmSbMultiANAN.toString());
+
+ return gsmSb.toString();
+ } else if (celllocation instanceof CdmaCellLocation) {
+ CdmaCellLocation cdmaCelllocation = (CdmaCellLocation) celllocation;
+ cdmaSB.append(cdmaCelllocation.getSystemId());
+ cdmaSB.append(",");
+ cdmaSB.append(cdmaCelllocation.getNetworkId());
+ cdmaSB.append(",");
+ cdmaSB.append(cdmaCelllocation.getBaseStationId());
+ cdmaSB.append(",");
+ cdmaSB.append("");
+ cdmaSB.append(",");
+ cdmaSB.append("");
+ cdmaSB.append(",");
+ cdmaSB.append(getSignal(telephonyManager, runtime));
+ ICLogger.i("CdmaCellLocation");
+ StringBuilder var8 = new StringBuilder();
+ var8.append("CDMA_info=");
+ var8.append(cdmaSB.toString());
+ ICLogger.i(var8.toString());
+ runtime.setCellinfo(null);
+ runtime.setCdmaInfo(cdmaSB.toString());
+
+ if (Config.LOG_TOFILE) ICLogger.logToFile("LBS", var8.toString());
+ return cdmaSB.toString();
- StringBuilder mmcmnc1 = new StringBuilder(mccmnc);
- mmcmnc1.insert(3, ",");
- gsmSbMulti.append(size);
- gsmSbMulti.append(",");
- gsmSbMulti.append(mmcmnc1);
- gsmSbMulti.append(",");
- gsmSbMulti.append(gsmCell.getLac());
- gsmSbMulti.append("|");
- gsmSbMulti.append(gsmCell.getCid());
- gsmSbMulti.append("|");
- gsmSbMulti.append(150-Math.abs(getSignal(telephonyManager,runtime)));
- gsmSbMulti.append(gsmSbMulti_data.toString());
-
-
- gsmSbMultiFZD.append(size);
- gsmSbMultiFZD.append(",");
- gsmSbMultiFZD.append(1);
- gsmSbMultiFZD.append(",");
- gsmSbMultiFZD.append(mmcmnc1);
- gsmSbMultiFZD.append(",");
- gsmSbMultiFZD.append(gsmCell.getLac());
- gsmSbMultiFZD.append(",");
- gsmSbMultiFZD.append(gsmCell.getCid());
- gsmSbMultiFZD.append(",");
- gsmSbMultiFZD.append(150-Math.abs(getSignal(telephonyManager,runtime)));
- gsmSbMultiFZD.append(gsmSbMultiFZD_data.toString());
-
- gsmSbMultiGator.append(size);
- gsmSbMultiGator.append(",");
- gsmSbMultiGator.append(String.format("%1$03d",mcc))
- .append(String.format("%1$03d",mnc))
- .append(String.format("%1$04X",gsmCell.getLac()))
- .append(String.format("%1$07X",gsmCell.getCid()))
- .append(String.format("%1$02X",150-Math.abs(getSignal(telephonyManager,runtime))));
- gsmSbMultiGator.append(gsmSbMultiGator_data.toString());
-
- ICLogger.i("LBS GsmCellLocation MultiStation "+ gsmSbMulti.toString());
- ICLogger.i("FZD LBS GsmCellLocation MultiStation "+ gsmSbMultiFZD.toString());
- if (Config.LOG_TOFILE) ICLogger.logToFile("LBS", "LBS GsmCellLocation MultiStation "+ gsmSbMulti.toString());
- if (Config.LOG_TOFILE) ICLogger.logToFile("LBS", "FZD LBS GsmCellLocation MultiStation "+ gsmSbMultiFZD.toString());
- if (Config.LOG_TOFILE) ICLogger.logToFile("LBS", "Gator LBS GsmCellLocation MultiStation "+ gsmSbMultiGator.toString());
-
- runtime.setLBSMultiStationData(gsmSbMulti.toString());
- runtime.setFZDLBSMultiStationData(gsmSbMultiFZD.toString());
- runtime.setGatorLBSMultiStationData(gsmSbMultiGator.toString());
-
- return gsmSb.toString();
- } else if (celllocation instanceof CdmaCellLocation) {
- CdmaCellLocation cdmaCelllocation = (CdmaCellLocation)celllocation;
- cdmaSB.append(cdmaCelllocation.getSystemId());
- cdmaSB.append(",");
- cdmaSB.append(cdmaCelllocation.getNetworkId());
- cdmaSB.append(",");
- cdmaSB.append(cdmaCelllocation.getBaseStationId());
- cdmaSB.append(",");
- cdmaSB.append("");
- cdmaSB.append(",");
- cdmaSB.append("");
- cdmaSB.append(",");
- cdmaSB.append(getSignal(telephonyManager,runtime));
- ICLogger.i("CdmaCellLocation");
- StringBuilder var8 = new StringBuilder();
- var8.append("CDMA_info=");
- var8.append(cdmaSB.toString());
- ICLogger.i(var8.toString());
- runtime.setCellinfo(null);
- runtime.setCdmaInfo(cdmaSB.toString());
-
- if (Config.LOG_TOFILE) ICLogger.logToFile("LBS", var8.toString());
- return cdmaSB.toString();
+ }
+ return null;
+ }
+ } else {
+ ICLogger.i("operator == null || operator.length() <= 3");
+ return null;
}
-
- return null;
- }
- } else {
- ICLogger.i("operator == null || operator.length() <= 3");
- return null;
}
- }
- private static void sortByRssi(List<NeighboringCellInfo> var1) {
- Collections.sort(var1, new Comparator<NeighboringCellInfo>() {
- public int compare(NeighboringCellInfo var1, NeighboringCellInfo var2) {
- return var2.getRssi() - var1.getRssi();
- }
- });
- }
- public static void setCurrentAttachCellInfo(Runtime dev) {
-
- (new Thread(new Runnable() {
- public void run() {
-
- if (dev !=null) {
- //更新lbs信息
- getCellInfo(dev.getContextProxy().getTelephonyManager(),dev);
+ private static void sortByRssi(List<NeighboringCellInfo> var1) {
+ Collections.sort(var1, new Comparator<NeighboringCellInfo>() {
+ public int compare(NeighboringCellInfo var1, NeighboringCellInfo var2) {
+ return var2.getRssi() - var1.getRssi();
}
+ });
+ }
- }
+ public static void setCurrentAttachCellInfo(Runtime dev) {
+
+ (new Thread(new Runnable() {
+ public void run() {
+
+ if (dev != null) {
+ //更新lbs信息
+ getCellInfo(dev.getContextProxy().getTelephonyManager(), dev);
+
+ }
+
+ }
})).start();
- }
+ }
}