Skip to content

Commit cd489c4

Browse files
Dianne HackbornAndroid (Google) Code Review
authored andcommitted
Merge "Don't crash if there is no connectivity service." into ics-mr1
2 parents 1bef480 + d4d32c5 commit cd489c4

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

core/java/android/app/ActivityThread.java

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3832,11 +3832,16 @@ private void handleBindApplication(AppBindData data) {
38323832
* Initialize the default http proxy in this process for the reasons we set the time zone.
38333833
*/
38343834
IBinder b = ServiceManager.getService(Context.CONNECTIVITY_SERVICE);
3835-
IConnectivityManager service = IConnectivityManager.Stub.asInterface(b);
3836-
try {
3837-
ProxyProperties proxyProperties = service.getProxy();
3838-
Proxy.setHttpProxySystemProperty(proxyProperties);
3839-
} catch (RemoteException e) {}
3835+
if (b != null) {
3836+
// In pre-boot mode (doing initial launch to collect password), not
3837+
// all system is up. This includes the connectivity service, so don't
3838+
// crash if we can't get it.
3839+
IConnectivityManager service = IConnectivityManager.Stub.asInterface(b);
3840+
try {
3841+
ProxyProperties proxyProperties = service.getProxy();
3842+
Proxy.setHttpProxySystemProperty(proxyProperties);
3843+
} catch (RemoteException e) {}
3844+
}
38403845

38413846
if (data.instrumentationName != null) {
38423847
ContextImpl appContext = new ContextImpl();

0 commit comments

Comments
 (0)