Loading telephony/java/android/telephony/CellLocation.java +5 −0 Original line number Diff line number Diff line Loading @@ -78,6 +78,11 @@ public abstract class CellLocation { */ public abstract void fillInNotifierBundle(Bundle bundle); /** * @hide */ public abstract boolean isEmpty(); /** * Return a new CellLocation object representing an unknown * location, or null for unknown/none phone radio types. Loading telephony/java/android/telephony/TelephonyManager.java +4 −1 Original line number Diff line number Diff line Loading @@ -203,7 +203,10 @@ public class TelephonyManager { public CellLocation getCellLocation() { try { Bundle bundle = getITelephony().getCellLocation(); return CellLocation.newFromBundle(bundle); CellLocation cl = CellLocation.newFromBundle(bundle); if (cl.isEmpty()) return null; return cl; } catch (RemoteException ex) { return null; } catch (NullPointerException ex) { Loading telephony/java/android/telephony/cdma/CdmaCellLocation.java +12 −0 Original line number Diff line number Diff line Loading @@ -204,6 +204,18 @@ public class CdmaCellLocation extends CellLocation { bundleToFill.putInt("networkId", this.mNetworkId); } /** * @hide */ public boolean isEmpty() { return (this.mBaseStationId == -1 && this.mBaseStationLatitude == INVALID_LAT_LONG && this.mBaseStationLongitude == INVALID_LAT_LONG && this.mSystemId == -1 && this.mNetworkId == -1); } } telephony/java/android/telephony/gsm/GsmCellLocation.java +7 −0 Original line number Diff line number Diff line Loading @@ -119,4 +119,11 @@ public class GsmCellLocation extends CellLocation { m.putInt("lac", mLac); m.putInt("cid", mCid); } /** * @hide */ public boolean isEmpty() { return (mLac == -1 && mCid == -1); } } Loading
telephony/java/android/telephony/CellLocation.java +5 −0 Original line number Diff line number Diff line Loading @@ -78,6 +78,11 @@ public abstract class CellLocation { */ public abstract void fillInNotifierBundle(Bundle bundle); /** * @hide */ public abstract boolean isEmpty(); /** * Return a new CellLocation object representing an unknown * location, or null for unknown/none phone radio types. Loading
telephony/java/android/telephony/TelephonyManager.java +4 −1 Original line number Diff line number Diff line Loading @@ -203,7 +203,10 @@ public class TelephonyManager { public CellLocation getCellLocation() { try { Bundle bundle = getITelephony().getCellLocation(); return CellLocation.newFromBundle(bundle); CellLocation cl = CellLocation.newFromBundle(bundle); if (cl.isEmpty()) return null; return cl; } catch (RemoteException ex) { return null; } catch (NullPointerException ex) { Loading
telephony/java/android/telephony/cdma/CdmaCellLocation.java +12 −0 Original line number Diff line number Diff line Loading @@ -204,6 +204,18 @@ public class CdmaCellLocation extends CellLocation { bundleToFill.putInt("networkId", this.mNetworkId); } /** * @hide */ public boolean isEmpty() { return (this.mBaseStationId == -1 && this.mBaseStationLatitude == INVALID_LAT_LONG && this.mBaseStationLongitude == INVALID_LAT_LONG && this.mSystemId == -1 && this.mNetworkId == -1); } }
telephony/java/android/telephony/gsm/GsmCellLocation.java +7 −0 Original line number Diff line number Diff line Loading @@ -119,4 +119,11 @@ public class GsmCellLocation extends CellLocation { m.putInt("lac", mLac); m.putInt("cid", mCid); } /** * @hide */ public boolean isEmpty() { return (mLac == -1 && mCid == -1); } }