summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Hui Wang <huiwang@google.com> 2023-04-17 20:41:31 +0000
committer Hui Wang <huiwang@google.com> 2023-04-18 19:43:09 +0000
commitb535b50eaf0ee9ce06db3b422825b0e7002ad51e (patch)
tree1dab3eba5c4a2073881608d2011c81a89781c756
parent39760864b8eeb6b170cc32b7d004d7de0ae09be8 (diff)
Return with error logs instead of exception for unexpected nsi
The network scan info will be removed when the scan is stopped or cancelled. In this case, race condition would happen if ril returns the scan result at the same time. Bug: 277162146 Test: make Test: atest CtsTelephonyTestCases FrameworksTelephonyTests Change-Id: I1fc42a10ea17baa5a020164d2d8eb425e9b97029
-rw-r--r--telephony/java/android/telephony/TelephonyScanManager.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/telephony/java/android/telephony/TelephonyScanManager.java b/telephony/java/android/telephony/TelephonyScanManager.java
index 19f2a9bc67a3..b7617099bae3 100644
--- a/telephony/java/android/telephony/TelephonyScanManager.java
+++ b/telephony/java/android/telephony/TelephonyScanManager.java
@@ -153,8 +153,9 @@ public final class TelephonyScanManager {
nsi = mScanInfo.get(message.arg2);
}
if (nsi == null) {
- throw new RuntimeException(
- "Failed to find NetworkScanInfo with id " + message.arg2);
+ Rlog.e(TAG, "Unexpceted message " + message.what
+ + " as there is no NetworkScanInfo with id " + message.arg2);
+ return;
}
final NetworkScanCallback callback = nsi.mCallback;