Fix NPE if mobile is not supported in checkMobileProvisioning.
Bug: 9664438
Change-Id: If0c4938956a80e8d6a21a968aa771d0d8f546b3c
diff --git a/services/java/com/android/server/ConnectivityService.java b/services/java/com/android/server/ConnectivityService.java
index 9e9253a..e7dd3b7 100644
--- a/services/java/com/android/server/ConnectivityService.java
+++ b/services/java/com/android/server/ConnectivityService.java
@@ -3553,6 +3553,16 @@
timeOutMs = CheckMp.MAX_TIMEOUT_MS;
}
+ // Check that mobile networks are supported
+ if (!isNetworkSupported(ConnectivityManager.TYPE_MOBILE)
+ || !isNetworkSupported(ConnectivityManager.TYPE_MOBILE_HIPRI)) {
+ log("checkMobileProvisioning: X no mobile network");
+ if (resultReceiver != null) {
+ resultReceiver.send(ConnectivityManager.CMP_RESULT_CODE_NO_CONNECTION, null);
+ }
+ return timeOutMs;
+ }
+
final long token = Binder.clearCallingIdentity();
try {
CheckMp checkMp = new CheckMp(mContext, this);