For bug
2422284.
Check the cell location and return null if the location is not available.
Change-Id: Ie9a331b906a8253c9a9596365af8705dc03823ce
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.
*
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) {
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);
+ }
+
+
}
m.putInt("lac", mLac);
m.putInt("cid", mCid);
}
+
+ /**
+ * @hide
+ */
+ public boolean isEmpty() {
+ return (mLac == -1 && mCid == -1);
+ }
}