Loading services/java/com/android/server/location/GpsLocationProvider.java +6 −7 Original line number Original line Diff line number Diff line Loading @@ -1452,11 +1452,11 @@ public class GpsLocationProvider implements LocationProviderInterface { private void requestRefLocation(int flags) { private void requestRefLocation(int flags) { TelephonyManager phone = (TelephonyManager) TelephonyManager phone = (TelephonyManager) mContext.getSystemService(Context.TELEPHONY_SERVICE); mContext.getSystemService(Context.TELEPHONY_SERVICE); if (phone.getPhoneType() == TelephonyManager.PHONE_TYPE_GSM) { final int phoneType = phone.getPhoneType(); if (phoneType == TelephonyManager.PHONE_TYPE_GSM) { GsmCellLocation gsm_cell = (GsmCellLocation) phone.getCellLocation(); GsmCellLocation gsm_cell = (GsmCellLocation) phone.getCellLocation(); if ((gsm_cell != null) && (phone.getPhoneType() == TelephonyManager.PHONE_TYPE_GSM) && if ((gsm_cell != null) && (phone.getNetworkOperator() != null) (phone.getNetworkOperator() != null) && && (phone.getNetworkOperator().length() > 3)) { (phone.getNetworkOperator().length() > 3)) { int type; int type; int mcc = Integer.parseInt(phone.getNetworkOperator().substring(0,3)); int mcc = Integer.parseInt(phone.getNetworkOperator().substring(0,3)); int mnc = Integer.parseInt(phone.getNetworkOperator().substring(3)); int mnc = Integer.parseInt(phone.getNetworkOperator().substring(3)); Loading @@ -1474,8 +1474,7 @@ public class GpsLocationProvider implements LocationProviderInterface { } else { } else { Log.e(TAG,"Error getting cell location info."); Log.e(TAG,"Error getting cell location info."); } } } } else if (phoneType == TelephonyManager.PHONE_TYPE_CDMA) { else { Log.e(TAG, "CDMA not supported."); Log.e(TAG, "CDMA not supported."); } } } } Loading Loading
services/java/com/android/server/location/GpsLocationProvider.java +6 −7 Original line number Original line Diff line number Diff line Loading @@ -1452,11 +1452,11 @@ public class GpsLocationProvider implements LocationProviderInterface { private void requestRefLocation(int flags) { private void requestRefLocation(int flags) { TelephonyManager phone = (TelephonyManager) TelephonyManager phone = (TelephonyManager) mContext.getSystemService(Context.TELEPHONY_SERVICE); mContext.getSystemService(Context.TELEPHONY_SERVICE); if (phone.getPhoneType() == TelephonyManager.PHONE_TYPE_GSM) { final int phoneType = phone.getPhoneType(); if (phoneType == TelephonyManager.PHONE_TYPE_GSM) { GsmCellLocation gsm_cell = (GsmCellLocation) phone.getCellLocation(); GsmCellLocation gsm_cell = (GsmCellLocation) phone.getCellLocation(); if ((gsm_cell != null) && (phone.getPhoneType() == TelephonyManager.PHONE_TYPE_GSM) && if ((gsm_cell != null) && (phone.getNetworkOperator() != null) (phone.getNetworkOperator() != null) && && (phone.getNetworkOperator().length() > 3)) { (phone.getNetworkOperator().length() > 3)) { int type; int type; int mcc = Integer.parseInt(phone.getNetworkOperator().substring(0,3)); int mcc = Integer.parseInt(phone.getNetworkOperator().substring(0,3)); int mnc = Integer.parseInt(phone.getNetworkOperator().substring(3)); int mnc = Integer.parseInt(phone.getNetworkOperator().substring(3)); Loading @@ -1474,8 +1474,7 @@ public class GpsLocationProvider implements LocationProviderInterface { } else { } else { Log.e(TAG,"Error getting cell location info."); Log.e(TAG,"Error getting cell location info."); } } } } else if (phoneType == TelephonyManager.PHONE_TYPE_CDMA) { else { Log.e(TAG, "CDMA not supported."); Log.e(TAG, "CDMA not supported."); } } } } Loading