diff options
| author | 2011-11-08 17:58:26 -0800 | |
|---|---|---|
| committer | 2011-11-08 17:58:26 -0800 | |
| commit | cd489c4ce59c134c384238cbb613ede34f28189c (patch) | |
| tree | 691c5390de5c82d25891aea0089dcc19a921b19f | |
| parent | 1bef480b223f03d0fc866f08ca101a07ead89bc2 (diff) | |
| parent | d4d32c594f9a414821df147f503af5748d839c66 (diff) | |
Merge "Don't crash if there is no connectivity service." into ics-mr1
| -rw-r--r-- | core/java/android/app/ActivityThread.java | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/core/java/android/app/ActivityThread.java b/core/java/android/app/ActivityThread.java index 00fe953f70e3..a4714cab3542 100644 --- a/core/java/android/app/ActivityThread.java +++ b/core/java/android/app/ActivityThread.java @@ -3832,11 +3832,16 @@ public final class ActivityThread { * Initialize the default http proxy in this process for the reasons we set the time zone. */ IBinder b = ServiceManager.getService(Context.CONNECTIVITY_SERVICE); - IConnectivityManager service = IConnectivityManager.Stub.asInterface(b); - try { - ProxyProperties proxyProperties = service.getProxy(); - Proxy.setHttpProxySystemProperty(proxyProperties); - } catch (RemoteException e) {} + if (b != null) { + // In pre-boot mode (doing initial launch to collect password), not + // all system is up. This includes the connectivity service, so don't + // crash if we can't get it. + IConnectivityManager service = IConnectivityManager.Stub.asInterface(b); + try { + ProxyProperties proxyProperties = service.getProxy(); + Proxy.setHttpProxySystemProperty(proxyProperties); + } catch (RemoteException e) {} + } if (data.instrumentationName != null) { ContextImpl appContext = new ContextImpl(); |