Fix Binder Crash due to CellInfo Timeout
When CELL_INFO requests time out at the modem, a
null response is returned so that callers can
differentiate between no cells found and an error.
Bug: 117153084
Test: Manually verified with SL4A by forcing timeout
with a binder call.
Change-Id: I427550c89d3fe50213c4a3d89be4c476144119e9
diff --git a/src/com/android/phone/PhoneInterfaceManager.java b/src/com/android/phone/PhoneInterfaceManager.java
index 353f4b5..876ce0a 100755
--- a/src/com/android/phone/PhoneInterfaceManager.java
+++ b/src/com/android/phone/PhoneInterfaceManager.java
@@ -990,7 +990,9 @@
case EVENT_GET_ALL_CELL_INFO_DONE:
ar = (AsyncResult) msg.obj;
request = (MainThreadRequest) ar.userObj;
- request.result = (ar.exception == null) ? ar.result : new ArrayList<CellInfo>();
+ // If a timeout occurs, the response will be null
+ request.result = (ar.exception == null && ar.result != null)
+ ? ar.result : new ArrayList<CellInfo>();
synchronized (request) {
request.notifyAll();
}