diff options
| author | Grace Kloba <klobag@google.com> | 2009-08-03 10:49:58 -0700 |
|---|---|---|
| committer | Grace Kloba <klobag@google.com> | 2009-08-03 10:49:58 -0700 |
| commit | f6d1a5528ee626487c78f17501d61e61bbe26b10 (patch) | |
| tree | 862160b712e3922fb6d21c832ff3f804b055e413 /core/java/android/net | |
| parent | 8050220374e67e0ffa9d92551f422c02cacadd9d (diff) | |
| parent | b8802b21384e7e0136c423c34eb64c445033afa5 (diff) | |
| download | frameworks_base-f6d1a5528ee626487c78f17501d61e61bbe26b10.zip frameworks_base-f6d1a5528ee626487c78f17501d61e61bbe26b10.tar.gz frameworks_base-f6d1a5528ee626487c78f17501d61e61bbe26b10.tar.bz2 | |
resolved conflicts for merge of b8802b21 to master
Diffstat (limited to 'core/java/android/net')
| -rw-r--r-- | core/java/android/net/http/EventHandler.java | 5 | ||||
| -rw-r--r-- | core/java/android/net/http/HttpsConnection.java | 5 | ||||
| -rw-r--r-- | core/java/android/net/http/LoggingEventHandler.java | 4 |
3 files changed, 11 insertions, 3 deletions
diff --git a/core/java/android/net/http/EventHandler.java b/core/java/android/net/http/EventHandler.java index 830d1f1..a035c19 100644 --- a/core/java/android/net/http/EventHandler.java +++ b/core/java/android/net/http/EventHandler.java @@ -141,7 +141,10 @@ public interface EventHandler { * SSL certificate error callback. Handles SSL error(s) on the way * up to the user. The callback has to make sure that restartConnection() is called, * otherwise the connection will be suspended indefinitely. + * @return True if the callback can handle the error, which means it will + * call restartConnection() to unblock the thread later, + * otherwise return false. */ - public void handleSslErrorRequest(SslError error); + public boolean handleSslErrorRequest(SslError error); } diff --git a/core/java/android/net/http/HttpsConnection.java b/core/java/android/net/http/HttpsConnection.java index 55b733f..8a69d0d 100644 --- a/core/java/android/net/http/HttpsConnection.java +++ b/core/java/android/net/http/HttpsConnection.java @@ -323,7 +323,10 @@ public class HttpsConnection extends Connection { mSuspended = true; } // don't hold the lock while calling out to the event handler - eventHandler.handleSslErrorRequest(error); + boolean canHandle = eventHandler.handleSslErrorRequest(error); + if(!canHandle) { + throw new IOException("failed to handle "+ error); + } synchronized (mSuspendLock) { if (mSuspended) { try { diff --git a/core/java/android/net/http/LoggingEventHandler.java b/core/java/android/net/http/LoggingEventHandler.java index 1b18651..bdafa0b 100644 --- a/core/java/android/net/http/LoggingEventHandler.java +++ b/core/java/android/net/http/LoggingEventHandler.java @@ -82,9 +82,11 @@ public class LoggingEventHandler implements EventHandler { } } - public void handleSslErrorRequest(SslError error) { + public boolean handleSslErrorRequest(SslError error) { if (HttpLog.LOGV) { HttpLog.v("LoggingEventHandler: handleSslErrorRequest():" + error); } + // return false so that the caller thread won't wait forever + return false; } } |
