Add support for CellInfoCallback#onError
Invoke CellInfoCallback#onError in two cases
1) When RIL determines a timeout and returns
a timeout failure to the higher layer.
2) When the IRadio returns an explicit failure
for getCellInfoList()
Bug: 120488917
Test: manual (with SL4A)
Change-Id: I5bba7844800c7a7d046d0fc57ae8401e82427909
diff --git a/src/com/android/phone/PhoneInterfaceManager.java b/src/com/android/phone/PhoneInterfaceManager.java
index 912a417..6088a9a 100755
--- a/src/com/android/phone/PhoneInterfaceManager.java
+++ b/src/com/android/phone/PhoneInterfaceManager.java
@@ -1036,13 +1036,12 @@
ICellInfoCallback cb = (ICellInfoCallback) request.argument;
try {
if (ar.exception != null) {
- // something went wrong... the response is null
Log.e(LOG_TAG, "Exception retrieving CellInfo=" + ar.exception);
- cb.onCellInfo(null);
+ cb.onError(TelephonyManager.CellInfoCallback.ERROR_MODEM_ERROR,
+ new android.os.ParcelableException(ar.exception));
} else if (ar.result == null) {
- // timeout occurred, so force the result to non-null "empty"
Log.w(LOG_TAG, "Timeout Waiting for CellInfo!");
- cb.onCellInfo(new ArrayList<CellInfo>());
+ cb.onError(TelephonyManager.CellInfoCallback.ERROR_TIMEOUT, null);
} else {
// use the result as returned
cb.onCellInfo((List<CellInfo>) ar.result);