Merge "Adding temporary logging to debug CTS failure (for CellLocationTest)." into mnc-dev

This commit is contained in:
Amit Mahajan
2015-06-08 17:27:11 +00:00
committed by Android (Google) Code Review

View File

@@ -803,17 +803,26 @@ public class TelephonyManager {
public CellLocation getCellLocation() { public CellLocation getCellLocation() {
try { try {
ITelephony telephony = getITelephony(); ITelephony telephony = getITelephony();
if (telephony == null) if (telephony == null) {
Rlog.d(TAG, "getCellLocation returning null because telephony is null");
return null; return null;
}
Bundle bundle = telephony.getCellLocation(mContext.getOpPackageName()); Bundle bundle = telephony.getCellLocation(mContext.getOpPackageName());
if (bundle.isEmpty()) return null; if (bundle.isEmpty()) {
CellLocation cl = CellLocation.newFromBundle(bundle); Rlog.d(TAG, "getCellLocation returning null because bundle is empty");
if (cl.isEmpty())
return null; return null;
}
CellLocation cl = CellLocation.newFromBundle(bundle);
if (cl.isEmpty()) {
Rlog.d(TAG, "getCellLocation returning null because CellLocation is empty");
return null;
}
return cl; return cl;
} catch (RemoteException ex) { } catch (RemoteException ex) {
Rlog.d(TAG, "getCellLocation returning null due to RemoteException " + ex);
return null; return null;
} catch (NullPointerException ex) { } catch (NullPointerException ex) {
Rlog.d(TAG, "getCellLocation returning null due to NullPointerException " + ex);
return null; return null;
} }
} }