Fix error response handling for RIL request
Settings ANR observed if triggered PLMN scan immediately after modem
SSR. When network scan starts, telephony layer sent
REQUEST_GET_PREFERRED_NETWORK_TYPE to RIL for which RIL responded with
error. In the current code, there is an unhandled error case for this
RIL request, which causes the corresponding thread to run in an
infinite loop
This change adds a condition to ensure that the loop breaks even
in an error scenario.
Bug: 161215902
Change-Id: I06d7b02a4a1ac1e85e1d7b1d1611ba2315e50290
diff --git a/src/com/android/phone/PhoneInterfaceManager.java b/src/com/android/phone/PhoneInterfaceManager.java
index 8c6be60..46d6463 100755
--- a/src/com/android/phone/PhoneInterfaceManager.java
+++ b/src/com/android/phone/PhoneInterfaceManager.java
@@ -755,7 +755,9 @@
if (ar.exception == null && ar.result != null) {
request.result = ar.result; // Integer
} else {
- request.result = null;
+ // request.result must be set to something non-null
+ // for the calling thread to unblock
+ request.result = new int[]{-1};
if (ar.result == null) {
loge("getPreferredNetworkType: Empty response");
} else if (ar.exception instanceof CommandException) {