diff options
| author | Wink Saville <wink@google.com> | 2013-07-02 10:55:14 -0700 |
|---|---|---|
| committer | Wink Saville <wink@google.com> | 2013-07-02 10:55:14 -0700 |
| commit | 68e6c6452ce850b8744ddf56fcb11583ecf2293b (patch) | |
| tree | e923164cabcc7e3a574d9a0b59d75f2abcf22e54 /services/java/com/android/server/ConnectivityService.java | |
| parent | 59046f40baa66d3f10761d8294a43f92feef5c2e (diff) | |
Fix NPE if mobile is not supported in checkMobileProvisioning.
Bug: 9664438
Change-Id: If0c4938956a80e8d6a21a968aa771d0d8f546b3c
Diffstat (limited to 'services/java/com/android/server/ConnectivityService.java')
| -rw-r--r-- | services/java/com/android/server/ConnectivityService.java | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/services/java/com/android/server/ConnectivityService.java b/services/java/com/android/server/ConnectivityService.java index 9e9253a0f303..e7dd3b79e31f 100644 --- a/services/java/com/android/server/ConnectivityService.java +++ b/services/java/com/android/server/ConnectivityService.java @@ -3553,6 +3553,16 @@ public class ConnectivityService extends IConnectivityManager.Stub { 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); |
