From ce40801ef5e1c91888e6c186710ce0578801b139 Mon Sep 17 00:00:00 2001 From: Nathan Harold Date: Tue, 25 Sep 2018 20:10:48 -0700 Subject: [PATCH] Catch IllegalArgumentException on NetworkScan.stopScan IllegalArgumentException is thrown when a terminated scan calls stop. This change softens the exception and error type that is logged and considers this normal. Bug: 113823866 Test: compilation Change-Id: I7ce60d6badfac52156cceca83b39c1afe21b4eda --- telephony/java/android/telephony/NetworkScan.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/telephony/java/android/telephony/NetworkScan.java b/telephony/java/android/telephony/NetworkScan.java index 7c7d7a0397ad7..202da6817cb5a 100644 --- a/telephony/java/android/telephony/NetworkScan.java +++ b/telephony/java/android/telephony/NetworkScan.java @@ -16,11 +16,10 @@ package android.telephony; +import android.annotation.IntDef; import android.content.Context; import android.os.RemoteException; import android.os.ServiceManager; -import android.annotation.IntDef; -import android.util.Log; import com.android.internal.telephony.ITelephony; @@ -113,6 +112,8 @@ public class NetworkScan { } try { telephony.stopNetworkScan(mSubId, mScanId); + } catch (IllegalArgumentException ex) { + Rlog.d(TAG, "stopNetworkScan - no active scan for ScanID=" + mScanId); } catch (RemoteException ex) { Rlog.e(TAG, "stopNetworkScan RemoteException", ex); } catch (RuntimeException ex) {